Embark on Embedded System Development: Raspberry Pi Beginner’s Toolkit

1. Introduction: Raspberry Pi Embedded System Development Kit

Embark on Embedded System Development Raspberry Pi Beginner's Toolkit

The Raspberry Pi Embedded System Development Kit offers an ideal platform for both learning and utilizing Raspberry Pi capabilities. Built around the Raspberry Pi Zero, it features a 320*240 LCD with touch functionality for display purposes, along with an integrated chip for audio processing, playback, and recording. Additionally, it includes a speaker, a 3.5mm audio jack, and dual microphones, along with standard Pi add-ons like A/D and GPIO expansions. Utilizing an SPI display and hardware expansions such as Mic/Audio, it is tailored to cater to the needs of embedded projects more effectively.

Being among the most prosperous open hardware platforms, Raspberry Pi has found extensive use across numerous applications. This Pi interface Hat serves as an excellent learning tool for beginners keen on exploring Raspberry Pi. Makerfabs has curated a plethora of demos for Raspberry Pi, facilitating effortless learning in displaying, playing, recording, and more. Hence, let's initiate our journey with the Raspberry Pi Embedded System Development Kit.

2. Features

The Raspberry Pi Zero W features a 1GHz single-core CPU, 512MB of RAM, a Micro USB OTG port, a Mini HDMI port, a CSI camera connector, wireless LAN, and Bluetooth capabilities. It also comes equipped with a 3.2-inch display boasting a resolution of 320×240, driven by the ili9341 driver via SPI. The display features a resistive touch screen with an XPT2046 controller, along with a built-in speaker and a 3.5mm audio jack. It includes a Stereo Codec with a Class D Speaker Driver (WM8960) and MEMS microphones (AOS3729A-T42-NXC). Furthermore, the hardware is expandable with I2C, GPIO, and UART ports, as well as an ADC port supported by the ADS1115. It can be powered via Type-C USB or battery, supporting chargeable operations with a maximum charging current of 1A. Additional safety features include overcharge and over-discharge protection. The dimensions of the device measure 94mm x 80mm x 24mm.

3. Diagram & Parts Details

The board features a 3.2-inch TFT LCD Display, accompanied by a pair of microphones on either side.

Port1, port2, port3, port4, port7, and port8 are situated on the left and right edges. These ports encompass Power Pins, GPIO Pins, Analog Pins, and I2C Pins.

The front side features port5 and port6, serving as Power, GPIO, and UART Pins. To provide power to the board, a Type C USB port is present. Additionally, there's a power button to activate the module.

The kit features a Raspberry Pi Zero W Board integrated with a 16GB SD Card Storage. It includes a 3.5mm Audio Jack for audio input and an onboard Speaker for audio output. Power options include a 3.7V Lithium-Ion Battery or a Type C USB Power Supply.

4. Basic Usage

To initiate, begin by unboxing the product package, pressing the button, and subsequently, the Pi interface Hat will be operational. Upon system power-up (Pi Zero necessitates approximately one minute for startup), a brief animation accompanied by audio will be displayed.

Afterward, you'll encounter three options displayed for running various programs. Simply press the desired option to initiate the corresponding program. You can then explore some basic demos, including screen testing, audio recording, and temperature measurement.

Touch Set

Touch each black pixel on the screen individually using your finger or a touchscreen pen to calibrate the touch accuracy. After each pixel is touched, the screen will flash to a new page where you can freely touch or draw. To return to the options menu, press the button located at the top right corner.

Record audio

Press the recording button on the left to initiate a 5-second audio recording. Then, click the play button on the right to listen to the recorded audio through the speaker.

Measure temperature

Attach the Mabee_DHT11 module to Port 5 (GPIO 22) of the device, then press the temperature measurement button. The screen will show the temperature and humidity readings shortly after.

5. Connecting to Internet via WiFi

Prior to beginning, ensure you connect the Raspberry Pi to your WiFi network.

Prepare a Software

SSH, which stands for Secure Shell, is a cryptographic network protocol designed to facilitate the secure operation of network services across unsecured networks. While it is commonly used for remote command-line access, login procedures, and executing commands remotely, SSH can secure any network service.

B. PuTTY tool

PuTTY functions as an SSH client, commonly employed for remote Raspberry Pi management. You can obtain the installation package from this link: https://www.putty.org/.

How to connect?

Extract the SD card from the Raspberry Pi and insert it into the PC. Navigate to the SD card's root directory where you'll find several files.

In this root directory, generate a new file named “wpa_supplicant.conf”.

Begin by opening a fresh file named wpa_supplicant.conf with a text editor, then paste the provided code snippet below into it. Replace the placeholders “***” with your actual WiFi SSID and password. Finally, save the file and close the editor.

 

Set up a folder called SSH in the root, which is to turn on the Raspberry Pi SSH service.

Insert the SD card back into the Raspberry Pi and re-power the Pi Interface Hat. The Raspberry Pi will then automatically establish a connection to Wi-Fi.

Ensure both your computer and Raspberry Pi are connected to the same network. Launch Putty, input “raspberrypi.local” in the address field, and then click “open”.

Please provide the Raspberry Pi username and password in sequential steps.
Raspberry Pi Username: pi
Initial Raspberry Pi password: raspberry
Note: The password will not be visible as you enter it, and it must be entered in a single attempt.

Now input the command “ifconfig” in the terminal to check the Raspberry Pi IP.

The WiFi connection has been successfully established. Next time, you can utilize the IP address to access the Putty terminal, as outlined below.

6. Kill the process of default program.

Due to the automatic initiation of the default program (the 3 demos), it becomes necessary to terminate the process to prevent the Pi from being occupied. Follow these steps to terminate it:

Execute the “top” command in the terminal and locate the ID of the default program. In the top table, identify the PID (Process ID) number associated with the “default_demo” command. This PID number corresponds to the process that needs to be terminated.

Click “Ctrl+C” to exit the top table.

Enter the below command to kill the process.

  1. The detail of measuring the distance in the /PI_Interface_Hat/example/basic_demo/src/sensor_basic.c

8. Control the servo

The mini servo consists of three pins: red for VCC, brown for GND, and yellow for signal. It operates through PWM signal control. Connect the servo's signal pin to Port 5 (GPIO21 in hardware).

Please follow the instructions above to uncomment the content in the “main.c” file of the project.

“`c
// example for stereo control
control_basic();
“`

To ensure successful servo operation, it's essential to verify the signal pin used in the code located at “/src/control_basic.c”. Utilize the following command to open the “control_basic.c” code.

“`bash
sudo nano control_basic.c
“`

Note: To change the port code to 5, as specified in the BCM2835 library, which is a C library for Raspberry Pi providing access to GPIO and other IO functions on the Broadcom BCM 2835 chip, GPIO21 is represented as “5” in the BCM:

Click “Ctrl+o” and Enter to save then click “Ctrl+x” to exit.

  1. Follow the below steps to run the “make” command for verify the program.
  1. The control button will be displayed on the LCD. Touch the screen to drive the servo running.

9. Control the WS2812 LEDs

Link the WS2812 LEDs to Port 3, with the signal pin controlling them connected to IO23.

  1. (Optional) There is no library that support WS2812 and you have to run the command to install the WS2812 library.
  1. Uncomment the content in the main.c of the project.
  1. Open “ws2812_basic.c” by:

Modify the code to “sudo python ./py/ws2812_test.py”, the final such as the picture.

  1. Follow the steps to verify the program and execute it.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top