Self-driving RC Car using Tensorflow and OpenCV
By Russell Barnes. Posted
Build a Raspberry Pi self-driving RC car using TensorFlow, and OpenCV
Advertisement
Get started with Raspberry Pi – everything you need to know to start your journey!
Self-driving cars are the hottest piece of tech in town. And you can build your self-driving RC car using a Raspberry Pi, a remote-control toy and code.
Hungry Man, who describes himself as "An engineer" demonstrates this RC car.
It uses the following equipment:
- Raspberry Pi
- Pi Camera Module
- PWM Motor Control
- TensorFlow
- OpenCV
The two key pieces of software at work here are OpenCV (an open-source computer vision package) and TensorFlow (an open-source software library for Machine Intelligence).
OpenCV can be trained to detect objects in images (or video). Such as a cat, or dog, or in this case pieces of paper making up a track.
TensorFlow is used to make smart decisions based upon the Neural Network. In this instance, it's being used to steer the car.
The project is a "self-driving car running a convolutional neural network, or CNN, on a Raspberry Pi with a Pi Camera," explains "Hungry Man" on YouTube (the engineer behind the project).
Self-driving car technology is all the rage, with Google engineers repeatedly demonstrating the technology in public. Nissan, Toyota and Tesla are all reported to be building self-driving cars.
Automated cars are appearing on roads across Europe and The United States, as engineers test out the technology.
For most people, self-driving cars are technology from the future, that is "indistinguishable from magic," according to Arthur C. Clarke's third law.
Self-driving RC car built using a Raspberry Pi

Behind the self-driving magic is down-to-earth code accessing sensor data. In the self-driving RC car, the sensor is a Pi Camera that looks at a road made from paper.
It can also detect Stop signs and automatically come to a halt.
In case you're wondering, the stick protruding from the front is a light (it can drive in the dark).
Commercial automated cars use a combination of sensors. The upcoming Tesla Model 3 will have eight cameras, one radar and ultrasonic sensors.
At the heart of the RC car is just a Raspberry Pi. The car is independent and does not connect to another computer.
We think this project is super smart. Hungry Man says that the code will be placed on GitHub soon. We look forward to testing it out.
Russell runs Raspberry Pi Press, which includes The MagPi, Hello World, HackSpace magazine, and book projects. He’s a massive sci-fi bore.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Get started with Raspberry Pi in Raspberry Pi Official Magazine 161
There’s loads going on in this issue: first of all, how about using a capacitive touch board and Raspberry Pi 5 to turn a quilt into an input device? Nicola King shows you how. If you’re more into sawing and drilling than needlework, Jo Hinchliffe has built an underwater rover out of plastic piping and […]
Read more →
Win one of three DreamHAT+ radars!
That’s right, an actual working radar for your Raspberry Pi. We reviewed it a few months ago and have since been amazed at some of the projects that have used it, like last month’s motion sensor from the movie Aliens. Sound good? Well we have a few to give away, and you can enter below. […]
Read more →
RP2350 Pico W5 review
It’s Raspberry Pi Pico 2, but with a lot more memory
Read more →