Line Following / Tracking Robot Car (Arduino and QTR-8 Sensor)
ฝัง
- เผยแพร่เมื่อ 10 ก.ย. 2024
- In this tutorial, you will make arduino line following / tracking robot. This tutorial involves building a line follower robot with an QTR-8 Infrared Sensor.
Required Hardware:
1x Arduino UNO R3:
bit.ly/2xt9MVk
amzn.to/2LZr6t4
1x L293D Motor Drive Shield:
bit.ly/2H7vmy9
amzn.to/3qADuic
QTR 8 Infrared Sensor:
www.pololu.com...
2x Wheel and Gear Motor:
bit.ly/2RXAWLS
amzn.to/2M2pChV
3 in 1 Jumper Wire:
bit.ly/2J6de9E
amzn.to/3doetmT
2WD Robot Car Chassis Kit:
bit.ly/2sqIHgy
amzn.to/3s1ptur
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
- Download AFMotor.h library: learn.adafruit...
Uncompress the ZIP file onto your desktop
Place the AFMotor folder into your arduinosketchfolder/libraries folder
Rename the uncompressed folder AFMotor
- Download QTR-8 library: github.com/pol...
Rename the folder “qtr-sensors-arduino-xxxx” to “QTRSensors”
Drag the “QTRSensors” folder into the “libraries” directory inside your Arduino sketchbook directory
Source Code: github.com/Mer...
Connections :
- DC Motors connect to the Motor Shield
- Left Motors connect to M1
- Right Motors connect to M2
- The QTR-8 Sensor Connections
The Sensor VCC connect to the Arduino +5V
The Sensor GND connect to the Arduino Ground
The Sensor pin 2 connect to the Arduino Analog 0
The Sensor pin 3 connect to the Arduino Analog 1
The Sensor pin 4 connect to the Arduino Analog 2
The Sensor pin 5 connect to the Arduino Analog 3
The Sensor pin 6 connect to the Arduino Analog 4
- Battery and on / off button connection
The (+) from the battery is connect to a leg of the button
Connect a cable to the other legs of the button. This cable is for Motor Shield (+)
Source Code: github.com/MertArduino/Arduino-Line-Following-Robot
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
i am getting this line as error
QTRSensorsRC qtrrc((unsigned char[]) { A4,A3,A2,A1,A0} ,NUM_SENSORS, TIMEOUT, EMITTER_PIN);
help me out
i am getting this line as error
QTRSensorsRC qtrrc((unsigned char[]) { A4,A3,A2,A1,A0} ,NUM_SENSORS, TIMEOUT, EMITTER_PIN);
help me out
Mert it is so nice to see Turks running the robotics!
I love the stuff you are doing,
many thanks for this great sharing :-). To new readers: you must use the OLD QTR-sensor v3.0.1 from on Aug 9, 2018. V4 is rewrote according to Pololu BrandonM. The error is "QTRSensorsAnalog does not name a type" if using V4
thank u for this great comment
ur a god bro!
Thanks a lot bro
Even its great that you are saying how to install library in the same video seriously bro u have a very god thinking skills
Sup!
bu konuda izlediğim en anlaşılan vide tebrik ederim
Türk olduğunu tahmin etmemiştim saol çok iyi video
Why did you connect it to analog pins when giving 8rc digital output?
Dude your awsm man you just created ur own webpage.. though your subscribers be less but you have all the things which a pro you tuber has like knowledge, webpage, cool fans like me and all
You deserve it bro
can u help me?, i always get Compilation error: no matching function for call to 'QTRSensors::QTRSensors(unsigned char [5], int, int, int)', what things need to change?, ASAP pls 🙏🙏
I have the Arduino software version 1.8.16 and a lot of lines in the code have error messages but i followed the instructions exactly as they were on the video. I have both libraries installed but there are still error messages. Could you possibly update the code?
this video helped me get a good grade on my final. thanks man !
Brayan Santos Did it work without out USB
yeah it did, just make sure you use a higher voltage battery I used a 9v battery in my case
U r great thanks for this wonderful video I was searching for this video finally I got it's such a wonderful video better than any other video of the same kind thank you
çok eğitici bir video olmuş tebrik ederim.
The programming part is very difficult to understand.
Can you suggest this line follower with the help of XOD.
Can this robot only follow a continuous black line without any gap????
if there is a gap of white (5 cm) in the main black line of the track..then will this robot follow it?
can i use tcrt5000 sensor instead of qtr sensor and use the same code?
Thats a very detailed video. Thanks for the code and all too
what is the distance between the sensor and the surface????????
siyah zemin beyaz çizgi ayarı nasıl yaparız kodu inceledim bulamadım
made me make this project bro! great for giving the program thnx bro!
also sir about drone like robot controlled by android or voice detection sensor and ur explanation is superb sir and thanku sir
Seriously bro, AWESOME!!!!
Sketch uses 4056 bytes (12%) of program storage space. Maximum is 32256 bytes.
Global variables use 63 bytes (3%) of dynamic memory, leaving 1985 bytes for local variables. Maximum is 2048 bytes.
please put the code
From where i will get qtr -8 rc reflectance sensor please, suggest
I have gone to all places in my hometown patna , but i don't found this sensor
i am unable to get qtr 8 rc sensor instead i am using normal ir sensor that has only 3 pins GND, VCC can you please tell me how to use it please
priyavrat tripathi same as a0 to a5 and combine all gnd and vCc and used
Thank you so much! a blessing for me!
What you have put at last a yellow box like thing? At 8:15 in video.
Those are DC Motors.
what's making the car turn?
Phenomenal actually. Would appreciate if you could explain the coding behind the PD.
Oh I know what you mean. Just trying to learn the concept of PID. it will most probably help.:D
Thank you very much for your work
which batteries are best for this project?
sir , Do i need to install another library if I use L298N motor driver(the red colored one)?please could u answer as soon as possible with specified reasons.
If I do not have a on off switch will it still work if i just plug it up to the battery after uploading the code successfully? or do i have to have a switch, i followed this tutorial and it is not working for me.
How are you using the QTR-8RC board which has digital output and have the robot working when you wire the sensors to the analog inputs????????
MERT KILIC I AM YOUR FANNNN
👏👏👏👏
hello, will this line follower robot work when I use 4 wheels instead of 2 wheels? and if I have 4 wheels, do I need two qtr 8rc sensors? I hope not, because I only bought one and I don't have any time to buy another....please give me a respond, thank you!
hey, I've download the library from your referred link but it can't be included on my sketch (it doesnt even shown up on my library list). I've tried to add it manually but it says I have invalid library. could anyone help me please? :)
Please answer this!
Why is your error declared as position- 2000? Then for any position of the line the error would be same.
It should be something like - goal- position isn't it?
Awesome work bro
If i want that the sensor detect the line as white and the parts outside the line as black, what did i need to change, please help me, it´s important :/
hi i just need a little help...can i use any other IR sensor array instead of the polulu sensor... because its very expensive here....thanks
Can you please suggest me the changes in the code if I use an IR sensor array similar to that of QTR 8RC sensor but not the exact one shown in the video.
If we attach 4 motors there will be different codes or not?
Thanku tomorrow is my practicle
I have qrt 8a (not 8rc) can i use this
can i use IR sensors instead ? of course i'm not gonna use the Pololu QTR Sensor Library (unless it is compatible with IR sensors)
could you give a link where i can understand , the reflectance sensor . Coz i am curios why do we need array of 5 sensors why not 1 or 2 sufficient ?
What changes in the code should i make to make my bot follow white line over black background?
Pretty cool! I have a question though, do you know of a way that you can use this code and then have the robot stop when it reaches a solid black line?? I am working on a project now that this would be helpful for and I'm not so good at coding and figuring this stuff out.
what does your code look like? I have never done arduino coding but I have a line follower array and the ardumoto kit but i dont know how to code in arduino language
Sir, have you used separate code for the PID control during the coding of arduino UNO
what changes are required in code n circuit... if i m using array of sensors instead of QTR reflectance sensor...??
How can I make the robot follow a white line on a black surface? Could you please show me how to tweak the code?
can ya help me with the wiring using a normal infrared line following sensor with the same board
We have a 12v Dc motor ,5v motor shield and 9v battery supply,How can we configure our robot from that ? or we have to use dc step up module and change the motor shield to 12v?? Coz we have to move robot to a inclined surface!
Quick question isn't powering the arduino with 9v bad because it is being powered by 5v?
kaynak kodlarda ki kp ve kd değerleri doğru mu? bana yüksek gibi gözüktü;....motor hızı en fazla 255 olabiliyorken;hesaplamalarda 4 haneli sayılar hatta 5 haneli sayılar çıkıyor...
Superb , unique method
But ,Is it edited video❓ or it's original speed of line follower
tres bon projet et bien fait
Will the code still work if I plug the reflective sensor directly to the arduino board?
the link which one you leave it here its does not working plzzz you also see the code sourse website
Can we replace the motor shield with motor driver
Hi..I need a small favour..I have constructed the model and verified the code but I want to know how do I upload the code to the arduino.. according to ua video the code and the arduino are not physically connected..Please help asap
great video.. i have a question, does it need 2 dc motor or can i only use 1 motor? and also can i use different chassis (eg RC chassis)
kaynak kodlarda ki kp ve kd değerleri doğru mu? bana yüksek gibi gözüktü;....motor hızı en fazla 255 olabiliyorken;hesaplamalarda 4 haneli sayılar hatta 5 haneli sayılar çıkıyor...
Ben 0,01 gibi değerle denemeyi düşünüyorum ayrıca tam 90 derecelik virajlar da robot dönüşleri yapabiliyor mu? çünkü sensörlerden gelen bilgi tam olarak doğru olmadığından robot kavrayabiliyor mu?
Quick question, how did you add the lights? I subbed btw....Amazing vids.:)😀
hi ! I appreciate very much your video, it is one of the most precise that I could find, I have the sensor but I do not know where I have to put the resistance provided with? thanks a lot for your help :)
where did u get the qtr 8rc reflectance sensor
Only one motor is working for me ,can u make a video on possible corrections
Same problem here, did you find a solution? :(
@@anaeliv4105 Did find any solution
Harika video emeğine sağlık! Peki aracın daha hızlı gitmesini ve aynı zamanda daha hızlı tepki vermesini nasıl sağlarız?
Can we use normal l293D motor shield , instead of adafruit motor shield ?? please guide.
is there any other sensor I can use for the robot I can't find the given sensor
here is the sensor: www.pololu.com/product/961
does it necessarily require QTR-8RC sensor, or any other 8 array sensor will do?
Hi! I really like your guide and I have a question. If I were to use 4 DC Motors would a single 9V battery be sufficient enough to power the robot?
Thank you!
Kodlama da bir hata yok dimi. Videonuza göre herşeyi yaptık ama düz gidiyor ama çizgide gitmiyor.birde video son kısımlarında linefollowerRobbot diye bir kısmı açıyorsunuz. Tıkladığınızda kodlar çıkıyor o kısmı anlamıyorum.zaten kodu kopyalayıp yapıştırmıştık. Yardımcı olursanız sevinirim.
is the line follower this much fast or you have forwarded the video?
Can you build a trash can which moves only when we throw(cast) a garbage next to her?
Can i use L298?
sir i want to use gyroscope instead of castor wheel please tell me the changes i have to make
merhaba mert bende çizgi izleyen robot yapmaya çalışıyorum ve senin kullandığın QTR-8RC çizgi takip sensörünü kullanacağım fakat sensörü doğru çalıştıramıyorum sanırım sürekli 0 değeri veriyor.
bana code kısmı için gerekli bilgiyi verebilir misin rica etsem:)
Plz tell me
How to use
IR sensor
Instead of QBR sensor
can I use QTR-8A instead of QTR-8RC???
hocam merhaba bunun aynısını yaptım fayans uzerıne siyah elektrık bandı cektım takıp etmedı a4lerle platform yaptım olmadı sureklı çizgi arıyor qtr 8rc beyazı gorunce 2 motor calısıyor acaba beyaz rengi mi takıp edıyor nasıl anlarım.bırde baslamadan önce kalibre ediyorum siyah beyaz cızgıde hareket ettırıyorum ama sureklı sıyah cıgının dısında duruyor çizgiyi arıyor burdakı bağlantıların aynısıı yaptım lütfen yardımcı olur musunuz?
Can you tell me what should i do if i have only sensors
PLZ reply as soon as possible
hi,do you need to calibrate the sensor first?
will it work if the background is black and the line is white?
You have to reverse the values for sensor output. Basicly if it picked up white as smaller number but dark as larger u have to turn them around so that its white - large and black - small. I didn't watch the code part so i don't know whats the case here but thats the general idea,
Actually, the QTR library accounts for this, you just need to provide a 'true' as the third argument in readLine(). So your readLine would look something like this:
readLine(sensorValues, QTR_EMITTERS_ON, true);
And now readLine above will read a white line on a dark background.
From the Pololu library documentation see the function definition below:
unsigned int readLine(unsigned int *sensorValues, unsigned char readMode = QTR_EMITTERS_ON, unsigned char whiteLine = 0)
Hi my friend I wanted to ask you when did you by this sensor I need one but I don't have time . Do you sell it I'm from Macedoina
How we can add intermediate stations or intermediate stops in between track
Wow amazing🤩
What would be the maximum angle to get this buggy up a slope
I wanted to know if you have used PID in the line follower?
I m struggling to find Best ir sensor array....plz suggest
please if anyone can tell, i have uploaded the code but only one motor starts while the other is not starting.
Ikram Kakar ther voltage drop or less voltage to ur motor increase voltage 9 to 12
I do not HV QTR sensor... I HV other sensor array.. will it work?
Which one is the callineration button
where do I get the qtr-8rc reflectance sensor.. I mean where can I buy them
can it enable to find the gap and crosses...? please reply fast
Can I Increase the speed of the motor ? Will the LFR then still work fine?
Bro..what..type..follower.. Ur..using.. Ex: right edge or left edge or black line??
Can the robot follow a line of 1/2 inch width black line?