In This tutorial, we will learn how to make an obstacle avoiding robot using ultrasonic sensor HC-SR04, Servo and Arduino Uno.So let's start.
Parts Required:-


Buy Now



2.Arduino Uno

Buy Now



Buy Now


4. 2 * 100 Rpm Dc Gear Motor

Buy Now


5. LM298

Buy Now


6. Robot Chassis

7. Tools

8. Wire

9. 12 Power Supply

10. Bread Board

11. Screw Driver

12. Caster Wheel

13. Dual Side Tape

14. Jumper Wire



  1. Connect the Two motor to the motor input of the LM298.As connected in the Diagram below.
  2. Connect the servo's VCC and GND to the GND and 5v VCC of the Arduino Uno.
  3. Now connect the HC-SR04's VCC, GND to the VCC, GND of the Arduino Uno.
  4. Connect the Echo, Trigger pin Of the HC-SR04 to the 11,12 pin of the Arduino Uno.
  5. Now connect the Data pin of Lm298 to the Pin 7,6,5,4 Of Arduino Uno.
  6. Now Connect the Signal of the Servo to the pin 13 of the Arduino Uno.
  7. Now connect the 12v battery to the 12V VCC input of the Lm298 and common GND, and from the Lm298 5v Vcc connect to the 5v Vcc in of the Arduino Uno, GND of the Arduino Uno to the GND of the Lm298.
  8. Upload the Arduino Code: Download
For making Watch this Video:-