How to Make Arduino black Line Follower Robot
HTML-код
- Опубликовано: 3 окт 2024
- How to Make a Line Follower Robot | Arduino based black Line Follower Robot
Code and Schematics:- marobotic.com/...
Components Details () {
5mm Acrylic Sheet 20cm x 12cm:- marobotic.com/...
DC Gear Motor x 4:- marobotic.com/...
Arduino UNO:- marobotic.com/...
IR Sensor x 2:- marobotic.com/...
L298 Motor Driver:- marobotic.com/...
4Pcs Smart Robot Car Tyres Wheels:- marobotic.com/...
Male to Female jumper Wires:- marobotic.com/...
On/Off Switch:- marobotic.com/...
18650 Battery Holder - 2 Cell:- marobotic.com/...
18650 Battery Cell 3.7V x 2:- marobotic.com/...
}
We regularly uploads exciting videos like this
Suscribe us For More Videos
Muhammad Ansar
+923378655465
Visit My Website:- marobotic.com/...
I like your line follower robot very much.Thank you for giving the codes and the circuit diagram.
welcome bro
#define enA 5//Enable1 L298 Pin enA
#define in1 6 //Motor1 L298 Pin in1
#define in2 7 //Motor1 L298 Pin in1
#define in3 8 //Motor2 L298 Pin in1
#define in4 9 //Motor2 L298 Pin in1
#define enB 10 //Enable2 L298 Pin enB
#define R_S A1 //ir sensor Right
#define L_S A0 //ir sensor Left
void setup(){ // put your setup code here, to run once
pinMode(R_S, INPUT); // declare if sensor as input
pinMode(L_S, INPUT); // declare ir sensor as input
pinMode(enA, OUTPUT); // declare as output for L298 Pin enA
pinMode(in1, OUTPUT); // declare as output for L298 Pin in1
pinMode(in2, OUTPUT); // declare as output for L298 Pin in2
pinMode(in3, OUTPUT); // declare as output for L298 Pin in3
pinMode(in4, OUTPUT); // declare as output for L298 Pin in4
pinMode(enB, OUTPUT); // declare as output for L298 Pin enB
analogWrite(enA, 110); // Write The Duty Cycle 0 to 255 Enable Pin A for Motor1 Speed
analogWrite(enB, 110); // Write The Duty Cycle 0 to 255 Enable Pin B for Motor2 Speed
delay(1000);
}
void loop(){
if((digitalRead(R_S) == 0)&&(digitalRead(L_S) == 0)){forword();} //if Right Sensor and Left Sensor are at White color then it will call forword function
if((digitalRead(R_S) == 1)&&(digitalRead(L_S) == 0)){turnRight();} //if Right Sensor is Black and Left Sensor is White then it will call turn Right function
if((digitalRead(R_S) == 0)&&(digitalRead(L_S) == 1)){turnLeft();} //if Right Sensor is White and Left Sensor is Black then it will call turn Left function
if((digitalRead(R_S) == 1)&&(digitalRead(L_S) == 1)){Stop();delay(1000);turnLeft();delay(600);turnRight();delay(1250);} //if Right Sensor and Left Sensor are at Black color then it will call Stop function
}
void forword(){ //forword
digitalWrite(in1, HIGH); //Right Motor forword Pin
digitalWrite(in2, LOW); //Right Motor backword Pin
digitalWrite(in3, LOW); //Left Motor backword Pin
digitalWrite(in4, HIGH); //Left Motor forword Pin
}
void turnRight(){ //turnRight
digitalWrite(in1, LOW); //Right Motor forword Pin
digitalWrite(in2, HIGH); //Right Motor backword Pin
digitalWrite(in3, LOW); //Left Motor backword Pin
digitalWrite(in4, HIGH); //Left Motor forword Pin
}
void turnLeft(){ //turnLeft
digitalWrite(in1, HIGH); //Right Motor forword Pin
digitalWrite(in2, LOW); //Right Motor backword Pin
digitalWrite(in3, HIGH); //Left Motor backword Pin
digitalWrite(in4, LOW); //Left Motor forword Pin
}
void Stop(){ //stop
digitalWrite(in1, LOW); //Right Motor forword Pin
digitalWrite(in2, LOW); //Right Motor backword Pin
digitalWrite(in3, LOW); //Left Motor backword Pin
digitalWrite(in4, LOW); //Left Motor forword Pin
}
It worked! tysm i did it! I cant wait for more like this.
You're welcome!
Hi!! I made a similar robot everything is fine the sensors are working battery connections everything is just fine but it just doesn't move!!
@@palakthareja2257you probably have a different version of l298 where there are 5v and gnd behind the input pins so in that case take 2 female to female jumper wires and connect enable a and enable b to the gnd behind them the code will probably run or another approach if you have connected the enable pins to the aurdino so adD
TO MOVE FORWARD
digitalWrite(ena,HIGH)
digitalWrite(enb,HIGH)
TO MOVE RIGHT
digitalWrite(ena,HIGH)
digitalWrite(enb,LOW)
and vice versa for turning left this could be opposite depending on your motor connection just try it..
Nice project bro
thank you
Good day sir ,
I very much appreciate your video.
While connecting the wires you have removed l298n motor driver's jumper. Is it require to short both pins before connecting the wire to arduino pin no 10
thank you
Not possible
Hello again does the size of the black line matters? What is the recommended size of the black line?
This matters and line size is 1 inch
@@MuhammadAnsar thank you so much
@@MuhammadAnsar may I know the accurate placement of the ir sensor
MashaAllah bhai nice work
thank you bro
@@MuhammadAnsar Always Welcome bhai
What is another alternative for the ir sensors back like in 6:21or do we really need it or we can just hang the ir sensor
Sir aapne jaise bataya vaise maine Project kiya run bhi hua but vo robot jada bhag nahi raha hai please suggest me solution sir 3.7 volt ki battery lagai hai
I 💙 this project because it’s unique, simple and very straightforward. Just a question and we are good sir. I notice that you didn’t check the positive terminal of the gear motor, but you just connect them together does it really matter if we just solder the wires together without testing if we are trully connecting positive to positive & Vice versa?
Also, I notice my Two IR sensors are not showing off light & my robot 🤖 turns around on a spot. What is the issue is it from the gear connection or IR connections? Thanks 🙏 for your swift responses
Assalam-o-alaikum . Bhai can i please use two heavy motors instead of four gear motors?
WAS yes bro use this
Can I use 9v battery instead of these battery cells?
Yes, but it is better to use a rechargeable battery
Assalam o Alaikum.Ma Sha Allah again a good project with easy explanation. Brother L298 motor drive se 4 motor control krna koi issue to nahi hota??koi ehtiyat waghaira??
Walaikum-As-Salam thank you
Yes no problem
@@MuhammadAnsar thanks brother
@@fantastictv4175 welcome
@@MuhammadAnsar bhaijan Kia humain ir sensor ko calibrate karna parta hai screw sey??
Bro IR sensor connection showed in block diagram is different is there any other code for that?
check the video description
I can't find any acrylic sheet in my place. Do you know any alternative for it?
Everything is ok check your hardware
Bhai can i use 12v battery instead of 7.4v battery in motor driver?
yes bro use this
Assalam-o-alaikum . Bhai can i use male headers instead of male female headers?
Good idea. Great work. Love it.
thank you
Assalam o Alaikum. Dear Ma Sha Allah great work.
Dear plz aik cheez ka bta dain k black line floor pe banay k liye kia cheez ka use kia main ny black Tape use ko but robot usko detect nahi kr raha. Plz help kia cheez use krn
Can we use white tape instead of black tape to make the line.
bro only work on black
Black tape is the only thing it works on as black colour absorbs light and ir sensor senses light and if some thing blocks it it knows when to take turns so black tape plays a major role in this project
@@blackychan30yearsago Bhai black tape toh thik hai par uske aas pass ki surface white honi chahiye kya?
@@namangarg6959 yes it should be white to detect the black tape
Brother use can use it sensor in any way you can use it by using Black tape on white surface and vica Versa you can use white tape on black surface
Hi!! I made a similar robot everything is fine the sensors are working battery connections everything is just fine but it just doesn't move!!
Hey bro i make this type of robot for my college project but the problem is when i start the robot it will go straight very easy but when he try to turn it will stuck what can I do please help
Bhai where do you get the arcylic sheets?
Hardware shop
Sir, I love your videos about Arduino robotic projects. 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 robot, the line follower robot only work but the 5v buzzer and led are not working, I am making a line follower robot project. Give me the circuit diagram of the Arduino line follower robot s buzzer and led visual indication when completing the checkpoints of each of the black line circle tracks.
the car is starting and the wheels are turning but it won't move on the track, can you help me how to solve it?
Sir, I like your videos about Arduino projects. Sir, will the line follower robot sensors blink and produce the sound beep when completing the black line circle if I attach the 5v buzzer in the circuit diagram as well in the code for the line follower robot? Sir, will the line follower robot work or not?
yes it's working
Where did you plug in the jumper wires coming from the ir sensor? I didn't find any sockets above the analog pins in Arduino Uno.
arduino uno r3 smd
Can you please send me the link for buying Arduino Uno R3 smd from Flipkart or Amazon?
Assalam-o-alaikum.Bhai if this arduino uno don;t work.Can we use another arduino uno?
وعليكم السلام
yes bro use this any arduino
Hello sir will this robot can take 90 degrees turn I mean T type turn by the exact same code and components ?
Pls reply ....
2 Sensor based 90 degree does not work
@@MuhammadAnsar ok then for the 90 degrees turn are more sensors required?
@@MuhammadAnsar sir pls reply
Min tutorial buat line follower jalan bercabang suwun
Stop when alarm ? Thank you.
Welcome
@@MuhammadAnsar robot stop when polished ? I’m sorry, I made a mistake.
Sir, please answer my question. I need to know that you can teach me the courses that you know or not. Please reply to me. Thank you, sir.
Hi, I am using 6x AA batteries and everything lights up fine, but the motors are not rotating. Plz help
Mine so fast so it can't ready the black tape but when i aligned the sensors to the tape manually it works. The only problem is the the car is so fast how can i fix it?
Assalamualaikum. Bhaiya please make a vedio on pid line follower robot☺
Walaikum-As-Salam
ok bro
Have you made any line followers using PID?
on
Sir website for sketch is not available 😢
mashalah
thank you
Very nice 👌
thank you
Sir, What is the rpm of the gear motor
12v 500RPM
it says this error message while compiling
(avrdude: ser_open(): can't set com-state for "\\.\COM3"
Failed uploading: uploading error: exit status 1)
kindly reply with a solution ASAP
पार्ट ऑनलाइन मागवल्या किती दिवसात घरी येतात
Hii can i know why my IR sensors dont work , i did in the same way u thought it but it isn't working??
Does the labeling on the component indicate VCC (Voltage Common Collector), GND (Ground), and OUT (Output)? Typically, the convention is for VCC to be positioned on the right, GND in the middle, and OUT on the left. Please double-check; the OUT connection should be directed to the input of the L293D motor driver chip for proper functionality.
Sir cost kitna ayega approx btye nh ...???
I have a robot but it just vibrate it doesnt go forward why ?
Might want to check the C++ Code, Ask ChatGPT or in the Arduino Forums,
Sir, could you help me with 7 sensor and using led oled with control P, please?
Super bro
thank you
L29N MOTOR KE LIYE V YHI CODE HOGA KY
Sir, can you please teach me how do you make it? Sir, can you teach me the skills you learn from the institute and the skills you learn from the teacher? I want to learn these skills from you, sir. Please, sir, teach me through making the videos. Thank you, sir.
Can i use 12v motor with 12v battery?is there any change
can be used without any changes
Can you give code matlab 2018
Sir,ingala video kandit line follower robot undaki ..but linil koode work aavunnila
Assalam-o-alaikum.Bhai can you please upload the new video about arduino uno walking humanoid robot?
Please.
ok bro
Assalamu alaikum bhai
Muje ye wala ready set hona
Kya app help kar sakte?
wa alaikum assalam
haan g bhai btay kia help chiy
HOW TO SOLVE THE WABBLING OF A LFR
I have a serious question sir. It's an earnest request that you answer it as soon as possible. The process you have showed in the video, related to the plugging in of the ir sensors to the Arduino Uno is different from what you have shown in the circuit diagram. If I exactly follow the circuit diagram, then will the code work? Or will I have to modify the code for that?
Id also like to know the answer to this.
Im going to use 2 dc motors. What part of the code I am going to change?
Same code for 2 motor and 4 motor not change the code
Okay sir thank you
@@ramosedizamaea.1736 welcome
Sir here is a problem
what is problem
Will it work in the dark
yes bro
First
thank you
Will this work
yes
salam bahi ya audino file open ni ho rahy 8:18 is software ka link da day thanks
www.arduino.cc/en/software
Full coding pls
Check description
Not wark 4 whel rotting pls tall
yoo bro thank you soo much for this project tutorial. using this i was able to make the best project in my college and finally helpeed me pull some bitches. i owe u some so lmk when u free, i can arrange something for u. only the top of the pile stuff for u my brother....
glad to know it was helpful for you
diagram ki samaj nahi ai
Dobara banao
Bhai code kese copy past karu nahi ho rahe copy
In the description of the video there is a link to the code and circuit diagram from there you can download it
nICE SPELING OF FORWORD NOT FORWARD
good evening sir, i am a student of class sixth Ihave copied the same codes but it is showing me Executing command: exit status 1 can you please help me I request you I am callin on your mobile no. given in description please pick up
सर एक समस्या आ गई है
समस्या यह है कि कोड डाउनलोड नहीं हो रहा
bro why my car going on opposite direction
Change the motor wires
Sketch upload nhi ho raha
some error in code
Codenya
what