This project demonstrates an ESP32-based remote-controlled camera system capable of transmitting live video streams over WebSockets and controlling motors and servos. A Python server application manages WebSocket communication and provides a web interface to view and control the ESP32 devices.
- Live video streaming from an ESP32-CAM to a web server.
- Remote control of a motor and a servo via WebSocket commands.
- Automatic timeout to reset motor and servo to default states.
- Dynamic multi-client video feed canvas on the server.
- ESP32-CAM (AI Thinker module or compatible board).
- Motor and servo connected to appropriate GPIO pins.
- Stable 5V power supply for the ESP32-CAM.
- Optional SD card (if required for other functionalities).
- Wi-Fi network for communication.
WiFi.h
for Wi-Fi connectivity.ArduinoWebsockets.h
for WebSocket communication.esp_camera.h
for ESP32-CAM camera control.ServoControl.h
andEsc.h
for controlling the servo and motor.Arduino.h
for standard Arduino functions.
Install the following Python libraries:
pip3 install aiohttp opencv-python numpy
- Modify the
secrets.h
file to include your Wi-Fi credentials and WebSocket server URL:
#define WIFI_SSID "YourWiFiSSID" #define WIFI_PASSWORD "YourWiFiPassword" #define WS_SERVER_URL "ws://YourServerIP:Port"
- Ensure the GPIO pins for the ca
11 Comments
conductr
Nice work! I’ve been thinking of taking on a similar project and would be curious what’s your experience like with latency? Can you view the video feed and control remotely? My main reservation is the presumption that it would be too laggy for obstacle avoidance at most speeds.
wslh
What is the approximate price of the car components?
jtwaleson
So cool! I bought the same kit last year and recently bought a esp32 game controller with a tiny display: https://github.com/01studio-lab/pyController
When I have some time I'll try to combine them so I can control the car and see the camera feed on the display.
t0mas88
Cool! I've made an ESP32 powered RC tank on tracks, controlled with a PlayStation 4 controller over Bluetooth.
The basic software is very easy to start with, about 20 lines of C using a library for the Bluetooth controller. From there I've added features for easier control. Using two sticks for two tracks works at low speed, but the thing goes close to 20 km/h (I've used two drone motors for it) so then you need a different control method. I ended up with rpm limited direct track control using the "triggers" on the dual shock controller. And more intuitive left stick up/down for throttle, right stick left/right for steering for high speed operation. So now it drives like a normal RC car.
Video of the same 3d print model I used as a basis in action, you can see the speed best from 00:50 onwards: https://www.youtube.com/watch?v=3Mv_tDY89Zw
trzy
How was the chassis and steering mechanism built? Any plans to release that design?
ElectRabbit
Cool project! Love it! :-)
We mounted a furby head in one of our robots at work and let it yell swear words at our management.
They (and we) love it.
That project was the source of many code snippets/patterns that have implemented in official products that earned a lot of money.
rkwz
This is amazing! Is there a way to make the car recharge at dock like robo vacuums?
unsigner
Thanks for sharing this – this will be an inspiration.
Everybody knows about FPV quadrocopters used on the battlefield, but there is an increasing focus on terrestrial vehicles. They look nothing like the Boston Dynamics robodogs crossed with Terminators from the mvoies, but are extremely useful in lower-profile "boring" jobs, like laying landmines, exploding landmines, and carrying small amount of supplies to soldiers sheltering somewhere on the frontline.
zapkyeskrill
It's live version of Micro Machines! Nice work
fitsumbelay
this. is. awesome.
lnsru
Thanks for sharing. I always wanted to use ESP32 to revive old Geotrax trains. Maybe that’s the right project to start with.