Skip to content

Neural network/Haar cascade trained self-driving RC car using Raspberry Pi

Notifications You must be signed in to change notification settings

joeyorlando/self_driving_car

Repository files navigation

Self Driving RC Car

This repository houses all of the software/instructions, as well as schematics, that will allow you to turn an ordinary RC car into a "smart" self-driving car 🤓. The car is capable of autonomously detecting the bounds of the road

All of the software in this project (except for a smidgeon of HTML/CSS/JS) is Python 3.6.0.

Running the web server

Note: because this uses the picamera module, this will likely only run on the rasperry pi.

make run-web-server

##Things you'll need Below is the list of parts that I used to make this project happen.

Hardware/Electrical

  • Raspberry Pi
  • Raspberry Pi camera (case is recommended)
  • Lots of jumper cables (male to male & male to female)
  • Half breadboard L293D H-Bridge Motor Driver
  • HC-SR04 Ultrasonic Range Finder
  • Resistors: 330Ω and 470Ω
  • RC Car - I used one like this

Note on the Raspberry Pi: I used the Model 2B but the 3 has since come out, either or should work for this project. I would recommend the 3 as you don't need to worry about purchasing an extra WiFi dongle. A kit like this is probably best as it comes with a case, preinstalled SD, etc. For this walkthrough I'll make the assumption that you already have a functioning, WiFi connected Pi.

Note on the RC Car: If you're crafty you really don't need to purchase an RC car. Essentially you'll be "tearing the guts" out of the car down to just the DC motor that controls forwards/reverse, servo that controls left/right, and the chassis. You could build a car with a kit like this for cheaper but I decided not to focus on that (at least for now).

Tools

  • Electrical tape
  • A small screwdriver set like this comes in handy
  • Soldering Iron Kit (optional)
  • Wire-stripper (or if you don't have this a box-cutter/knife will do the trick)

Note on soldering: soldering isn't really necessary for this project, although it's a temporary solution. If you're a noob at soldering like me, you can just strip your wires back, inter-twine the cooper and throw some electrical tape on it.

Wiring things up

Schematic Note: Fritzing schematic can be found here.

Testing out our connections

...test scripts to make sure everything works fine

To-do list

  • Get materials
  • Control rear DC motor from Pi
  • Control front DC motor from Pi
  • Control HC-SR04 from Pi
  • Create schematic
  • Stream video to Mac from Pi camera
  • Connect to web server running on Pi
  • Drive car from Mac
  • Collect data ...

References