Intelligent Obstacle Avoiding Robot || Step by Step Tutorial || Arduino Project
Vložit
- čas přidán 26. 08. 2024
- Hello friends,
In today's video I am going to show you how to make an intelligent obstacle avoiding robot. This is an Arduino project in which the obstacle avoiding robot detects the presence of obstacles using HC-SR04 ultrasonic sensor. The motors are driven by L298N driver board. The ultrasonic sensor is connected to an SG 90 servomotor to give the effect of an eye looking at both sides after detecting an obstacle, changing direction and then moving forward.
After detecting the obstacle, the robot stops , moves backward and changes direction and then goes further forward.
The links for purchasing the items are given below.
1. Arduino UNO board : amzn.to/3RPzXw8
2. L298N motor driver : amzn.to/3RO0F8k
3. HC-SR04 Ultrasonic Sensor : amzn.to/3XFNCd4
4. SG 90 Servo Motor : amzn.to/45M1RPs
5. Motors with wheels : amzn.to/3W5EYTW
6. Battery pack, AA x 4 with on/off switch: amzn.to/4cPwJAZ
7. Jumper wires : amzn.to/3xG4FB0
Link to download code: drive.google.c...
OR
www.mediafire....
Link to circuit Diagram:
drive.google.c...
Please do watch the video .Thank you...
Please share the video if you like it.
You can watch the obstacle avoiding robot with advanced algorithm in the following link. It scans both left & right and choses direction without obstacle.
• How to make Obstacle ...
❤❤❤~~PLEASE SUBSCRIBE TO THE CHANNEL TO SEE MORE SUCH INTERESTING VIDEOS & MAKE LEARING SCIENCE FUN~~❤❤❤
#arduinoproject #scienceproject #arduino
Obstacle avoiding robot with advanced algorithm by scanning both left & right
czcams.com/video/k6W3FYxVS9E/video.html
Obstacle Avoiding Robot with Bluetooth Control
czcams.com/video/HbL9FB4Zogo/video.html
That's fake it dose not scan left and write the servo is a dummy peice I read the program
Proof is that every time the robot senses something it turns only left
Try explaining it bro, the pinned comment is a lie
Hey friend. I think you have misunderstood. There is no fake or lie here in my channel. There are 2 videos.
1. Robot which doesnt scan left and right : czcams.com/video/kPSBpfUpHt0/video.htmlsi=909Kf0mK6tRViWnP .. In this project, the robot doesnt scan left and right. It just detects obstacle and always goes in the left direction only. Servo is obviously a dummy piece.
2. The robot which scans both left and right is in this link : czcams.com/video/k6W3FYxVS9E/video.htmlsi=RMY3UKpk0egZfDg6 .. Here the robot scans both left and right and goest to whichever direction which doesnt have obstacle. This video is what I have given in the pinned comment as robot with advanced algorithm.
@user-vq9md7xh3f Please reply if you have further doubts. I will be happy to clarify.
I have finished uploading the code for the obstacle avoiding robot and finish all the wires, and everything works like it should no problem of any kind, I want to thank you so much , you are such an amazing teacher, my next project is the Bluetooth Control obstacle avoiding robot.
Thank you so much dear friend. Iam so happy that it worked for you..❤️🙂
After watching servel video we are finally able to run our car .
Thank you soo much for your tutorial.
Love from Nepal.🇳🇵
Wow!!! Glad to know that. After seeing your comment, I was actually preparing the circuit diagram for uploading.
I will upload the circuit diagram so that the viewers get better clarity and can easily assemble the circuit.
Very happy to know that my video helped you to run the car. Please ask any questions and I will be happy to help.
If you liked the video, please subscribe for watching my future videos. Also, please share this channel with your friends who will be interested. Thank you. ❤
And love from India too..💞😍
You are a super comment reader you reply all the comments 😅😅
Hehe..Thank you. I am very happy to read and reply to all the comments..🙂
Hi sir ...Thank you very much
After somany videos ..
Finally i prepared from your video..
On floor it is not moving
It works only in air
Hi friend. It is mostly due to poor batteries. Using new batteries should solve the problem.
Hi, I tried doing this but I have a problem. Im using a l293d motor shield and 2 3.7v lithium batteries. The motor shield's green led lights up when i connect the battery, and the ultrasonic sensor and motor servo work just fine (they rotate left and right when something is in front of them), but the thing is the motor (wheels) aren't working. They only create a buzzing noise that stops momentarily when the motor servo and ultrasonic sensor is rotating. I do not think that the problem lies in the motor wheel because they work when i try connecting them directly to a battery. Any idea as to why this happens? Any help would be appreciated!
Hi friend. I think it is most likely a battery related issue. The batteries are not able to run all the motors together. Generally a buzzing sound is heard when the motors don't get enough power for rotation. Are you using 4 motors or just 2?. Try removing all the motors and connect just 1. Is it working now?. Then it is confirmed that a poor battery is the problem. 2 x 18650 batteries are good. But the batteries may be bad or discharged so it is not able to drive the motors. I definitely feel that replacing with a good battery will solve this problem..
Thanks a lot brother😊 It worked properly. Previously I saw another youtuber video of making a obstacle robbot but it was not working then I saw your video and it worked. Thank you so much
6:40
Thank you so much dear friend for trying out this project by seeing my video. Glad that it worked for you..🙂
I am using a single dc 9v battery but it is not functioning well so do you think I should just use the 4 AA battery? then will it work properly? the robot works when plugged into my pc but when unplugged the robot just stands still and the Arduino Uno light and all are working.
Hi friend.. It is definitely due to poor battery. When plugged into PC, the power to arduino board is taken from PC through USB. Hence the batteries are used to run the motors alone and it just rotates. But when PC is disconnected, the battery has to power both arduino and motor, which becomes difficult with bad batteries. Hence the motors dont rotate. If you start rotating the wheel, sometimes it will rotate..
So, the soluyion is to use new batteries. 9V small battery will work but will not last long. 4AA batteries will last longer. Best option is to use 2 x 18650 3.7V battery which are rechargeable also..
Ok thank you so much
I successfully made this robot following your instructions, but one problem I have is the robot gets too close to the obstacles before realizing it has to redirect. I'll increase the distance number, will it still work? Wonderful instructions and I really appreciated the circuit diagram!
Hi dear friend.Thank you so much for the encouraging comment❤️🥰🙂. You can definitely increase the distance number to make the obstacle detection early.
@@Science_4U_ Thank you! I will try that tonight! 💙
Okay friend..🙂
Servo motor is working but car is not moving. How can check if my motor driver is faulty?
The motor driver needs to have 2 jumpers connected on ENA and ENB pins. The jumpers should be present for the working of the motor driver. Are the jumpers available?
Also to check whether the motor driver is working, connect IN1 pin to +5V of arduino and IN2 pin to GND pin of arduino. Power on arduino and motor driver board. If the motor driver is working, the motors should rotate now.
Bro i subscribe and like from 4 phone because your video is very amazing and your sound also 👌 ❤❤🎉😊😊
Thanks a lot dear friend. Words cannot express my thanks to you. Thank you so so much!!!..😀😀😀🥰🥰😍
Hello, I would like to ask you for help. I should make a robot like yours, but add an LCD so that when it avoids an obstacle it appears on the screen. How would I connect it?
It is very well possible. I have done several projects by connecting the SSD 1306 OLED display to arduino. You can watch those projects to see how the connection is done with the OLED display. then you can also open the code and see how code is written for OLED display. You have to combine both the code so that if an obstacle is detected, the required text is to be displayed on screen.
Bro thank you very much i have made it , it is working and the code is also perfect, once again thank you very much and i will ask you to pls start a project on drone.
Hi friend. Thank you for the nice words. I will surely start making drones👍
Can i use a battery box that only lets 2 batteries in. Or i will need more power. or just use the one your using.
Hi friend. You need at least 4 batteries if your are using AA batteries. that gives you 4 x 1.5 V = 6V input voltage. So if you are using AA 1.5V batteries, you need a holder with 4 batteries. Another better option is to use 2 x 18650, 3.7V batteries. If you use 18650 batteries, you have to use a holder with 2 nos. of 18650 batteries and it gives 7.4V output voltage.
I finished everything but it only works when i plug it into the computer. It won't work by the battery, there's a light on both boards but the car won't work until i plug it in.
Hi friend. Most likely it is a battery problem. When you are connecting uno through usb, the arduino board, the servo and sensors are powered feom usb. The battery then powers only the motors and hence even if the battery is discharged ot works fine. Are you using the servo motor too?. Can you remove connections to servo and can you check whether it is working now?.Replacing with a powerful battery should solve the problem.
my servo motor is running as expected but wheels are not running. Why?
Hi friend. Most likely it is a problem with the l298n motor driver board. It may be faulty. Have you used it before or is it a new one?Also can you see 2 jumpers in place in the motordriver board, connecting ENA and ENB pins to the pins above that?. Those jumpers are required for enabling rotation of motors..
can I use 4x 18650 3.7V battery? will that be too much power? can I use the 5v pin in the L298n if it has too much power?
it is too much for the project friend. A total voltage upto 12V is fine. 2 x 18650 or maximum 3 x 18650 is okay. Beyond that, it will damage the board and motors.
@@Science_4U_ Thank you
Pls help me, my wheels aren’t moving
Congrats for 2K subscribers 😍👌
Thank you...🥰💓
@@Science_4U_ i can't able to see Arduino code whose link you given in description so can you please send the code here
Bro i like your video i maked it but it working thankyou so much bro you need to make so many things like yhis thankyou very much ❤❤❤😊😊
Thank you so much dear friend..🙂❤️
Thanks again and again ❤🎉🎉😊😊😊
I am subscribe your video and like
Iam doing comment in onether phone that phone is my mother's phone
@rahseedap8268 Thank you so much friend for liking and subscribing to my channel. If you like my channel, please share with your friends so that those who are interested can watch these videos. Thank you so much friend..❤️🙂
mine's not working, what should I do?
What is the problem that you are facing friend?. Is it not moving at all?
I’m using a regular arduino board and there’s only 2 five volts and their taken so we’re does the motor connections go? I don’t get those
Where does the middle red wire of the servo motor go to?
Sir i cant get the code
I can't get it from description
@@lankaranaraja8203 okay friend. then I will paste the code below.
#include
Servo Myservo;
#define trigPin 9 // Trig Pin Of HC-SR04
#define echoPin 8 // Echo Pin Of HC-SR04
#define MLa 4 //left motor 1st pin
#define MLb 5 //left motor 2nd pin
#define MRa 6 //right motor 1st pin
#define MRb 7 //right motor 2nd pin
long duration, distance;
void setup() {
Serial.begin(9600);
pinMode(MLa, OUTPUT); // Set Motor Pins As O/P
pinMode(MLb, OUTPUT);
pinMode(MRa, OUTPUT);
pinMode(MRb, OUTPUT);
pinMode(trigPin, OUTPUT); // Set Trig Pin As O/P To Transmit Waves
pinMode(echoPin, INPUT); //Set Echo Pin As I/P To Receive Reflected Waves
Myservo.attach(10);
}
void loop()
{
Serial.begin(9600);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH); // Transmit Waves For 10us
delayMicroseconds(10);
duration = pulseIn(echoPin, HIGH); // Receive Reflected Waves
distance = duration / 58.2; // Get Distance
Serial.println(distance);
delay(10);
if (distance > 15) // Condition For Absence Of Obstacle
{
Myservo.write(90);
digitalWrite(MRb, HIGH); // Move Forward
digitalWrite(MRa, LOW);
digitalWrite(MLb, HIGH);
digitalWrite(MLa, LOW);
}
else if ((distance < 10)&&(distance > 0)) // Condition For Presence Of Obstacle
{
digitalWrite(MRb, LOW); //Stop
digitalWrite(MRa, LOW);
digitalWrite(MLb, LOW);
digitalWrite(MLa, LOW);
delay(100);
Myservo.write(0);
delay(500);
Myservo.write(180);
delay(500);
Myservo.write(90);
delay(500);
digitalWrite(MRb, LOW); // Move Backward
digitalWrite(MRa, HIGH);
digitalWrite(MLb, LOW);
digitalWrite(MLa, HIGH);
delay(500);
digitalWrite(MRb, LOW); //Stop
digitalWrite(MRa, LOW);
digitalWrite(MLb, LOW);
digitalWrite(MLa, LOW);
delay(100);
digitalWrite(MRb, HIGH); // Move Left
digitalWrite(MRa, LOW);
digitalWrite(MLa, LOW);
digitalWrite(MLb, LOW);
delay(500);
}
}
Thanks
Bro reduce the music song in the background
Okay friend. I will take care for reducing music in the future videos. Thanks for the suggestion..🙂
which pins are responsible for motors to run?
Hi friend. In this code, the commands for running the motors go from pin numbers 4,5,6&7 of arduino to the motor driver board. So pin numbers 4,5,6&7 are responsible for the motors to run..
My wheels are not working?
Hi friend. There could be many reasons why it is not starting. You have to check one by one to find out. The most common problem could be L298N motor driver board. Have you used it before or is it a new one? . It could be faulty.
Also, in the motor drive board, there should be 2 jumpers in place connecting ENA and ENB and the pins above them. that is for enabling rotating of the motor. If the jumpers are not there also, the car wont start.
Also, check whether the batteries have charge in them.
Everthing is working fine but the servo is not rotating at all and the ultrasonic is not detecting obstacles what should i do ? Great video it was so helpful ❤️
Hi friend. Thank you so much for the nice comment..💓
Most likely the ultrasonic sensor is not working. The servo motor is given just to give the feeling of looking to both left and right after detecting the obstacle. If the servo motor is not there also it will work. But ultrasonic sensor is very important for proper functioning. Just check the connections to ultrasonic sensor once again. If it is correct and still not working, then most likely this sensor is faulty. Changing it should solve the problem..
@@Science_4U_ I changed it it worked thank you.❤ but another problem occurred all lights are on but nothing is moving what should i do please answer its for my project?
I checked the motors alone and its working whats the problem?
It is moving in a circle in port 1 and 2 only
Hi friend. Can you explain the problem clearly?. Do you mean that both motors are rotating but in opposite directions?
I have an question what if we want two wheels more at the front what should we write in the code??
Hi friend..you need not do anything in the code. Just attach 2 more motors in the front. The wires coming from the front motors can also be connected to the motor driver board alongwith the wires coming from the back motors..I have done a similar project with 4 motors. You can watch that video below for better understanding..
czcams.com/video/JK6zTM65Rh0/video.html
But only problem I have seen with 4 motors is that it is a bit difficult to turn.
لو سمحت انا عملت كل الخطوات لكن ما اشتغل ، ايش السبب ، كيف ممكن أتواصل معك لحل هذه المشكلة يجب أن أسلم مشروعي بعد يوم من الآن
The code doesn’t work. When I click download and go on the page, there’s nothing there.
@@KoiTheFish888 Hi friend. Have you tried downloading the code from both the links?. Can you give your email id?. I will send the code.
is there a video for only the code i am ok with the wiring but i have a problem with the coding
No friend. I dont have a video for only the code. If you have some doubt, please tell the problem by visiting my following instagram page. I will help.
instagram.com/_science4u_?igsh=MTM5aXFpdTM5aG5lNg==
Thank you so much! We were able to create this as a project and its works well!
Ooh..great dear friend!!!.. So happy to hear that💓🙂
Hlo sir it is really working
I want to ask how was the code uploaded
Hi friend..The code can be uploaded by connecting to PC or laptop. Then open the code in IDE software and click on upload button. It will get uploaded to arduino..
Hey I’ve made this and the robot keeps going around in a circle as then one of the wheels is not going forward but when it reverses both the wheels work fine . can you help me find what’s the issue ?
I guess it could be due to poor batteries only. When it is going backward, since both wheels are working, the connections are correct. In the forward direction both motors are not rotating probably due to poor batteries. You can try changing the batteries.
@@Science_4U_ I facing this same it circles all the time but when turning it is fine, changed the battery still the same issue.
My servo motor is working but the ultra sonic sensor is not working what is the problem
Hi friend. Do you mean that it is not detecting obstacles?
dear science_4u can I connect the 5v pin of servo and ultra sonic with l298n 5v pin?
Hi friend. You can power the ultrasonic sensor from the 5V output of l298n. But definitely it cannot give enough current to the servo motor. So it is better not to connect servo motor to this 5V output.
I have a problem. Im finished doing the wirings and already uploaded code. The led for motor driver turned on and also the led for arduino uno turned on. Use the same 4* 1.5 volts double a battery (eveready). The robot didn't move. The servo didn't rotate.
Okay. Was the "upload successful" message shown after you uploaded the code?. Was the code uploaded without any errors?.
yes the code was succesfully uploaded
no errors
the servo motor we use is second hand, its from a friend, she said it works fine because they tested it
we'll try to reset the arduino uno again, replace the ultrasonic sensor, replace the 4* double a batteries with 3.7 V rechargeable and replace the motor driver what other advices can you give?
Sir my I've connected 4 aa batteries of 1.5v as shown in the video, my sensor and servo is working, but both the motor is not working, when connected only on battery. When I connect the usb and battery simultaneously, then only the right motor goes backward and servo works, but left motor is not working
Okay friend..The problem could be most probably due to bad batteries. Please use new batteries and problem should be solved. Also check whether the connection from batteries are correctly given to the motor driver board.👍
very good very nice
Thank you so much dear friend..🙂❤️
All is working but DC moter are not going rivers
You can reverse the connection of the motor that is going backwards..
@@Science_4U_ now it is not working pls tell another way
We have done everything according to the video and the sensor too is working... But the problem is when we keep the robot on floor, it is sensing only once and not sensing the obstacle again. But when he hold it in air, its working and sensing normally... Pls help me with this
Hi friend,surely I will help. I think that is due to poor batteries. When we keep on the floor, the motor consumes more power from the batteries. So this drops the input voltage and hence it stops working again. Have you used fresh AA 1.5 V x 4 batteries? If possible can you change to 2x 18750 3.7V rechargeable batteries?. Those are the best for these kind of projects.
04:37 onwards the connections for Servo the motor is shown incorrectly in the video. Please follow the circuit diagram. I have encountered some problem initially because of not putting 2 jumpers in motor drive. After these two corrections it started working. I
Okay friend. I was telling about the colours that are generally given for servo motors..
Yellow/orange for signal wire..
Red for +5V
Black/brown for gnd..
In the servo motor that I used, the colour of signal wire was yellow but generally it comes with orange wire..also the servo motor that I used had brown ground wire.But some motors come with black ground wire..so that why I told black colour though the servo motor that I used had brown ground wire..
@@Science_4U_ Not about colors, Just check the connection to IOREF. The audio is telling not IOREF. May be its not audible clearly. I am talking about the Violet /Purple wire (middle one ) from the servo motor. Anyway it is working fine now. Your code is also working fine. Thanks
Ooh..okay friend.. anyway IOREF is a reference 5V that is to be given to input output devices. So IOREF is actually same as +5V..That is why I told +5V only. Also in SMD versions of arduino +5V only is written. There is no IOREF. So as a general term I told +5V. Thanks friend for pointing out..👍
@@Science_4U_ Thanks friend. My son had a knowledge fair in School today. He used your video to make the same Robot. He presented it successfully. Thanks a lot.
@@pmm782003 Thank you so much..Very happy to know that..🙂. Please do convey my regards to your son..💓
Can I use a regular arduino uno board or does it have to have that black bar thing on it?
Regular arduino will work friend.
Which battery cell you used
Hi friend. For this project, I used 4 Nos. Of 1.5V AA batteries. It will be better if you can use 2 Nos. of 3.7V 18650 batteries as they are rechargeable and last really long.
Sir ,my car does not go forward , it just spins and sensor also working ,tell me why pls..
Hi friend..While spinning whether both the motors are rotating but in opposite directions?. Or only one motor is rotating?.
First of all, after detecting an obstacle, it goes back and does not go forward again, it spins in a circle, at that time both the motors spin.
Please help me
@@TheJayasiri yes..can you tell..without the obstacle in front ..just after switching on ..are both the motors rotating in same dirrection or opposite directions..
It is done ,thank you for replying 😊
i can't able to see Arduino code whose link you given in description so can you please send the code here
You can download the code from the following link..
drive.google.com/file/d/11FJMN_PGLD_yJdtuzxBiAzmhhfKUOvxV/view?usp=sharing
Mine motors are working but the servo is not working,what to do?
Hi friend. The servo motor could be faulty. Replacing the servo motor shoukd solve the problem. Before that please check whether the connections to servo motor are given correctly. Are the servo motors jerking atleast or it is not moving at all?
i have a question, do we need to change many things in this code if im using a photoelectric sensor? is it possible?
Yes ftiend. You will be able to use photoelectric proximity sensor but definitely needs modification in the code.
Please, I did all the steps but it didn’t work. What is the reason? How can I contact you to solve this problem? I must submit my project a day from now.
@@shatha.44 Hi friend.There could be several reasons why it is not working.The L298N driver board may be faulty or it could even be the batteries. You can message me in my instagram account. I will help you to solve the problem.
instagram.com/_science4u_?igsh=MTM5aXFpdTM5aG5lNg==
Sir can I take a cable and cut it and connect to motor driver and cable to adaptor will it work
Sorry friend, I did not understand the question. Which is the adaptor that you are talking about?.
Why is the code showing compilation error
Can you tell what is the error that is shown during compilation?
Hi sir . I am making this project now. but i have some problems with L298N driver board. I contacted all the jumpers correctly and i check it for more then 5 times . When I attaching my motors with L298N driver board it doesn't work and also my Servo Motor is not working. All the elements are not default.
plz help me . I have to submit it tomorrow.
Hi friend. There could be some problem with the l298n motor driver board. We have to check and see if the l298n motor driver is working or not. Can you see 2 jumpers in l298n motor driver that is connected to ENA and ENB pins?
I am about placing a order for an Arduino uno, i already have a raspberry pi pico, I wish you can do a video for a raspberry pi pico.
Please say something. On my motor driver, it's showing red led light, someone said it means that my motor driver is receiving low or high current, so it's shutting down himself. Am new to this, can you help me please. If you can give me your handle, I can send you my connection, so that you can put me through. Thank you so much
I'm using a raspberry pi pico
Hi, friend. I am not knowledgable in using raspberry pi pico. If you are using arduino uno for this project, I can help you.
Bro my motors are stop working sometime while car is going ahead and battery is fully charged
It could be some loose connection or problem with the motor driver board. Is it detecting obstacle correctly?. Also if you remove ultrasonic sensor, is it continously going to front without stopping?. Can you check that?
My Motor is not working in this and only servo motor is moving
Hi friend. This could be due to several reasons.
1. Can you see 2 jumpers very close to the IN1 and IN4 pins in motor driver board?. These jumpers are required for enabling the rotation of the motor.
2. The L298N motor driver board may be faulty. The lights will switch on, but still it may not work. Have you used this motor driver board before, or is it a new one?
one question which glue are you using to stick things
Hi friend. It is called hot melt glue stick. I will give the link below.
11MM TRANSPARENT HOT MELT GLUE STICKS FOR DIY AND CRAFT WORK (14 STICKS) amzn.in/d/8xtvnkT
i can't find de Motor Driver Arduino in tinkercad '-'
Sir,I don't have jumper very close to in1 and in4 so what should I do
Okay friend. If you dont have jumper near to IN1 and IN4 pins, you can use a jumper wire to function as a jumper pin. Can you share a photo of your motor driver board in the following instagram id. I will help.
instagram.com/_science4u_?igsh=MTM5aXFpdTM5aG5lNg==
@@Science_4U_ Thank you sir
I have done everything wireing and code too but it doesn't work the audrino and motor driver lights are also on but no movement
Hmm..okay friend. There could be many reasons.
1. The motor driver board could be faulty. Have you used it before or is it a new one?
2. Are the batteries new?. If the batteries are discharged, then also it will not work.
3. Check the connections once again.
Can I keep a picture to your number that you can see and everything are new I had also tested them
Bro does it enough the four AA BATTERIES??
Those are enough. But will not last long. 2nos. Of 18650 batteries are a better choice.
My G I dont have a servo motor . Does it still work ? Is it works please tell me how can i make it so it would work without a servo motor
Hi friend. You don't need a servo motor for this to work. No need to change the code also. Just fix the ultrasonic sensor alone in front. The connections for the servo motor to arduino alone can be ignored.
Thank you very much 💀 I was really shocked by your quick answer . Thank you very much @@Science_4U_
Can I use 9 volt 2a dc supply cable
Yes sure friend. It will work. 👍
Hello, I have done the exact same set-up as you, but my servo doesn’t rotate..Other parts are ok.
can you tell me how I could fix it?
Hi friend..please check the connections once again. If the connections are correct and servo is not working, then it could be a problem with the servo motor. Replacing the servo motor will solve the issue. Also see if the servo motor is working with arduino connected through USB. If it works, it means that the batteries are not good and not able to drive servo motor. When arduino is connected through USB, the USB supply powers it and hence it gets sufficient power to rotate. Please check these things..
for me the servo motor is keep spining how to fix it??
Hi friend. There are 2 types of servo motors. 1. Positional servo motor which can rotate only 180 degrees and 2. Continous rotation servo motor which can rotate 360 degrees. In this project you have to use the first type. But I think you have used the second type. That is why it is keeping on spinning. Please check.
Wow qhat a auper peoject i like it super 👌 ❤❤❤😊😊😊🎉🎉
Thank you dear!!!🙂🙂❤️❤️❤️
Sir, ive checked all the circuit connections and code uploading too... I did very carefully and correctly... When im connecting it, only the uno board's light is blowing but not moving.... Pls help me with this problem, we have our science project coming soon
Hi...Can you tell whether the led light in the L298N motor driver board is also turning on?
@@Science_4U_no sir, the light in the motor board isn't turning on
And sir, when I uploaded the code, only the servo motor just rotated backwards and didn't work
@@srilatha.b7752 okay. The light in the motor driver board should have actually turned on. Can you check the power connection to the motor driver board?. Are the +ve wire from the battery connected to +12V terminal of the motor driver board & -ve wire from the battery connected to GND terminal of thr motor driver board? By just giving power to the motor driver board correctly, the red light in the motor driver board should have turned on.
@@srilatha.b7752 Also can you tell whether you are using the same 4 x 1.5 V battery pack?. Are the batteries new ones?. If there is insufficient voltage, then also the motor driver board will not work.
My servo motor is working but the wheels are not working.......I have connected wires as shown in the circuit diagram. Please guide me
Hi friend. There could be many reasons why it is not starting. You have to check one by one to find out. The most common problem could be L298N motor driver board. Have you used it before or is it a new one? . It could be faulty.
Also, in the motor drive board, there should be 2 jumpers in place connecting ENA and ENB and the pins above them. that is for enabling rotating of the motor. If the jumpers are not there also, the car wont start.
Also, check whether the batteries have charge in them.
Mine isn’t working that properly it’s just going mainly backwards and won’t go forward and just does what it wants.
Hmm. Okay friend. If you bring hand near the ultrasonic sensor, is the rotation changing?.
Yes the sensor moves right and left when it detects something in front of it. But the car would only go backwards
@@ChillzGamingPro okay friend. It is very easy to correct that problem..Just interchange the wire connections of the motors at both sides of the motor driver board. Is it working correctly now?
@@Science_4U_ don’t get what to do
@BeatBox_Raps Don't worry friend. Czn you come in instagram?. I will chat and help you solve the problem. Following is my instagram id..
instagram.com/_science4u_?igsh=MTM5aXFpdTM5aG5lNg==
Hello sir I have made exactly as per the video and used a 9V battery, I have one new ij spare so thats not a problem, when I uploaded the code I thought the robo was supposed to run but no movement is happening, the lights on the motor driver and arduino are blinking but the apparatus is just not moving at all can you please help with this? I have to submit tomorrow
Hi friend. I will surely help. My first doubt is the motor driver board. Is the motor driver board used before or is it a new one?. Sometimes the lights could be ON, but if the motor driver is faulty, the motors just wont run.
Have you used the servo motor also?. Atleast is the servo motor turning to left and right when you place your hand in front of the ultrasonic sensor?
Also, can you check whether the rotation enable jumpers are put in place in the motor driver board. There will be 2 jumpers kept on the ENA and ENB pins of the motor deiver board. If those jumpers are not there also, the motors wont turn.
@@Science_4U_ I checked my ultrasonic sensor is not working for now, the motor driver is new btw and is it because of ultrasonic sensor that nothing is working or there is also some other fault present in the circuit?
@@xyzabc7241 There is some other fault friend. Even if the ultrasonic sensor was not working also, the motors should have rotated continously. I have another doubt. Was the code uploaded properly?. If the code was not uploaded correctly, nothing will work.
can you please help me the car not move the servo motor working but dc motor not
Okay friend. There could be several reasons why the DC motor is not rotating. Most probably it could be related to the motor driver board.Please check the following. Do you see light on the motor driver board? Are there jumpers connected to ENA and ENB pins in motor driver board?. Is it a new driver board or an old one which has already worked before?
Hi,I connected 9V battery to motor driver l298n, motor driver's 5V pin to the Arduino's Vin pin and GNDs together.I connected ultrasonic sensor hc-sr04 to Arduino's 5V pin,GND to GND,trig and echo pins.Motor driver l298n and Arduino works properly,but ultrasonic sensor doesn't.What might be the problem?
Hello friend..From what you have told, the connections are done correctly. Most likely, the ultrasonic sensor may be a faulty one. Have you used this sensor without any problem before? If it is the first time that you are using this sensor now, then most likely it should be a faulty one. Replacing it should solve the problem..
@@Science_4U_ Thank you🙏
I did it. Thanks a lot. But i have question, how to change the code to adjust speed using pwm?
Hi friend. The Motor speed can be controlled using PWM by removing the 2 ENABLE jumpers at the motor control pins and giving a PWM signal in that pin. I will give below a link to a very detailed article on this. Please go through that and ask me if you have any further questions. I will be happy to help!!!
howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/
Can you tell the process of coding clearly step by step
How it was working IR for turning automatic sensor have u used any code or it will be turn automatic
Hi friend. It is detecting obstacle using an ultrasonic sensor in front. When the obstacle is detected, it reverses changes direction and then moves forward, thus avoiding the obstacle. The algorithm for this is written in the code..
I Have Four motors is it able to work on l298n motor driver?
Yes definitely friend. Just connect red wires of two left motors together and connect to one terminal at left side of l298n motor driver board..Connect black wires of two left motors together and connect to other terminal at left side of l298n motor driver board..Do this for right side motors also.
You can watch my following video for connecting 4 motors to l298n motor dtiver board...
czcams.com/video/JK6zTM65Rh0/video.html
hello, why is there no port
Hi friend. Do you mean that no port is shown when uploading the code?
Sir, I have completed the model by seeing ur video.but only one motor is running and another one is not working and the car is rotating in a circular manner because of One wheel.what might be the problem? and how can I resolve it sir
i Have also changed the motor Driver too
Okay friend. I think the battery may not be powerful enough to rotate both thr motors together. Can you lift the robot in you hand and try rotating the wheel which is not rotating. Do you feel like it is starting to rotate or there is no rotation at all?. Also alongwith the battery, connect uno to usb also. Now are both wheels rotating?. Most likely i think it should be due to poor battery.
I have also lifted up sir but only one wheel is rotating but if I give direct connection to the battery then it is rotating
@@SHIVKUMAREASWARB okay friend. Can you do one thing?. In the motor driver board, remove wires from IN1 & IN2 and connect to IN3 and IN4. Also remove wires frim IN3 and IN4 and connect them to IN1 and IN2. Is the other motor now rotating?.
I just only placed the servo and ultra and arduino moror driver thats only i am in my mothers home i cant build it but some days after i can build😢😢
Okay friend...
Sir my robot is only working when USB connected to Uno to PC
Okay friend. Then it is confirmed. The reason why only one motor is working is due to discharged batteries. When you connect uno to PC, the uno, sensors and servo are powered by PC. So more battery power is available for rotating the motors and hence both motors rotate. With the uno disconnected from PC, the batteries have to power everything together. So it becomes difficult to rotate both motors together. So change to a new battery and the problem will be solved.
Sir I use a new battery then also the problem is there
How many jumper wires do i need and which ones?
Hi friend, the ultrasonic sensor and motor driver board connection to arduino requires 4 nos
male to female jumper wires. Whereas the servo motor to arduino connection requires 3 Nos. male to male jumper wires..then 2 nos. male to male jumper wires for transferring power from motor driver board to arduino.
Thanks 👍
Sir please make a project on night patrolling robot with path folloer and edge detection and abstacle detection
Please help me, I have made the connections completely the same, my motor driver and Arduino turns on, even the servo rotates, but the wheels/motor are not working. I have used 3.7V x2 and also x3 batteries.
It should have definitely worked with 3.7v x 2 batteries. Have you used the ardino board and motor driver board before? Or is it new one?. Sometimes the boards can be faulty even if the lights turn on.
Also you can try interchanging the command pins from the arduino board to the motor driver board. The connections could have got interchanged. Also, if you have a multimeter, you can check whether the digital commands are going to the motor driver board by checking the voltage.
i use ch340 arduino and it doesnt have a ioref do you know for its substitute?
Hi friend. Is your CH340 a regular sized Arduino board or a nano board?. Instead ot IOREF another pin should be there in its place labelled 5V. Is there a pin like that?
@@Science_4U_ I use also a 2pcs of 3.7 batt 183650 still should i put that at 5V?
@@joannrosemalalis1374 Yes friend. The sensors are powered from the 5V outputs from arduino board. So if you are able to find any 5V pin in arduino board, you can use that to power the sensor.
Sir ,my robot is not moving forward and only left motor is rotating
If the robot is moving then the jumper should be there connecting the ENA and ENB pins to the pins just above it. If only left motor is rotating, mostly the battery could be discharged so that it is not able to rotate both motors together. Can you lift the robot in hand and try rotating the non rotating wheel and helping it to rotate. Is it rotating now?. Also keep the uno connected using usb cable and try. Whether both wheels are rotating?
sir my robot is working only USB is connected yo arduino
THos os amacing love
Thank you dear friend.❤️🥰🙂
@@Science_4U_ Thanks for the response, I love your videos. All are so good. Also can you try watching @ghosthumovies? - the content is pretty good
Thanks for your video. May I ask whether how can I see the complete Arduino code you used in this project. Actually, you showed the code in this video but I paused video but the complete code was not displaying at the computer screen. How can I access the complete source code
Hello dear friend. For all the projects, the code can be downloaded from link given in the description box below the video..🙂
thanks the code and the circiut is worked. thanks you are the best
Thank you dear friend..❤️🥰🙂
i also made a 0b avoiding car after learn from you.
Okay friend. That is great..!!!🙂❤️
Bro in code servo.h problem
Hi friend. Please install servo library to solve the problem. In tools..goto manage libraries.. search for servo and install it. That should solve the problem.
idk what board to connect it to??
Hi friend. There are 2 boards used in the video.
1. The microcontroller board is called Arduino Uno, which uses signals from the ultrasonic sensor and gives control signals to the motor driver board for turning the robot.
2. L298N Motor driver board. The motors are connected to the motor driver board and motors get power from the driver board.
We did it for a science fair project but unfortunately it isnt working 😢😢
Hi friend. There could be several reasons why it was not working properly. Can you tell me what is the problem. Is it not moving at all?. Or is it not detecting obstacles. I will help.
Can you send a caster ball link?
Scriptronics Small Metal Castor Wheel for Robotic Projects (Pack of 2) amzn.in/d/gRygLbv
Hello, please mention the battery model
Hi friend..I have used 4 Nos. of AA 1.5V batteries. You can use 2 Nos. of 3.7V 18650 batteries as well.
Hi bro I didn't get a ply wood sheet I took a cardboard then the cardboard didn't hang it i put one more cardboard it is any broblem
No problem friend. Cardboard should be strong enough to support all components..
Ok❤
Why is the code showing compilation error
exit status 1 Compilation error: exit status 1
Hi friend. Make sure you have to select the correct board under the tools menu in IDE software. Also, in the tools menu, the correct port for uploading the code also has to be selected. Then try reuploading the code. If it again shows the same error, you can try redownloading the code and again upload. Some change in the code could have happened because of some mistake. Still if the same error is occcuring, you can try changing the USB port or try a different PC /laptop.
Motors are not moving all connections are ok servo and sonar are working fine
Okay friend..Can you check whether there are 2 jumpers connected on ENA and ENB pins in motor driver board?. They act as swiches for enabling the rotation of motors. Without these jumpers in place, the motors won't rotate. So first can you check that?
@@Science_4U_ thanks for your help bro I was using used motor driver in which those jumper were removed i connected ant it is working .thanks a lot
@@user-jb1xc8sv9v ooh..great to know that friend..Happy to know that it worked..🙂
When iam disconnect the usb cable from laptop the motor didn't work when connect the usb cable to computer it's working what can I do😢
That is definitely because the batteries are discharged. When connected to laptop, the arduino, sensors and servo motor gets its power from laptop and the battery needs to run only the motor and so it works. So even if battery is slighly discharged, it will work.
Changing to new battery will solve the problem friend.
Thank you bro❤😊😊
Thankyou thank you for your best information ❤❤❤❤❤❤❤❤😊😊
Can I use 9V battery? Those square ones
Yes ..sure friend..But they dont last long and they are not rechargeable too..
I do everything but the motor won't work except with computer usp port. I put every voltage i can use to turn without pc put motor wont's work
Hi friend. If the motor works when the arduino is plugged to computer USB port, the most likely it is a battery problem. The battery is discharged and not able to drive the motors. When it is connected to USB, it is getting additional power and thus the motor rotates. Changing the battery to a good one should solve the problem..
@@Science_4U_ hi . I use a New battery but the motor still doesn't work
@@mohammedbj9226 Hi friend. To my understanding it should be definitely due to the bad battery. When you are connecting to battery alone, are the lights in UNO and motor driver board turning ON? Also , when it is connected to batteries alone, can you just try starting rotation the motor with hand?. If it is rotating after you rotate with hand, it again shows that it is a bad battery. Can you please try this?
@@Science_4U_ yes the light turning for both the uno and motor driver board and i try mov it with my hand but won't move i started think it's an uno board proplem
wow, itu sangat keren, terimakasih sudah memberikan tutorial itu🎉❤❤
Terima kasih teman💓🥰🙂
What library should install
Hi friend..No need to install any library. Only Servo.h library is required for the operation of servo motor but that library is already pre-installed when we install arduino IDE software itself.