Sunteți pe pagina 1din 15

LINE FOLLOWER ROBOT

A line following robot is a self operating robot which follows a path (black line on white floor or vice versa).The task is to sense the line and remain on the desired path. The robot is designed to follow tight curves. Here are some samples of path that a line follower needs to follow. Width of path can vary from 3cm to 5cm.There can be some lateral displacement too.

These are very simple paths to follow and in most of the competitions the task can be a bit tedious.

BASIC DESIGN AND REQUIREMENTS


The robot is build using ATMEL microcontrolloer(AT89C51),IR sensors,LM324 IC,two motors(dc motors with or without gears),motor driver(L293D IC),mounted on chassi(toy car or aluminium sheets).Sensors are placed facing downward towards the path.

Basic operation:
1.capture the line position with the help of of IR sensors. 2.Decide the logic;what to do(move straight,left or right) with the code contained by the microcontroller 3.Steer the robot to the track.For this we use two motors to govern the movement of the wheels.

Block diagram:
M1

COMPARATOR

MICROCONTROLLOER AT89C51

MOTOR DRIVER L293D

SENSORS
IC LM 324

M2

The above mentioned block diagram shows the basic design of line follower. The sensors and comparator comprises input system, microcontroller is the processing system and motor driver and motors form the output system of robot. Now lets see the details of the systems

INPUT SYSTEM Sensors


Each opto coupler(the sensor that we are using) has one emitter (IR LED) and a receiver (photo transistor or photo diode). If white space is present beneath the IR LED then IR rays are reflected and they are sensed by the receiver, while in case of black surface all of

the IR rays are absorbed by the surface and nothing is sensed by the receiver. Photo diode has a property that its electric resistance decreases when IR rays fall on it. Hence in case of white surface the electric resistance of the receiver is less than the case of black surface. The circuit used for sensors is:

R1=300 and R2=10K The +ve power supply is 5V. Let Vp is the output voltage to comparator.

*When there is black line then no IR light is sensed by the receiver and its resistance is high. So the output voltage Vp is also high (approx 4.68V). *When there is white line then IR rays are sensed by the receiver and its resistance decreases hence output voltage also decreases (approx 2.5V). *The reference voltage is set as the mean of the output voltage(Vp) at the time of black line and the white line. Vref =(4.68+2.5)/2=3.59V

Comparator:
Comparator is a device which compares two input voltages and gives output as high or low. In a circuit diagram it is shown as a triangle having two inputs(+ve and ve) and a output. +ve or non inverting input is given reference voltage in this case. -ve or inverting input is provided with the output of the sensors. *Incase of white path Vref is greater than the other input, So, the output of comparator is high. While in case of black line Vref is less than the other input. So the output of the comparator is low. We use LM324 IC for the comparator:

There are four comparators in this IC.So it can support upto four sensors.

Arrangement of sensors
Any number of sensors can be used while making line follower. A simple line follower can be made with just two sensors. If we use more sensors(say more than 4),the programming becomes complex and the hardware requirements are more. Using more number of sensors accurately increases the accuracy. Different arrangements for the placement of sensors can also be used .e.g we can use array of sensors,we can place the sensors in V shape or we can have sensors placed at the corners of a rhobus(diagonal).

Here lets take the simplest example of two sensors placed just outside the line(path is black on white surface).

Sensor 1

Sensor 2

Simple logic behind this arrangement is that the sensors are placed just outside the line. As soon as one of them detects black, then we can conclude that the robot is deviating from the path and we can correct its move.

Tips for the input system


PCBs are used for the circuit. Breadboard is not preferable because it has loose connections (breadboard is just used for the module testing). Proper orientation of IR LEDs should be done (there distance from the surface should not be more than 1.5cm).

The other two important components used in the line follower circuit are voltage regulator and the potentiometer.

Voltage regulator:
Voltage regulator fixed DC output voltage from a varying DC source. As the microcontroller and other IC require constant DC supply of 5V,So we use voltage regulator.

1
2

They help to maintain a steady voltage level despite various current demands and varying input voltages. There are three pins in the

voltage regulator. Middle one (pin no. 2) is grounded, pin no. 1 is given the input(7-12V) and we get the output(5V) from pin no. 3.

