<- Back to 2XOD.com

Raspberry Pi Wifi USB Webcam RC Car

Stream live video from an RC Car using a raspberry pi 3 b+ on wifi using a USB webcam!

This is an ongoing project and this being revision 1 - it does not support controlling the car at all. The original remote is still used to drive the car. Replacing the controls is phase 2!

I am using a Logitech C920 USB webcam to stream live video to a web browser.

A Lutema Baja HYP-R RC Car (for about $65 from amazon) was used as the base chassis

The only real challenge here is powering the raspberry pi from the RC Car battery. This car uses a 7.4 volt 1800mah battery. To bring that voltage down to 5 volts for the pi we use a LM2596 based step-down voltage regulator.

Using a multi meter, adjust the output to 5 volts by turning the screw on the blue variable resistor. Once the voltage is set secure the screw. I used hot glue.

I was able to use the 3 pin JST XH connector on the battery (normally used for charging) to easily connect to the voltage converter. Then I send 5v into the raspberry pi GPIO header.

A few zip ties later and you have the car shown up above. Yes that is also a twist tie holding the voltage converter onto the frame....

MJPG Streamer Software

To view the webcam in realtime in a web browser I used mjpegstreamer from https://github.com/jacksonliam/mjpg-streamer.

from your home dir run:

git clone https://github.com/jacksonliam/mjpg-streamer

cd into mjpg-streamer/mjpg-streamer-experimental

Run make then sudo make install

launch it with these command to start streaming video:

export LD_LIBRARY_PATH=.

mjpg_streamer -i 'input_uvc.so -d /dev/video0 -r 1280x720 -f 15 -n' -o 'output_http.so -w www -p 8080'

For bonus points you can add this to your /etc/rc.local file and mjpg streamer can be ran automatically after the system boots. For this to work you must use full paths for the www parameter and LD_LIBRARY_PATH.

HUZZAH!

This yields a realtime video stream that works on any web browser, desktop or mobile, with about 200ms of delay.

This is extremely driveable however the RC car is extremely fast in its defaul configuration (up to 30 mph) so it's not very practical to drive indoors. Once I replace the controls I will be able to dial down the max throttle or make it configurable to make this much easier to drive everywhere.

Watch it go!

Page Revision History

2018-06-08 Published