Line Follower Robot using Arduino By Saddam 12 Comments
Line follower Robot is a machine which follows a line, either a black line or white line. Basically there are two types of line follower robots: one is b lack line follower which follows black line and second is white line follower which follows white line. Line follower actually senses the line and run oer it.
Concepts of Line Follower Concept of workin! of line follower is related to li!ht. "e use here the behaiour of li!ht at black and white surface. "hen li!ht fall on a white surface it is almost full reflected and in case of black surface li!ht is completely absorbed. #his behaiour of li!ht is used in building a line follower robot .
$n this arduino based line follower robot we hae used $R #ransmitters and $R receiers also called photo diodes. #hey are used for sendin! and receiin! li!ht. $R transmits infrared li!hts. "hen infrared rays falls on white surface, it%s reflected back and catched by photodiodes which !enerates some olta!e chan!es. "hen $R li!ht falls on a black surface, li!ht is absorb by the black surface and no rays are reflected back, thus photo diode does not receie any li!ht or rays. &ere in this line follower robot when sensor senses white surface then arduino !ets 1 as input and when senses black line arduino !ets ' as input.
Circuit Explanation #he whole line follower robot can be diided into ( sections: sensor section, control section and drier section.
Sensor section:
#his section contains $R diodes, potentiometer, Comparator )*p+mp- and L/%s. 0otentiometer is used for settin! reference olta!e at comparator%s one terminal and $R sensors are used to sense the line and proide a chan!e in olta!e at comparator%s second terminal. #hen comparator compares both olta!es and !enerates a di!ital si!nal at output. &ere in this line follower circuit we hae used two comparator for two sensors. L (3 is used as comparator. L(3 has inbuilt two low noise *p+amps.
Control Section:
rduino 0ro ini is used for controllin! whole the p rocess of line follower robot. #he outputs of comparators are connected to di!ital pin number 2 and ( of arduino. rduino read these si!nals and send commands to drier circuit to drie line follower.
Driver section:
/rier section consists motor drier and two /C motors. otor drier is used for driin! motors because arduino does not supply enou!h olta!e and current to motor. So we add a motor drier circuit to !et enou!h olta!e and current for motor. rduino sends commands to this motor drier and then it drie motors.
Working of Line Follower Robot using Arduino "orkin! of line follower is ery interestin!. Line follower robot senses black line by usin! sensor and then sends the si!nal to arduino. #hen arduino dries the motor accordin! to sensors4 output.
&ere in this pro5ect we are usin! two $R sensor modules namely left sensor and ri!ht sensor. "hen both left and ri!ht sensor senses white then robot moe forward.
$f left sensor comes on black line then robot turn left side.
$f ri!ht sensor sense black line then robot turn ri!ht side u ntil both sensor comes at white surface. "hen white surface comes robot starts moin! on forward a!ain.
$f both sensors comes on black line, robot stops.
Circuit Diagra
Complete circuit dia!ram for arduino based line follower robot is shown in the aboe iam!e. s you can see output of comparators is directly connected to arduino di!ital pin number 2 and (. nd motor drier%s input pin 2, 6, 1' and 1 is connected to arduino4s di!ital pin number 7, , 8 and 6 respectiely. nd one motor is connected at output pin of motor drier ( and 8 and another motor is connected at pin 11 and 17.
!rogra Explanation
$n pro!ram, first of all we defined input and output pin, and then in loop we checks inputs and sends output accordin! to inputs to output pin for driin! motor. 9or checkin! input pin we used if; statements.
#here are four conditions in this line followin! robot that we read by usin! arduino. "e hae used two sensor namely left sensor and ri!ht sensor.
"nput
#utput $oveent Left $otor
Left Sensor Rig%t Sensor
Rig%t $otor
#f Robot
LS
RS
L1
L2
R1
R2
'
'
'
'
'
'
Stop
'
1
1
'
'
'
#urn Ri!ht
1
'
'
'
1
'
#urn Left
1
1
1
'
1
'
9orward
"e write pro!ram accordin! to the conditions shown in table aboe.
Re&uired Coponents Arduino
$n our 0ro5ect we hae used a microcontroller to control whole the process of system that is R/<$=*. rduino is an open source hardware and ery useful for pro5ect deelop ments. #here are many types of arduino like rduino <=*, arduino me!a, arduino pro mini, Lilypad etc. aailable in the market. &ere we hae used arduino pro mini in this pro5ect as arduino pro mini is small and so breadboard compatible. #o burn pro!ram we hae used 9#/$ burne r.
L'()D $otor Driver
L2>(/ is a motor drier $C which has two channels for driin! two motors. L2>(/ has two inbuilt #ransistor /arlin!ton pair for current amplification and a separate power supply pin for !iin! e?ternal supply to motors.
"R $odule:
$R odule is sensor circuit which consists $R L/@photodiode pair, potentiometer, L(3, resistors and L/. $R sensor transmits $nfrared li!ht and photo diode receies the infrared li!ht.
!ower Suppl*
$ hae added a olta!e re!ulator to !et olt for arduino, comparator and motor drier. nd a > olt battery is used to power the circuit. Code: @A++++++ 0ro!ram for Line 9ollower Robot usin! rduino+++++ A@ @A+++++++definnin! $nputs++++++A@ define LS 2 @@ left sensor define RS ( @@ ri!ht sensor @A+++++++definnin! *utputs++++++A@ define L1 7 @@ left motor define L2 @@ left motor define R1 8 @@ ri!ht motor define R2 6 @@ ri!ht motor oid setup) pinode)LS, $=0<#-D pinode)RS, $=0<#-D pinode)L1, *<#0<#-D pinode)L2, *<#0<#-D pinode)R1, *<#0<#-D pinode)R2, *<#0<#-D E oid loop) if)di!italRead)LS- FF di!italRead)RS- di!ital"rite)L1, &$G&-D di!ital"rite)L2, L*"-D di!ital"rite)R1, &$G&-D di!ital"rite)R2, L*"-D E
@@ oe 9orward
if)H)di!italRead)LS-- FF di!italRead)RS- di!ital"rite)L1, L*"-D di!ital"rite)L2, L*"-D di!ital"rite)R1, &$G&-D di!ital"rite)R2, L*"-D E
@@ #urn ri!ht
if)di!italRead)LS- FF H)di!italRead)RS--
@@ turn left
di!ital"rite)L1, &$G&-D di!ital"rite)L2, L*"-D di!ital"rite)R1, L*"-D di!ital"rite)R2, L*"-D E if)H)di!italRead)LS-- FF H)di!italRead)RS-- di!ital"rite)L1, L*"-D di!ital"rite)L2, L*"-D di!ital"rite)R1, L*"-D di!ital"rite)R2, L*"-D E E
@@ stop