1. Tutorial-3 Line follower
LINE FOLLOWER:
Now let’s take up a bit complex code - A line follower code.
line follower is a robot which follows a line irrespective of curves the line may have.
Hardware in a line follower:
1. Two motors which constitutes a differential drive
2. Two T-sop sensors.
3. A micro-controller
4. A Moto driver - L293D
Differential drive:
The above figure explains the arrangement of motors in a differential drive. If both
motors are switched on robot advances forward. If only left motor is switched on it
turns right. Similarly if right only is switched on it turns left.
T-sop:
A T-sop sensor is a simple light sensor which is used in obstacle detection. It produces
a logic high if a reflector comes in its way .By this logic it has a capacity of
differentiating black and white. As black is a bad reflector it produces logic 0 with
black and logic 1 with white.
L293D Moto driver:
L293D is an IC which is used to drive Motors by means of a micro-controller. One
L293D can drive 2 motors. Download L293D data sheet from the following link and
open it.
http://www.ziddu.com/download/10818091/l293ddatasheet.pdf.html.
2. This diagram shows u connections to an L293D IC .It
Can control two motors by 4 micro-controller lines. Pin’s 4 and 5 for Motor A and pins
6 and 7 for motor B as shown in the above figure. The supply voltage to the motor
Should be given at VCC pins.
How line follower works:
A line follower has a very simple structure. Two wheels attached to the two motors
And a t-sop in front of each wheel facing the ground .Take we has a black line on white
background. For the bot to get away from the line a T-sop has to cross the black
line.Take that The black line took a left turn .So, now our bot too has to take a turn
towards left. For turning left , left wheel should stop and right wheel should run .As the
path is turning towards left and bot is going straight initially at an instant left T-sop .will face the black
surface. So logic of left t-sop shifts from 1 - 0 suddenly. This logic shift will stop the motor on left which
make bot to take a turn towards left this logic is followed throughout the path .
Now we will write a code to instruct the motors to switch off and on whenever t-sops logic