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
The desktop computer you've been waiting for: Raspberry Pi 500+
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

Raspberry Pi 500+ in Raspberry Pi Official Magazine issue 158
We’re quite taken with Raspberry Pi 500+. But when you don’t need all that processing power, and just want a board that will make a plastic skeleton jump around in a terrifying manner, you’ll find Raspberry Pi Pico more than up to the job. There’s more terror in the magazine (which is only right as […]
Read more →

Win one of five Raspberry Pi SSD 1TB
Raspberry Pi prides itself on high quality hardware, and this 1TB Raspberry Pi SSD is no different. You can use it with a standard Raspberry Pi or even in your desktop PC – the choice is yours. We have five to give away and you can enter below Win 1 of 5 Raspberry Pi SSD […]
Read more →

Dual-screen cyberdeck
Twin screens mean you can code on one screen while watching David Bowie’s 1978 Musikladen show on the other.
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.