Self-driving RC Car using Tensorflow and OpenCV

By Russell Barnes. Posted

Build a Raspberry Pi self-driving RC car using TensorFlow, and OpenCV

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

Self Driving RC Car

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.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.