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.
- Arduino Uno
- 2 * 100 Rpm Dc Gear Motor
- Robot Chassis
- Tools, Etc.
- Connect the Two motor to the motor input of the LM298.As connected in the Diagram below.
- Connect the servo's VCC and GND to the GND and 5v VCC of the Arduino Uno.
- Now connect the HC-SR04's VCC, GND to the VCC, GND of the Arduino Uno.
- Connect the Echo, Trigger pin Of the HC-SR04 to the 11,12 pin of the Arduino Uno.
- Now connect the Data pin of Lm298 to the Pin 7,6,5,4 Of Arduino Uno.
- Now Connect the Signal of the Servo to the pin 13 of the Arduino Uno.
- 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.
- Upload the Arduino Code: Download
For making Watch this Video:-