Line Follower Robot using Arduino🔥
HTML-код
- Опубликовано: 3 июл 2024
- In this video we are going to make simple Line follower robot using Arduino.
The idea behind this robot is to detect black line using 2 IR sensors and move robot accordingly using L298N motor driver module.
I have explained in details each step along with code.
👉Please subscribe: ruclips.net/user/hashinclude...
👉Components list:
✅ Arduino Uno amzn.to/3z97ACS
✅ IR Sensor amzn.to/3fE1tgs
✅ 2WD car kit amzn.to/3U8BVqK
✅ L298N motor driver module amzn.to/3hfLIwJ
✅ 7-12 V DC Battery (in our case lipo 2s battery) amzn.to/4cxwz0Q
✅ Jumper wires amzn.to/3heE3Pa
✅ Glue gun amzn.to/3zfhwe4
✅ Double sided tape amzn.to/3KSJdfa
✅ Black Electrical Tape
👉 Shorts Channel :
/ ujwalnandanwar
👉Code and diagram:
github.com/un0038998/LineFoll...
👉 Hand Gesture controlled car
• Hand Gesture Controlle...
👉 Elevating Car
• Elevating WiFi Car usi...
👉 Camera Car
• Surveillance Car using...
👉Bluetooth Car
• How to make Bluetooth ...
👉Wi-Fi Car
• Smartphone controlled ...
👉Obstacle avoiding car
• Arduino Obstacle Avoid...
👉Arduino RC car using nrf24l01+ module
• Arduino RC car using N...
👉Watch more videos:
/ hashincludeelectronics
👉Follow us on Instagram:
/ hashincludeelectronics
⏱Chapters
00:00 Intro
00:33 Components
01:10 Assembly of car
02:30 Connections
03:37 Code explanation
05:22 Sensor calibration
05:49 Demo
#linefollowerrobot #arduinoprojects #hashincludeelectronics Наука
Thank You !! It Was Very Helpful. You're Amazing !!🖤🖤
Thank you very much 👍🏻
Thank you for such a great explanation
Thank you so much for this video. It's really helped me a lot to practice with Arduino UNO.
You are welcome 🙏
you saved me alot of hard work bhai. love it!!!!!
Happy to help 👍🏻
Harsh I find it highly professional channel. It is well organized. Please do videos on micro mouse and AI. All the best!
Very simple explanation thank you.
Welcome 🙏
Awesome bro , this is helpful ..
Glad you think so!
Woah thats so coool , i guess i know what to do now thank you sir
Awesome 👍🏻👏🏻
Thnx sooo much for the video it really helped me!!!!!!!
Welcome 🙏
Super bro..thnq for sharing
Welcome 😊
Fantastic explanation 🎉❤
Thanks for checking out the video 👏🏻👍🏻
Guys I am observing that people are facing issue only because they are using 9v non rechargeable battery . Please don’t use that 9v non rechargeable battery because it does not provide enough power . Use some good rechargeable battery like LiPo or LiON batteries👍🏻
Hu
Huhuhuhu
Huhuhuhu
Huhuhu
Do we have any code to control the speed like to make it go faster
nice presentation bro. keep it up
Thanks a ton
It helped me a lot!
Thank you very much for checking out the video and I am glad that it helped you 👏🏻👍🏻
thank you!
BEST SOLUTION for basic line follower robot , thanks you !!
Thank you very much for checking out the video and comment 👍🏻👏🏻
muchas gracias bro... me re sirvio
Thank you very much for checking out the video 👍🏻
Thankyou so much.
Welcome!
Very helpful 🙂👌
Glad you think so!
Thanks for you're great video!
We're doing a quite similar arduino project and we were wondering if it's possible to let the robot make a 180 degree turn, so that it can make it through the parkour in both directions.
You can make a code change to rotate robot . Adding proper delay will rotate the robot through certain degree . Not exactly but roughly . Give it a try 👍🏻
@@hashincludeelectronics How can I make it do a 180-degree turn?
Thank you Sir
Welcome 🙏
Excelente video, gracias, te ganaste un nuevo suscriptor. 🙋
Thank you so much 👍🏻👏🏻
Finallyyyy maaaaaahnnnn finallyyyyyyyyyyyyyyyy ............ GUYZZZ IT IS WORKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
That’s amazing news 👍🏻👏🏻. Good job
Thanks for you're great video!
We're doing a quite similar arduino project and we were wondering if it's possible to use 11.1v 3s battery lippo
Yes you can use that 👏🏻
7.4 v Battery can useable?
Thnx brother
You are welcome 🙏
Great video. Your tutorial actually works perfectly. Can you send me one more instruction, I'm trying to connect an ultrasonic sensor and I want to stop rotating both motors when the distance is less than 30 cm.
Thanks for checking out the video 👍🏻👌🏻. You can check my video on human following robot for use of ultrasonic sensor .
@@hashincludeelectronics It isn't working as I do it by myself. Can send me some instructions to do what I want.
simply i mean how to make a line following robot which stops at an obstacle
Nice video bro
Thanks for the visit
Well explained
Thank you very much 🙏
Hi, your video is amazing, can you tell me How long should the chassis of the car be? Please. I need the measurements of almost everything that should be used . Thank you and I really hope you can help me 😢
You can buy this robot chassis online . It’s easily available 👍🏻
Thank you so much for the video it was really good, I'm doing the same project but I'm adding a PID controller to smooth the movement so could you please help me by guiding me what to add to the code. Thanks in advance bro
Thank you very much and I wish all the best for your project . Adding PID to such robot is quite challenging. You will need to use multiple sensors and then tune PID . I would suggest you to check some other videos where they used PID . Good luck 👍🏻
Dude, I'm doing the same project to control the motor.
I'm using an encodere to try it.
tq sir
Welcome 🙏
👌🏻👌🏻👌🏻
🙂👍🏻
You have make a great stuff. Can i slow down the motor from 180? if can i will compose message for you.
Thanks you 👍🏻. Yes you can slow down the speed if needed .
Thanks alot
Welcome 🙏
@@hashincludeelectronics i need help in my micromouse robot can you help me?
Thanks for the great video.
I was watching your project and in which one sensor is working properly but light lights are red. The other sensor has 1 green light glowing and it is not working at all. What should I do?
You need to caliber both the sensors as shown in video 👍🏻👏🏻
I have a question with the wiring, I see you Combine a bunch a wires into one when doing the sensors how do we also make that?
It’s quite simple . Just join one end of multiple wires together and then attach single wire to this joint . I used this so that I can provide 5v and gnd to all components from l298n drive .
Very cool 👍
Thank you! Cheers!
Thank you to give such a great video😊❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
You are welcome 🙏
Hi.
I watched the video and made the robot. The problem is when the robot walks, we notice that one of the sensors is close to the edge of the black line, while the other sensor is farther away at the black line, although the distance between the sensors is equal to the width of the line. How to make the right and left sensor on the two edges of the line
You can adjust it appropriately
Amazing video dear and good explanation. I followed each and every step as you explained and also used rechargeable battery motors are not working sensors are ok. Please guide
Please check for any loose connection. Also calibrate the IR sensor 👍🏻👏🏻
excellent video, you know if it would work the same if I put a 9v battery directly to the power plug
Yes but use only rechargeable battery
Thanks for you're great video!
it was very clear. i followed all steps and everything worked except motor? how can i fix it?
Please make sure you use only rechargeable battery . This solves lot of issues 👍🏻
Thanks for the great video!
I have a question regarding the power. If I power up the arduino straight from battery, then I connect VIN & GND from arduino to 12V and GND of L298, then I take 5V & GND from arduino to the IR sensors, will it work? I tried doing that but my arduino just makes a continuous beep sound. Thank you!
Please check the video for connections 👏🏻👍🏻
Hello, can you resolve the problem? . In my case, i have the same problem than you
@@robertmanuelgonzalez2332 i rewatched the video and turns out my connections were wrong, try to check your connections!
I have the same kit, what do you recommended me to do for additional speed?
Increase the speed in the code .
Good
Thanks
Does a 4 AA battery works for this...if not,suggest any alternative battery for this other than the one you have used in this video....we have tried using 2 HW connected in series....but the motor stops after running for some time.....
Don’t use that AA battery . Try LiOn 18650 2 cells .
Hi, i have a problem that the wheels doesn't move even on a white surface. I followed the video up until the part with the power source. I used 4 AA batteries as the set i used included that kind of battery compartment. What could be the problem?
Thanks for checking out video 👍🏻. You can easily adjust the speed in code by changing the value of (MOTOR_SPEED 180) . Try increasing it till 255 max value based on your current speed
Nice work man. Just a question, is there a way to adjust the speed of the car? We have a racing competition. Hope you can help. Thank you.
Yes you can adjust the MAX MOTOR SPEED in code . However not sure if this will be suitable for racing competition you are participating. This is very basic line follower robot. It does not have any latest technique like PID control or more sensors etc .
@@hashincludeelectronics thank you for your response. Can I achieve fast bot using l293d and 3 ir sensor?
hey thx for the detailed video.i made the robot but i dont understand how did u calibrate the sensors like
should they beep when they detect the line or wht
also the motor wont move and the code is all the same as u provided
the ir sensors continuosly make a beep sound
can u pls reply and tell me the solution as i want to make this robot
also i had to ask if the whole project will work on a 9v battery(non rechargeble)
Please use only rechargeable battery 👏🏻👍🏻. Also check the video for calibration 👌🏻
Thanks for your great video!!
Actually I am doing a similar arduino project for college purpose and our faculty is asking for a proper circuit simulation using tinkercad or proteus for this project but we are unable to find L298N H bridge in tinkercad so can you please help with this issue and provide with some simulation softwares which will help.
Unfortunately I will not be able to help with this simulation 👍🏻👏🏻
hello there,
thanks for you video you are already carring us through our university projekt. But in our project we need to go the track backwards. Do you belive its better going backwards or let the linefollow robot turn 180 degrees at the end of the track and then drive back. In our track the end of the line is build with a big black point. So that both sensors see black and stop.
We would really appreciate an answer.
Greetings from Germany
I would suggest make a 180 turn . Right now this robot stops after seeing black big spot . Rather than stopping it , let it turn 180 degrees . You need to adjust delay for this 180 degree rotation . I don’t have robot assembled to test it . So you need to do it on your robot and see if it works . 👍🏻
Great video the circuits work but im just curious why my robot is resetting while it detects a line? sometimes when it detects it stops and reset the the led is blinking after the restart
I think issue is with your power supply . Please check that 👍🏻👏🏻
Hello thanks for your video , i would like to know for this kind of robot if it’s better in terms of stability and maneuverability to do 4 wheels (2 in the back 2 in front ) or only 2 wheels or 2 wheels in the back and one wheel in the front like you did ?
Anything will do . But you will have to make changes accordingly in your code for speed .
I'm very excited with your idea. But when I tried em with 9v battery it won't start. Do I have problem with power supply?
Thanks for checking out video 👍🏻. You can easily adjust the speed in code by changing the value of (MOTOR_SPEED 180) . Try increasing it till 255 max value based on your current speed
I think I have a different type of arduino
In my arduino there is no black rectangle in between just the left and right side
nothing in between like it has just right to the connection
will it work or i need the same on
Please check the pins and make connections accordingly 👍🏻👏🏻
Can we use a case of 4 batteries with 3.7 v each instead of this lippo battery mentioned in your video ??
Use 2 batteries 👍🏻👏🏻
Hi. Can you share what RPM motor you are using. I am using 100 rpm geared motors and it takes about 3 cms to stop and that is causing the sensor to cross the black line.
Try 1:48 ratio motor which will have 200 rpm . 👏🏻👍🏻
Sir, which analog pin of the positive and negative pin of the 5v buzzer. Sir, can I have to write the code of the 5v buzzer in the line follower, will the line follower robot work or not?
Sir, I put the buzzer pins and the led in the Arduino Uno, but the Arduino line follower robot s buzzer and led are not working when I turn on the line follower, the line follower robot works but the 5v buzzer and led are not working. Give me the circuit diagram of the Arduino line follower robot s buzzer and led visual indication.
Please check the buzzer specification for pins . Also first check only buzzer working with Arduino and then integrate with line follower code . Go step by step , have patience 😜 and it will work 👍🏻
what kind of double wires are u using to connect arduino and sensors?
Those are connected wires . Connect 2 wires together at one end .
Thanks for this video!
I built the robot but, the wheels aren't rotating even when the arduino uno board is attached to my laptop.
Also the 'L' labelled LED is not glowing on the arduino Uno board.
What should I do?
Please check the video slowly and carefully. You might have missed some step 👍🏻👏🏻
Our robot stops when it reaches the black line instead of following it. How do we make it follow the line?
How many jumper wires will be required and which male to female or male to male connecters?
You can buy set of mixed jumper wires . Those will be used in future as well . Keep it with you 👍🏻👏🏻
My query is can this robot travel in an unclosed loop (i.e. a curvy line ) and stops at end point
Yes it can .
Why do we need to use rechargeable batteries instead of regular ones? Is there any alternative? great video btw.
Thank you very much for checking out the video 👍🏻👏🏻. Rechargeable batteries provide enough power for these projects . Hence we use it . It also avoids many power related issues in our project .
Can u provide me this in working model..
I can pay for this
hello sir i really liked the videoi wanted to know how to add station stops of 15 seconds to the robot
You can add it in code after delay(15)
@@hashincludeelectronics how to add. as i want the robot to stop for about 15-20 seconds on every set stop.
Hi!! If i want to move robot backward.. Is it necessary to use IR sensor on the rear?
That's a good point . I don't think we need IR sensors on the rear of car. You can still move the car backwards (In the same way we are moving in forward direction) and keep checking if these IR sensors touch the black line and move the car accordingly in left/right backward direction.
You can add 2 modes of operation in code , 1. Forward mode 2.Backward Mode.
Give it a try and let us know how it goes.
when output is high then the motors are not working but when output is low then it works.... please help asap
Please check your connections again .
Its all done! When i paste the codes why its not running the motor?
Please use rechargeable battery only 👍🏻👏🏻
Sir alll functiality work good but vehicle not running if lift up then it's runs wheels
The power supplied is not enough . Please use good rechargeable battery . 👍🏻👏🏻
Will this work if i use a black sellotape to make the line on a gray colored floor?
It might work but you will have to calibrate the sensor accordingly. For better response please use white floor only 👍🏻
Hello admin actually we made so before connecting wires it spins but its not working can you please help?
THANK YOU FOR THE VIDEO BUT MY MAIN PROBLEM IS IHAVE GIVEN ALL THE CONNECTION CORRECTLY AND ALSO FEEDED THE CODE BUT IT'S NOT RUNNING AS EXPECTED
Please use rechargeable battery only 👏🏻👍🏻
Can I use tcrt5000 sensors instead of those you're using on the video?
If those sensors can act like IR sensors then yes you can use . It should provide you digital output 👍🏻👏🏻
Hello sir, can we use Bo motors for this !?
Yes we can use 👍🏻
Can I use l293d motor
No you cannot. .please use L298N module only 👍🏻👏🏻
I did everything in this video, the IR sensors are working and detecting the black line but the motors still do not move? I checked all the wiring and nothing is flawed, please help.
dude did you find the solution , facing the same issue
Can we use Duracell 9v battery
Yes you can use that . But make sure you use new one so that it provides sufficient power .
Sir, I wonder what controls the movement of this robot, is it the code saved in arduino uno?
Yes it’s the code which controls the robot 👍🏻👏🏻
hello sir, thanks for sharing your project
i would like to ask if this works with arduino uno r3
Thanks for checking out the video 👍🏻 yes I used the same module
@@hashincludeelectronics thank you!!!
hi good day, thank you for this wonderful video tutorial!!
We did everything you did in this video but our robot is not following line, it just keep on spinning around, maybe because one of the wheels is not working properly (but we already changed it but still nothing) also im using 9v battery, maybe this battery voltage is not enough.
can u help me?
everything is working if i move the wheel forward but i was only temporary
Please use rechargeable battery only . Don’t use that 9v non rechargeable battery 👍🏻👏🏻
hey mate is it working now? iam also making this project but it is not working i don't know why.. can you help..
hey i am just a fresher planning to do this project i just want to know while uploading the code on Arduino the Arduino should be connected to the laptop right? but after dumping code on Arduino can we remove it, and still does it work? sorry if it's too basic cos I'm just a fresher but very interested to do Arduino related projects
Yes, It will work. Upon uploading the code to Arduino, it executes every time power is supplied to the board.
Thanks Parvez for explaining this . 👏🏻👏🏻 nice cooperation 👍🏻
@@parvezkhan5198 thank you i also wanted to know if there's any arduino code to control the speed of the robot
Sir, when I turn on the switch my motors are always running in forward direction even when I bring one sensor on black path at low speed
I thought I'm the only one
Good day!
We are working on this for a school project and we followed the steps with utmost care and yet the wheels won't move
The IR sensor can sense but it still doesn't work we even tried highering the speed to no avail. Also, we use 4AA lithium-ion batteries.
What are some possible solutions to our problem?
Kawawa ka nmn 😔
Please use rechargeable battery 7-12 V 👍🏻👏🏻
hey nice project i have a queston my motors make this screeching noise and doesent move and the ir sensor dont controle i am using a 5v from arduino and gnd and then 9v from battery what power souurce should i use
Please use rechargeable battery only 👍🏻
@@hashincludeelectronics hey thanks i have a new problem the ir sensors work and light up but only 1 ir sensor controles 1 motor how dpo i get the other one to controle the other motor i think the left is only woking and so is the left motor
Please make a video on same line follower robot but using L293D motor driver insted L298D motor driver please send video
I think you can do it easily . Just try to find out how to use L293D driver . And update the code accordingly. Give it a try . However I am not sure why you need to use L293D where as L298N is simple to use .
How can I use the breadboard instead of L298N board.
Breadboard is just for making connections easily(Consider it as board of wires). L298N module is motor driver module which is used to control motor.
sir how can i make the robot move only in specific times like 15:00 or 8:30 and how can i make the robot stops in different positions ?????
Unfortunately it’s not possible with this robot
What is the minimum distance between both the ir sensors? My robot is not following the line properly.
Make it around 5-6 cm . And the line thickness less than that 👍🏻👏🏻
heyy which board we want to select??
Arduino Uno .
Thanks for you explanation.
I was wondering that can your robot rotate 90 degrees?
Because I built a project which is black line follower robot that I needed for my college and I did everything correct except that my robot cannot recognize the 90 degrees so no rotation at that angle, so can help me out of what to do?
Thanks for checking out the video . Please note that this is very simple line following robot. If you need more angular and accurate turns , we will need to use more IR sensors and its a different project. You can check online for more information on such complex design.👍
@@hashincludeelectronics Alright, thank you
hi
I watched your video and I do not have many male to female wires needed. can I tape the male to male wires instead
Yes you can 👍🏻👏🏻
@@hashincludeelectronics ok thank you
In my project...wheels are not taking left or reoght turn...its just going in forward direction
Please check video again for any missing step . Also use only rechargeable battery 👍🏻👏🏻
is it ok if I use LiPo Rechargeable Battery 7.4V 2800mAh 25C?
Yes that would work 👍🏻👏🏻
What is the name of the wire that connects the switch with the battery and the l298n motor driver?
That is JST connector . However you can use simple any wire 👍🏻👏🏻
I have doubt on the connection from motor to sensor
how did u connected i ground from motor to both the sensors and uno
similarly 5 v one
I see a jumper wire with one male and 3 female
whats that
It’s like join 3 wires together and then connect single wire to this joint . So it’s like 1->3 connections . 👍🏻👏🏻
ok got it boss
thanks
@@hashincludeelectronics
Is it also possible to use LR6 batteries?
If it’s rechargeable battery then yes please use it 👍🏻👏🏻
Where to connect the switch and battery? Because it differs from the circuit diagram you gave in description
The circuit diagram is correct . Please follow it and also video step 👍🏻👏🏻
i have any question, if I Use Battery 9 Volt in Schematic . can it work?
You can use 9V battery. But use only rechargeable battery.
hello sir.........ur video is really helpful.......i did also try to mke it for my school expo.........but the problem is the ir sensor is not detecting the black line...............the ir sensor is just scanning any surface and it moves......pls help me sir...my expo is comong soon.....thank you
You need to calibrate the sensors as shown in video 👍🏻👏🏻
Can I use 1.5V batteries?
PLease do not use those 1.5v non rechargeable batteries . Use only rechargeable batteries .