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
8. Wire
9. 12 Power Supply
10. Bread Board
11. Screw Driver
12. Caster Wheel
13. Dual Side Tape
14. Jumper Wire
Procedure:-
- 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:-
Recent Comments
Nitin
2017-07-14Nice video sir
Sai Tat Sat Mishra
2017-07-14You are most welcome man..Thanks For Your Comment
Giovanni Conti
2017-12-29Very good video, havent seen a better one.Gongratulations
Toristeffy
2017-08-06Detailed description, photo, video. Very good site! Keep it up!
Sai Tat Sat Mishra
2017-09-01Thank you very much, sir for your appreciation.
Angel Trujillo
2017-08-18Hola amigos, he montado el robot. Con un controlador de motores L298N, y no funciona, me pueden decir como conectarlo??y el código sería el mismo?? Muchas gracias.
Sai Tat Sat Mishra
2017-09-01Please, Sir, Can you ask the question in English So that I can answer your Question.
adhish
2019-09-22how to decrease the speed of the two motors
adhish
2019-09-22how to decrease the speed of the two motors
Shibly
2017-08-23Can you please tell me something about the battery you used in the video ?
Sai Tat Sat Mishra
2017-09-01Here i am using 12V Battery
Heryanto
2017-08-31A very nice project presentation ..
Sai Tat Sat Mishra
2017-09-01Thank you very much sir..
Amit
2017-09-12Where is code
Sai Tat Sat Mishra
2017-10-28Amit Arduino Code file is in the Procedure section. Please Click on the Download Link and Extract the File there you will get the Arduino Code.
Raj
2017-11-02Code problem
David
2017-11-02OOO hello, i have done this project using the same code and the code work fine for me and its working properly. So there must be some problem in your side please check that out...
Sai Tat Sat Mishra
2017-11-02Hi Raj, Can you tell me where you are getting the problem in the code??
Sai Tat Sat Mishra
2017-11-02Raj, after your comment we have recheck the code with the robot and its working perfectly, please connect the proper pin of your Arduino to the LM298, I think you are not connecting them properly thats why you are getting the direction problem
prime
2018-09-27where do i copy the code?
Mithun
2019-04-28Where u found the code?
George
2017-12-07Very nice and educative. How can i do the same with microbit and kitronik motor board?
Sai Tat Sat Mishra
2017-12-07Thanks sir for your comment, but sir i have no idea about microbit and kitronik motor board ,i am sry for that
Mauricio
2017-12-31Excellente, my only question is where you got the metal bracket to this robot Thanks
Sai Tat Sat Mishra
2017-12-31Sir you can it from online. Thanks for your comment Sir
joe
2018-01-05very nice video thanks
Sai Tat Sat Mishra
2018-11-19Thanks for your support.
joe
2018-01-05very nice video thanks
Aaditya
2018-01-09Sir,My servo is working fine but the bot is always moving backward.Can u help me out?
Aditya
2018-01-20Bahi codes error araha ha kasa karu usko uplode batao
Sai Tat Sat Mishra
2018-01-21Sir code is perfectly fine. There may be error in yor side
Gaurav
2018-01-30Sir battery kitne ampere ki lgani h
Sai Tat Sat Mishra
2018-02-01It depens on you. How you are using the robot. Its better to use a battery more than 1.5 amp
harish
2018-02-01can u send the arduino code to my mail. bonalaharish26@gmail.com
Sai Tat Sat Mishra
2018-02-01Sir code is in the procedure section. You can download it from there. Thanks for your comment and support.
Harish
2018-02-02I want to purchase this project kit. Can u send me details of kit,price,report,etc..to my mail bonalaharish26@gmail.com
Swamp
2018-02-10May I use lm293 instead of lm 298 ...??? What will be the code for it...
Sai Tat Sat Mishra
2018-02-11Ya sure. And the code will be same for lm293. Thanks for your comment.
Neel Soni
2018-05-15The Code Will be same for all Drivers
Gaurav
2018-02-16Sir robot maximum time collision kr rha h Syd obstacle ko detect nhi kr pa rha h tho es problem ko kse short out Kru
Gaurav
2018-02-16Sir robot maximum time collision kr rha h Syd obstacle ko detect nhi kr pa rha h tho es problem ko kse short out Kru
hello sir i phase problem in motor my motor is not work urgent 8109782802
Sai Tat Sat Mishra
2018-02-19Sir we are always happy to help you. When you are free call me at 8339829343
vishal
2018-02-21Sir, can i use 9v battery to input lm298 instead 12v.
vishal
2018-02-21Sir, can i use 9v battery to input lm298 instead 12v.
Sai Tat Sat Mishra
2018-02-21Ya you can use 9v battery. But that will not enough for proper functioning of the robot
but sir it is my final year project and how to represent this project without 12v big battery
sir can i use l293d motor driver
Tharun Kumar
2018-02-22sir plss provide us program
Gagan
2018-02-24Sir eski accuracy kitni h
Sai Tat Sat Mishra
2018-02-2420cm. Thanks for your comment.
Rohan goel
2018-02-28sir library ki zip file share kr do .. rohan.goel44@gmail.com
mELJU
2018-03-01CAN I USE LM293D INSTEED OF LM298 ?
Harish
2018-03-09I want to purchase the project please mail me details of project
Harish
2018-03-09Mail me at-- bonalaharish26@gmail.com
Julie
2018-03-14What tipe of battery do you use?
Priyanka jadola
2018-03-15Video is awesome. Easy to understand. Can you tell me, for servo motor and all other components coding is to be done in the same software or there is some other legal procedure????
Ranjip
2018-03-15My one motor is running but another is not running why
Ranjip
2018-03-15My one motor is running but another is not running why
ranjip
2018-03-17my motors are running but servo and ultrasonic sensor is not working... why??????
deepak
2018-04-02my robot wheels are not working pls help me qucklly......... motor OK..... connection right as a ckt diagram......
Sai Tat Sat Mishra
2018-04-03Sir check the data you are giving to the motor driver are correct or not...
rajesh
2018-04-04i think their is a small problem in code in the functions of left and right, bcz same outputs are provided for forward and backward respectively once check the code (ie: to move right only left motor should move in forward direction and right should be stop )
Dhanush
2018-04-12Bro , can you please send me report for this project if you have mail to this id dhanushkelam@gmail.com urgent.....
My coding is not working please help
Sai Tat Sat Mishra
2018-11-19Contact me in my number...
shubham shaw
2018-10-16can I use two 9 v battery instead of 12v
Sai Tat Sat Mishra
2018-11-19Ya sure but it will bot work properly...
lalamusa
2018-12-20good for you
Mohammed hisham
2019-02-16Showing error in code can i contact with you
Dinesh
2019-02-26sir code is not compiling what is the procedure
Aswanth
2019-06-11Can i use lm293d instead of lm298n motor driver???
adhish
2019-09-22how can i decrease the speed of the motor
Sai Tat Sat Mishra
2019-09-22Change digital write to analog write and give value between 0-1024 to adjust the speed
Ravi pandey
2019-09-30Sir I did not find the code please send me the code
Ye Htet Aung
2019-10-23Nice Project. But I face with speed problem. How to decrease the speed of two motors? How can I improve the code?
Narendran
2020-03-04I am studying in 8 std it nice thank you sir
Sir how can I connect using L293d
james willim
26-07-2022 11:01:48 amIt is always difficult to know that on which level preparation of exams is done. Examstrust offers practice exam software. So you can attempt all the questions. It gives hundred percent accurate results. It offers you different types of questions at the same time. It gives accurate results so you can know about your performance. This result will be helpful to know on which portion there is need of more hardwork and attention. Examstrust practice exam is best for all levels of professionals and newcomers so they can be successful at first attempt in actual exams. https://www.eco-clesign.com/forum/hong-kong-news-your-phone/c-bru2c-2020-by-sap-actual-free-exam-questions-answer