This project enables remote control and live video streaming for a robot powered by a Raspberry Pi 3B+ and an Arduino Uno with a motor shield. The system provides a web interface for controlling the robot's movement, adjusting camera settings, and viewing a real-time video feed.
- Raspberry Pi 3B+
- Arduino Uno (connected via USB to the Pi)
- L298N Motor Shield (or compatible)
- Camera (compatible with Pi, e.g., Pi Camera v2)
- Robot chassis, motors, and power supply
- Web-based control panel for robot movement (forward, backward, left, right, stop)
- PWM speed control for motors
- Live video streaming from the Pi camera
- Camera adjustments (red/blue gain, contrast, sharpness)
- Photo capture and download
- Serial connection monitoring (disables controls if Arduino is disconnected)
- Hotspot setup for direct WiFi connection to the Pi
| Back | Front | Side | Web Controls |
|---|---|---|---|
![]() |
- Install Raspberry Pi OS (Lite or Desktop).
- Connect the Pi Camera and enable it (
sudo raspi-config). - Connect the Arduino Uno via USB.
To create a WiFi hotspot on the Pi for direct connection:
bash setup-hotspot.shThis script uses network-manager to create a hotspot named MyPiHotspot with password 123456789.
Run the following script to set up the web server and dependencies:
bash setup-stream-and-control-server.shThis script will:
- Create the project directory and necessary files.
- Install required Python packages (
flask,picamera2,opencv,pyserial). - Set up a systemd service to auto-start the server on boot.
- Deploy a Flask web app for robot control and video streaming.
After setup, access the web interface at:
http://<raspberry-pi-ip>:5000
The Arduino sketch (arduino-sketch-h-bridge.cpp) listens for serial commands from the Pi and controls the motors accordingly. Supported commands:
forward,backward,left,right,stoppwm:<value>(set speed, 0–255)
This project demonstrates a simple yet powerful way to combine a Raspberry Pi and Arduino for robotics, enabling real-time control and video streaming over WiFi. The modular design allows for easy customization and extension.
This project was written with the help of ChatGPT.
