Introduction:-

       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:-

  1. HC-SR04
  2. Arduino Uno
  3. Servo
  4. 2 * 100 Rpm Dc Gear Motor
  5. LM298
  6. Robot Chassis
  7. Tools, Etc.
Procedure:-
  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:-