Potentiometer:
Potentiometer is the variable resistor which is used to vary the resistance by rotating the shaft. They are available in the range of 100 to 470K. Potentiometer is used as the voltage divider in the circuit.

POTENTIOMETER
Lead A is connected to V(5V) and lead B is connected to ground. Then we can vary voltage from 0V to 5V and the output is taken from the lead W. Potentiometer is used to generate reference voltage for LM324 IC.

PROCESSING SYSTEM
Processing system is the brain of the robot which generates desired output corresponding to the inputs. Microcontroller is the processing system of our line follower robot. Microcontroller are present in different forms such as 8051,AVR and PIC. Also a lot of companies also produce microcontroller. We are using ATMEL AT89C51, it is 8051 microcontroller.

Hardware details:
The basics of 8051 microcontroller are already discussed. Below is the connection diagram for 8051 microcontroller for the line follower robot. The connections are as follows: Pin no. 9,31 and 40 are connected to Vcc (5V). Pin no.20 is connected to ground. Pin no 18 and 19 are connected to oscillator. Pin no. 1 and 2 i.e. P1.0 and P1.1 are used for the output from the comparator corresponding to the two sensors. Pin no 21 to 26. i.e. P2.0 to P2.5 are used to connect the motor driver (Interfacing of motors and the motor driver is dealt in detail in a short while). P2.5=-ve of left motor P2.4=-ve of right motor P2.3=Enable for left motor P2.2=+ve of left motor P2.1=Enable for right motor P2.0=+ve of right motor

Software details:
The program code acts as the decision maker embedded in the microcontroller i.e. it decides what would be the output corresponding to each set of input. Programs can be written in assemble or C language. C language is easier to use. The program is compiler and simulated with the help of

software, KEIL C. KEIL C generates a hex file which is burned into microcontroller. Here is the code for our line follower having 2 sensors.

#include <reg51.h> void main(void) { P1=0xFF; P2=0x00; while(1) { if(P1^0==1 &&P1^1==1) P2=0x0F; else if(P1^0==0 &&P1^1==1) P2=0x0B; else if(P1^0==1 &&P1^1==0) P2=0x0E; } }

OUTPUT SYSTEM
The output system consists of the motors (DC geared or without gears) and a motor driver (L293D IC). For the line follower robot we have two DC motors attached with the wheels. Dc motors are most easy to control. A DC motor requires only two signals for its operation. To change its direction we just need to reverse the polarity of the battery. *DC geared motors are advantageous over the DC motors without gears because the torque provided by the geared motors is quite high as compared to the simple ones.

The use of two motors:


By using two motors we can move the robot in any direction. This steering mechanism of the robot is called differential drive. Lets check how it works. To rotate robot counterclockwise.(SHARP LEFT TURN)

Left wheel is reversed and the right wheel is forwarded To rotate robot counterclockwise.( LEFT TURN): Left wheel is stopped and the right wheel is forwarded To rotate robot clockwise.( RIGHT TURN):left wheel is forwarded and right wheel is stopped. To rotate robot clockwise.(SHARP RIGHT TURN):left wheel is forwarded and right wheel is reversed. To move straight: both motors forwarded.

Motor driver:
We cannot connect the motor directly to the microcontroller because microcontroller can not provide required current to drive DC motor. Motor driver is a current enhancing device; it is also used as switching device. Motor driver takes input from the microcontroller and generates the output signal for the motor. IC L293D is used as motor driver. L293D IC Its a 16 pin IC. This IC can drive two motors simultaneously.

Description of the IC: Pin no. 1 and 9 are ENABLE pins to make a channel active. Pin 1 to P2.3 Pin 9 to P2.1 Pin no 4,5,12 and 13 are connected to ground. Pin no. 16 is the logic supply voltage i.e. the voltage we need to provide to the motor. Pin no 8 is the supply voltage. Pin no 2,7,10 and 15 are input pins connected to the microcontroller. In our robot, Pin 2 to P2.2 Pin 7 to P2.5 Pin 15 to P2.0 Pin 10 to P2.4.

Here we have discussed the line following robots systems. After the module testing of all the systems is done, the circuit is assembled on a PCB; universal PCB can be used for this purpose. The placement of sensors and the code is path dependent. I.e. The path should be taken into consideration for the sensors and for writing the algorithm. This study material is just the starting and all of you need to explore the world of robotics on your own.

S-ar putea să vă placă și