Arduino Self-Driving Car

This is basically a Self-Driving Car powered by Arduino R-3 Development Board and a L293D Motor Shield.It uses the data given by the HC-SR04 Ultrasonic Sensor which is connected to analog pins of the arduino board. As an additional feature, I have added a Micro 90g servo which the ultrasonic sensor is fixed to. Basically what the servo does is, it makes the ultrasonic sensor to look around and search for different paths. So this was it, now lets get started with the project.

Arduino Self-Driving Car

Step 1: The Materials Needed : (Really??)

Step1 Arduino Self-Driving Car


1- Arduino UNO R-3 Board Link:…

2- L293D Motor Shield Link:…

3- BO Motors and Wheels (x4) Link:…

4- HC-SR04 Ultrasonic Sensor Link:…

5- Ultrasonic Sensor Bracket Link:…

6- 90g Micro Servo Link:…

7- 9 Volt Battery (x1) Link:…

8- 9 Volt Battery Clip Link:…

9- Male to Female Jumper Wires (x4) Link:…

10- Plastic Box Link: (Come on, u can find that in ur home)

11- Wires Link: (You might find some in ur nearest hardware shop)


1- Soldering Iron Link:…(A good iron for beginners)

2- Soldering Wire Link:…(Flux inside the wire)

3- Hot Glue Gun Link:…(I personally like it)

4- Hot Glue Sticks Link:…

5- Screwdriver Link:…

6- Screws Link: (Included with the servo)

7- Pliers Link:…(A good one)

Step 2: About the Motors (ooohh)

Step 2 Arduino Self-Driving Car

Solder the wires on each of the motor terminals and check them using the battery. Solder the negative or black wires on the left terminalsof the motor while the positive or red wires on the right terminals. Now glue the motors to the box.

Step 3: About the Motor Shield (: I )

Step 3 Arduino Self-Driving Car

Now plug the L293D Motor Shield on the Arduino UNO. Put the shield in this way that the reset button on the shield is facing towards the usb port and the power input of the arduino. Now connect the top-left motor to the M1 on the shield, down-left to the M2, top-right to the M3, down-right to the M4. Connect the positive and negative wires in the way as shown in the picture.

Step 4: Servo!! (: ) )

Step 3 Arduino Self-Driving Car

Connect the servo on the L293D Motor Shield as shown in the image. Now glue it to the box as shown.

Step 5: The Ultrasonic Sensor (???)

Step 5 Arduino Self-Driving Car

Now attach the ultrasonic sensor to the bracket and attach the wires corresponding to (VCC- Brown), (Trig-Yellow), (Echo- Green), (Gnd- Black). Now attach the the sensor to the motor shield as(VCC- 5v), (Gnd- Gnd), (Trig- Analog 0), (Echo- Analog 1).

Step 6: Batteries (Yes!!!, Some Juice!!!)

Step 6 Arduino Self-Driving Car

Note: First things first, you can use an external power supply if the battery is not working for you.

Now connect the positive battery clip wire to the M+ of the motor sheild and negative wire to the gnd.

Step 7: Libraries (Uhh, No Juice : ( )

Step 7 Arduino Self-Driving Car

Now first download the libraries.

1- Adafruit-Motor-Shield-library Link:…

2- Arduino New Ping Link:…

Now extract these libraries into: This PC> Documents> Arduino> libraries.

Don’t forget to Rename these libraries to AFMotor and NewPing respectively.

If you dont have the Arduino IDE Link:

Step 8: Coding (Get Serious : I )

The Code is in the text file given.

Step 9: Batteries (Finally SOME JUICE!!!)

Step 9 Arduino Self-Driving Car

Now Plug-In The Battery.

Source: Arduino Self-Driving Car

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top