How to Make a HC-SR04 Obstacle Avoiding Robot With Arduino

by buildation1 in Circuits > Robots

2753 Views, 3 Favorites, 0 Comments

How to Make a HC-SR04 Obstacle Avoiding Robot With Arduino

sku_422397_1.jpg

In this Instructable today, you will be shown how to make a Obstacle Avoiding Robot with a few cheap parts and a free open-source software coding platform IDE called Arduino. This is a great robotics project and is very easy to make. After you are finished, you can let it free and see what it can do!

Parts Needed

arduino-uno-mega2560-front.jpg

Listed below are all the parts needed to build this. I have provided links if you need to buy them from Amazon

Connections

F78CS9LJ52QASX3.LARGE.jpg

Now it's time to connect these parts you have collected and make this robot. Refer to my schematic for all the connections.

--For the motors, the orientation in which you place them will make a difference so plug them in and if after finishing, it doesn't go forward, try switching them.--

The ultrasonic sensor needs to spin with the servo motor so you either need to buy a ultrasonic bracket or use 2 pieces of cardboard to make one.

The 9V battery going to the L298N H-Bridge needs to be a 4 AA Battery Holder unless you can get the 9V battery to have 2 separate wires.

Code

Now you need this machine you built to do something. We will achieve that using Arduino. If you already haven't done so, download Arduino IDE from this website - https://www.arduino.cc/en/Main/Software

After you do that, watch this video if you don't know how to upload a library to Arduino.

The video will also show you how to download the NewPing Library, to which the link is here. This is needed for the code to work. https://goo.gl/Qe6XU6

The code is here.