Bukit Mertajam, Penang

Getting Started with Maker pHAT

This tutorial will focus on how to get started with Maker pHAT.

Video

This video will show you how to get started with Maker pHAT.

1 – Preparing Hardware

To get started, we recommend you to have:

2 – Install the Latest Raspbian OS

Note: The latest NOOBS (V2.9.0) already comes with Raspbian pre-installed. If you buy 16GB Micro SD Card with NOOBS for RPI, you don’t need to write Raspbian image.

Download the latest Raspbian OS (Raspbian Stretch with Desktop) and write the image on the SD card using Etcher.

Etcher

After done flashing, take the SD card out and insert back to your laptop. Open SD card directory (e.g. D:/boot) and open config.txt file. Put enable_uart=1 at the bottom of the line. Save and eject the SD card. Then insert the SD card into Raspberry Pi Zero WH.

Enable UART

3 – Install Maker pHAT Driver

Don’t stack the Maker pHAT to Raspberry Pi Zero WH yet. Connect Maker pHAT to your laptop using USB Micro B Cable. Check either your laptop is able to detect the Maker pHAT. Open Device Manager, and check under Ports (COM & LPT) category. It should be detected as USB-SERIAL CH340 (COM number). If yes, you can proceed to the next step. If not, download and install Maker pHAT driver.

Download and install Maker pHAT driver. Please choose appropriate driver depends on your laptop/PC operating system:

Once detected, disconnect the USB cable. Stack Maker pHAT on the top of Raspberry Pi Zero WH.

4- Install PuTTY (Windows)

For Windows user, download and install PuTTY. Connect your Maker pHAT to your laptop using USB Micro B Cable. Since Maker pHAT is already stacked on the Raspberry Pi, this connection will power up Raspberry Pi through Maker pHAT. Please be reminded to do not easily disconnect the cable without proper shutdown.

Open PuTTY software. Tick on the Serial, then write your COM number (e.g. COM3). Please refer to your Device Manager. Set Speed to 115200. Then click Open.

PuTTy

Press Enter, then insert Raspberry Pi default login information as follow.

  • raspberrypi login: pi
  • password: raspberry
Pi Login

So far, you’re able to access Raspberry Pi through serial remote (Maker pHAT). We will further guide you until we can remote using VNC Viewer (Virtual Network Computing).

5 – Connect to WiFi

To remote using VNC Viewer, we need a WiFi connection. We can set the WiFi connection in Raspberry Pi Software Configuration Tool. Write the following command and Enter.

sudo raspi-config

raspi-config

Go to number 2 Network Options. Then Enter.

Network Options

Choose N2 Wi-fi and Enter.

Wi-fi

Choose your country and press Enter.

WiFi Country

Write your WiFi SSID (Enter), followed by WiFi passphrase (Enter).

SSID
Passphrase

Done setting for WiFi connection. Press Enter to <Ok>.

WiFi Country MY

Next, we need to enable VNC server in Raspberry Pi. Go back to the top menu, and select to the number  5 Interfacing Options.

Interfacing Options

Select P3 VNC.

P3 VNC

Choose <Yes> to enable VNC, and Enter.

Enable VNC

VNC server is enabled. Press Enter to <Ok>.

VNC is enabled

Press Esc to exit Raspberry Pi Configuration Tool. Now, reboot Raspberry Pi to enable WiFi connection and VNC server. Write following command followed by Enter.

sudo reboot

sudo reboot

Login to Raspberry Pi like previous. If all your setting is correct, your Pi will connect to WiFi. Next we need to trace the IP address. Write following command and Enter.

ifconfig

ifconfig

Your Raspberry Pi will display IP address (e.g. 192.168.0.106).

IP Address

We recommend you to update your Raspbian with following command.

sudo apt-get update

Done update, open VNC Viewer and insert Raspberry Pi’s IP address on the text bar. Then press Enter.

VNC Insert IP

A warning window will popup. Sometimes the warning is in yellow and sometimes in red. Proceed with Continue button.

VNC Identity Check

Fill up Raspberry Pi default login information.

  • Username: pi
  • Password: raspberry

Press OK.

VNC Authentication

Tadaa. Your VNC remote is successful. Now you can access Raspberry Pi Desktop through VNC Viewer and WiFi connection.

VNC Pi

Maker pHAT Demo Code (Python)

You can try the demo code below using Python 3 (IDLE).

Maker pHAT Demo Code Video

This video will show you how the demo code works on Maker pHAT.

Thank You

Thanks for reading this tutorial. For more details, you can refer to Maker pHAT User’s Manual. If you have any technical inquiry, please post at Cytron Technical Forum.

Related Posts

Leave a comment

Loading...