1. Assemble the 4WD chassis kit according to the included instructions, mounting the motors and wheels securely.
2. Insert the two 18650 batteries into the battery holder and connect the holder to the input of the 5V buck converter.
3. Adjust the buck converter output voltage to a stable 5V using a multimeter.
4. Connect the buck converter output to power the Raspberry Pi Zero 2 W (via 5V and GND pins) and the L298N motor driver module (5V and GND).
5. Connect the Raspberry Pi Camera Module v2 to the Raspberry Pi Zero 2 W's CSI camera port carefully.
6. Wire the DC motors to the L298N motor driver outputs (4 motors to 2 motor channels, using motor pairs in parallel or using a 4-channel driver if available; for L298N, connect motors in pairs per channel):
- Motor A terminals to OUT1 and OUT2
- Motor B terminals to OUT3 and OUT4
7. Connect L298N motor driver input pins to Raspberry Pi GPIO pins:
- IN1 (L298N) to GPIO17
- IN2 (L298N) to GPIO27
- IN3 (L298N) to GPIO22
- IN4 (L298N) to GPIO23
8. Connect ENA and ENB (enable pins) on L298N to 5V (or control via PWM GPIO pins if speed control is desired).
9. Connect all grounds (battery holder, buck converter, L298N GND, Raspberry Pi GND) together.
10. Power on the Raspberry Pi Zero 2 W with the battery-powered 5V supply.
11. Enable the camera and SSH on Raspberry Pi OS via raspi-config.
12. Install Python 3, Flask, and necessary libraries:
sudo apt update
sudo apt install python3-pip
pip3 install flask gpiozero picamera
13. Create a Python Flask server script that:
- Streams live video from the Raspberry Pi Camera Module v2.
- Provides GPIO control endpoints for motor movement (forward, backward, left, right, stop).
14. Write an HTML UI with buttons to control the robot car through the Flask server.
15. Test the motor controls and camera streaming locally, then access the Flask UI via WiFi from another device.
16. Securely mount all components on the chassis using double-sided tape or screws.
17. Finalize wiring to ensure no loose connections and test the entire system.
Example GPIO wiring summary:
Raspberry Pi GPIO17 -> L298N IN1
Raspberry Pi GPIO27 -> L298N IN2
Raspberry Pi GPIO22 -> L298N IN3
Raspberry Pi GPIO23 -> L298N IN4
Power: 5V from buck converter -> Raspberry Pi 5V pin and L298N 5V pin
Ground: Common ground across battery holder, buck converter, L298N, and Raspberry Pi
Camera connected to Raspberry Pi CSI port
(Flask server and camera streaming code available upon request or can be found in Raspberry Pi documentation for camera streaming and GPIO control.)