Introduction: Autonomous Car

I completed this project as a requirement for my robotics course and I had a good time working through it. I learned about how to integrate an Arduino Uno and ultrasonic sensor to an old RC car. I really enjoyed working on this project and hope you do too!

There are a couple of things I need to work out (e.g. the car sometimes doesn't properly read in the sensor value and causes the car to move back and forth without real cause) - you'll see what I mean when you watch the attached video. But if you're looking for a starting point, please feel free to use this set of steps. I think it'll be beneficial :)

Step 1: Gather the Materials

To make your own autonomous car you will need the following materials:

Step 2: Wire the Arduino and Motorshield With Ultrasonic Sensor

1. Stack the Motorshield on top of the Arduino Uno

2. The circuit:

· VCC connection of the sensor attached to +5V

· GND connection of the sensor attached to ground

· TRIG connection of the sensor attached to digital pin 2

· ECHO connection of the sensor attached to digital pin 4

Step 3: Wire the RC Car Motors to the Motorshield

  1. Take the two wires connected on the front motor and connect them to either M1 or M2
    • Unscrew the top of the selected motor input
    • Insert the wires in each of the two slots and screw back down to ensure they stay
  2. Take the two wires connected on the back motor and connect them to either M3 or M4
    • Unscrewthe top of the selected motor input
    • Insert the wires in each of the two slots and screw back down to ensure they stay

Step 4: Add Code to the Arduino

You will need to include two libraries to the top of the page:

  1. Wire
  2. Adafruit Motorshield

To install, go to Sketch > Include Library > Manage Libraries

  • Type in "Wire" into the Filter your search...
  • Click on the first one and select Install
  • Type in "Adafruit Motor Shield" into the Filter your search...
  • Click on the first one if you're using version 1 or the second one if you're using version 2

Go back into Sketch > Include Library and scroll down to find:

  • Wire - click it to include it into the code
  • Adafruit Motor Shield... - click it to include into the code

Viola! You've successfully installed the libraries and included the in your autonomous car code!

*The file attached is all the code required to run the car*

Step 5: Video of Autonomous Car in Action

Step 6: Related Links