Introduction: How to Build: Arduino Self-Driving Car
The Arduino Self-Driven Car is a project comprised by a car chassis, two motorized wheels, one 360° wheel (non-motorized) and a few sensors. It is powered by a 9-volt battery using an Arduino Nano connected to a mini breadboard to control the motors and sensors. When it is turned on, it starts driving straight forward. When it finds an obstacle ahead, it looks for both sides, and turn to the side where it has more free space. If there is no free space ahead or on both sides, it reverses the motors to drive backward.
PS: don't mind the dog :)
Step 1: Components
- 1x Car Chassis Kit: YIKESHU 2WD Smart Motor Robot Car Chassis
- 2x Gear Motor
- 1x Car Chassis
- 2x Car Tire
- 1x 360° Wheel
- 1x Arduino Nano
- 1x Mini Breadboard
- 1x Motor Drive L293D
- 3x Ultrasonic Sensor HC SR04
- 3x Sensor support - 3D printed (see drawing below)
- 1x 9v Battery
- 1x On-off switch
- 5x 100uF capacitors
- 2x 0.1uF capacitors
- 1x IR Receiver
- 1x Remote Control
Step 2: 3D Printed Sensor Support
The supports for the Ultrasonic Sensors can be printed on a 3D printer. The drawings are as below:
Side supports: print two of this
Front support: print one of this
PS: the holes have to be adapted according to your chassis. The chassis might have some small differences regarding its holes.
Step 3: Assembling the Chassis
- Assemble the chassis according to the manual.
- The breadboard can be fixated at the back of the chassis.
- It is important that the battery is placed on the front part of the chassis due to its weight.
- Screw or glue the sensor supports on the front of the chassis
- The sensor can be placed with pressure on its supports. It's not necessary to glue or screw it.
Please refer to the picture to understand the components position better.
Step 4: Wiring
Wire the components as the diagram. Refer to the picture to understand capacitors placement.
Attachments
Step 5: Code
Here you will find the code I used for my project. You can always make small adjustments if you want to change its behavior.
Attachments
Step 6: Ready!!! Start the Engines
Now that the car is ready you can start playing with it.
When the car is placed on the ground, turn on the switch to power it. After that, use the PLAY button on the remote control to start the motors. When you need to turn it off, press the PREV button on the remote controller and turn off the switch on the car. While it is on, it keeps driving and avoiding obstacles, however, it is important to prevent it from going to places where there are stairs or holes.
Step 7: More Pictures of the Final Result
1 Person Made This Project!
- ozgura2 made it!
12 Discussions
12 months ago
Very nice! Do you have any control over where it's going, or is it just random?
Reply 11 months ago
It's random. It turns right or left depending on which side has more free space
Reply 2 months ago
that would be cool if you could bump it left and right with the remote
Reply 11 months ago
Ok thank you!
2 months ago
nice, thanks for the print files. im working with a friend on a self driving car, and we are using parts of your code.
11 months ago
If anyone, has actually made it successfully, please provide a neat breadboard wired picture using 'Fritzing' or 'TinkerCAD'.
Also i am unable to understand where to place Capacitors, please also elaborate that.
Reply 11 months ago
The schematic has all the information you need to wire the circuit. For the capacitors, they all go across the 5V and ground rails, just make sure to place them physically close to the components mentioned in the schematic.
Any other specific doubt?
1 year ago
Thank you for sharing! I was wondering if you happen to have a breadboard diagram to go along with your wiring diagram.
Question 1 year ago on Step 1
What is the purpose of ir receiver?
Reply 1 year ago
Oh, the IR receiver is there just to be able to start and stop the car with a remote controller so I dont have to be chasing it all the time
Reply 1 year ago
Thank you sir
3 years ago
That's a fun car design, it looks like it's pretty adaptable :)