You are on page 1of 22

1

[Pick the date]

THE UNIVERSITY OF BURDWAN

UNIVERSITY INSITUTE OF TECHNOLOGY

LINE FOLLOWER ROBOT

Presented by:

SHAMAIL AHMAD

UNIVERSITY INSITUTE OF TECHNOLOGY THE UNIVERSITY OF BURDWAN

LINE FOLLOWER ROBOT | SHAMAIL AHMAD 1

INTRODUCTION:
The line follower is a self operating robot that detects and follows a line that is drawn on the floor. The path consists of a black line on a white surface (or vice versa). The control system used must sense a line and maneuver the robot to stay on course, while constantly correcting the wrong moves using feedback mechanism, thus forming a simple yet effective closed loop System. The robot is designed to follow very tight curves. Practical applications of a line follower: Automated cars running on roads, guidance system for industrial robots moving on shop floor etc.

SAMPLE PATH:
The path is a black line on a white background with width of 2 cm (except at bends where a little variation may be present).

Robot

Track

BASIC REQUIREMENTS:
The robot has been built using the following components Microcontroller IC-AT 89C52 (24PI) Motor Driver IC-L 293DNE Quad OP-AMP IC- LM 324N Sensor-IR LED & IR PHOTODIODE Voltage Regulator- IC-L7805CV, UA7812C Power Supply-Ni-Cd battery ( 10x1.36V=13.6V) Motor-12V (2) Indicators-LEDs Crystal Osillator-11.0592MHz Musical IC UM-66 19L, Transistor BC 548, Buzzer Resistances, Capacitors, Diodes Varo Board, Switches, IC base, Connectors, Wires, etc. Chassis, Wheel, Free Wheel In addition we have used ARE-LAB microcontroller burner to burn the hex code to the microcontroller and KEIL u vision3 simulator software to generating the hex code from assembly language and Tina8 circuit simulator software to design and testing of circuit.

BASIC OPERATION:
It has infrared sensors on the bottom for detecting black tracking tape. Line position is captured with the help of these optical sensors ( IR LED & IR photodiode pair) mounted at the front end of the robot. when the sensor detect the black surface, output of the comparator, LM324 is low, while for white surface the output is high. It is sent as input to the microcontroller for accurate control and steering of motors. Microcontroller AT89C52 and motor driver L293D are used to drive the motors.

INPUT SYSTEM

PROCESSING SYSTEM

OUTPUT SYSTEM

S E N S O R

COMPARATOR

C O N T R O L L E R

D R I V E R

MOTOR

MOTOR

BLOCK DIAGRAM

INPUT SYSTEM Sensors:


The sensor consists of pair of IR LEDs and IR Photodiodes. If white surface is present beneath the IR LED, rays are reflected and are sensed by the receiver, while in case the black surface, the light gets absorbed and hence receiver does not sense IR rays.

White surface reflects light and black surface absorb it.

We have used IR LEDs and IR Photodiode which has following characteristics.

IR LED

IR Photodide

Size= 5mm Forward Current=20 mA Power dissipation =30mW

Size=5mm Reverse Current=50nA(dark), 50uA(light) Power dissipation=100mW

Photo has a property that if IR light falls on it its electrical resistance decreases (from say 150k to 10k).For sensing the change in resistance we use voltage divider circuit. Thus we get the variation in voltage, which is sensed by the comparator IC LM324.The comparator then gives logical high or low according to input.

Comparator:
Comparator is a device which compare two input voltages and gives output as high or low. In a circuit diagram it is normally represented by a triangle having inverting (-ve input),non inverting(+ input) ,Vcc, Ground, output.

Properties of comparator:

If V+ > V then Vo=Vcc


(Digital High 1 output) If V+ < V then Vo=0 (Digital Low 0 output)

We have used IC LM 342N as comparator. I has quad operational amplifiers.


Charecteristics:

Supply voltage : 16 or 32 V Power dissipation: 500mW

Use of comparator in IR sensor The two inputs of comparator are use to compare the voltages of photodiode at dark or light condition .One input is from photodiode and other is generated by using potentiometer(preset). The second voltage is also called as reference voltage for that sensor.

Calculations:
Transmitter: V=1.2v, I=12mA, so R= (5-1.2)/12=316; Taken R=330 Receiver: V=2.5v, I=200uA, so R=(5-2.5)/200=12.5K: Taken R=10K Tested Value of IR photodiode: Vp(dark)=4.68v, Vp(light)=2.5v [measured] So the reference voltage Vref=Vp(dark)+Vp(light)/2=(4.67+2.5)/2=3.58v So, Rref=(5-3.58)/100uA=14.2K ; Taken Rref=20K (0-20K preset)

Arrangement of sensors
We have arranged sensors in a straight row pattern which is bolted under the front of the robot. It is used to locate the position of the line below the robot. We have used four sensor but we can use any number of sensors. If we have lesser number of sensors then the robot movement will not be smooth and it may face problems at sharp turns. If we use higher number of sensors robot movement will become smooth and reliable for sharp turn. Thus we must choose optimum number of sensors. The distance between sensors depends on 1. 2. 3. Number of sensors used Width of straight line. Distance between sensors cannot be constant (it depends on the logic).

PROCESSING SYSTEM:
Processing system acts as the Brain of the robot, which generates desired output for corresponding inputs. For that we use microcontrollers. We have used AT89C52-24PI microcontroller of Atmel in our robot. It is 8-bit microcontroller with 8K bytes flash.

Program Memory Size=8KB RAM Size=256B Voltage - Supply (Vcc/Vdd)=4 V ~ 6 V Output Current=15mA I/O=32 (4 ports) Clock speed=24 MHz( used 11.0592 MHz) Access time=24us

Basic hardware connections of AT 89C52:


Pin 40 (Vcc): It is used to provide +5V to the microcontroller. Pin20 (Ground): It is used to provide Ground to the microcontroller. Pin 9 (Reset): The use of reset pin is to reset the microcontroller. After getting a positive pulse at reset the PC of microcontroller jumps to the initial position (0000H) of program. Pin 18-19 (Clock): This pin is used to provide proper clock pulse to the microcontroller. We have used 11.0592 MHz crystal oscillator for this purpose. Pin31(EA/Vpp): As we have not accessed any external device (memory) we have given a logical 1 to this port. Port0: With the use of pulled up resistors (10K) the port0 of microcontroller can be used for both I/O operation. We have used the P0.0, P0.1, P0.2 and P0.3 of Port0 to receive the data from sensor. Port3: We have used this port to provide proper control pulse to the motor driver L293D to drive the motors according to the sensor status. Port1: We have used the P1.1 of this port to start the operation of program by pressing a momentary switch. The LED connected at P1.0 glows and the music connected at P1.2 starts playing simultaneously as soon as we press the switch. Since the delay of 5 seconds has been given in the program so the robot starts 5 seconds after pressing the switch. The moment the robot starts running the music stops playing. The output 15mA and 5V at port3 is not sufficient to drive the motor ( 100x2 mA and 12V) so we have used motor driver IC L293D to drive the motors.

OUTPUT SYSTEM:
We have used the motor driver IC L293DNE to drive the two motors in both directions.

L 293D INL1 OUTL1


L E F T M O T O R R I G H T M O T O R

INR2 OUTR2

OUTL2 INL2

OUTR1 INR1

Vss=+5V Vs=+36V (taken +12v) Iout=1.2A (DNE version)

There are separate four drivers in this IC which can drive four separate motors in one direction or two motors in both the directions.

One channel can control one motor. Enable pin should be high for activating the corresponding channel. Input 1 corresponds to Output 1. If Enable pin low, the output will always be 0. If it is high output depends
on input.

L 293D
ENL

+5V

INL1 OUTL1

INR2

OUTR2

+ ML -

+ MR -

OUTL2 INL2

OUTR1 INR 1 ENR

+12V

Supply voltage (Vss) is the Voltage at which we wish to drive the motor.
Generally we prefer 6V for dc motor and 6 to 12V for gear motor, depending upon the rating of the motor. Logical Supply Voltage will decide what value of input voltage should be considered as high or low .So if we set Logical Supply Voltage equal to +5V,then -0.3V to 1.5V will be considered as Input Low Voltage and 2.3 V to 5V will be considered as Input High Voltage. L293D has 2 Channels .One channel is used for one motor. Left Channel - Pin 1 to 8 Right Channel - Pin 9 to 16

Enable Pin is used to enable or to make a channel active. Enable pin is


also called as Chip Inhibit Pin. All Inputs (Pin No. 2, 7,10and 15) to L293D IC are the respective outputs from microcontroller All Outputs (Pin No. 3, 6,11and 14) of L293D IC goes to the inputs of Left and Right motors. MOTOR DRIVE LOGIC:
ENL INL1 INL2 ENR INR1 INR2 0L1 0L2 0R1 0R2

ML MR MOVE
Forward

1 0 1 1 1 1

1 X 1 0 1 0

0 X 0 1 0 1

1 1 0 1 1 1

1 1 X 1 0 0

0 0 X 0 1 1

1 0 1 0 1 0

0 0 0 1 0 1

1 1 0 1 0 0

0 0 0 0 1 1

Left
Right Sharp_Left Sharp_Right Reverse

We have developed the following logic corresponding to various


condition of sensor on track.

INPUT (SENSOR) TO OUTPUT (MOTOR) LOGIC: SENSOR STATE SEN1 SEN2 SEN3 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 0 0 1 1 1 SEN4 0 1 0 1 1 1 0 1 1 ROBOT MOVE FORWARD FORWARD LEFT LEFT RIGHT RIGHT SHARP LEFT SHARP RIGHT REVERSE

Robot on track:
By using the two motors we drive the robot in any direction.

CONDITION FOR TURN

TRACK

FRONT FREE WHEEL

1 1

SENSORS

WHEEL

Motors:
We have used two 12V, 100mA DC gear motor to drive the robot. DC motors are most easy to control. One motor requires only two signals for its operations. If we want to change its direction just reverse the polarity of the power supply across it. We can vary the speed by varying the voltage across the motor. The gears used to increase the torque of the DC motor on the expense of it speed.

Mathematical interpretation:

The Rotational Power (Pr) of motor is given byPr= Torque(T) * Rotational Speed(w) Thus, T=Pr/w Since the Pr is constant for DC motors with constant input electrical power.So, T 1/w Thus to increase the value of torque we have to sacrifice speed.

POWER SUPPLY SECTION:


Voltage Regulator 7805 & 7812: Voltage regulator converts fixed DC output voltage from variable DC. We have used L 7805CV and UA 7812C for two different regulated power supply voltage of +5V (for circuit) and +12V (for motors).

7805 Output Voltage=+5V (4.8-5.2V) Output Current=Internally limited Input Voltage=+35V (maximum)

7812 Output Voltage=+12V Output Current=1.5A Input Voltage=+40V (maximum)

IN 4007

7812

+12V 7805

I/P

1k

+5V

LED

.1uf 10u f .1uf

We have used 13.6V (10x1.36 v) Ni-Cd battery for power supply.

MUSIC:
We have used melody generator IC UM-66 to generate melody for 5 seconds
FEATURES
*64-Note Rom memory *1.5V ~ 4.5V power supply *60uA current required. *Dynamic speaker can be driven with external NPN transistor *Power on reset: melody begins from the first note

+5V

I/P (FROM P1.2 OF MICROCONTROLLER)

UM66 2 10K 1

3 BC548 1K

SOFTWARE:
Based on the above developed logic we have written the following program in assembly language. We have used notepad of windows OS to edit the program.

ENL EQU P3.0 ENR EQU P3.3 INL1 EQU P3.1 INL2 EQU P3.2 INR1 EQU P3.4 EQU P3.5 ORG 0000H SETB P1.1 CLR P1.2 SJMP MAIN ORG 0030H MAIN: CLR P1.0 CLR P1.1 HERE: JNB P1.1, HERE SETB P1.0 SETB P1.2 CLR P1.1 ACALL WAIT CLR P1.2 SJMP START ORG 0080H START: MOV P0,#0FFH MOV A,P0 ANL A,#0FH SUBB A,#00H JZ FORWARD MOV A,P0 ANL A,#0FH SUBB A,#01H JZ SHARP_LEFT MOV A,P0 ANL A,#0FH SUBB A,#03H JZ LEFT

MOV A,P0 ANL A,#0FH SUBB A,#08H JZ SHARP_RIGHT MOV A,P0 ANL A,#0FH SUBB A,#09H JZ FORWARD MOV A,P0 ANL A,#0FH SUBB A,#0BH JZ LEFT MOV A,P0 ANL A,#0FH SUBB A,#0CH JZ RIGHT MOV A,P0 ANL A,#0FH SUBB A,#0DH JZ RIGHT MOV A,P0 ANL A,#0FH SUBB A,#0FH JZ REVERSE LJMP START

FORWARD: ACALL DELAY SETB ENL SETB ENR SETB INL1 CLR INL2 SETB INR1 CLR INR2 LJMP START

RIGHT: ACALL DELAY CLR ENR SETB ENL SETB INL1 CLR INL2 LJMP START

LEFT: ACALL DELAY CLR ENL SETB ENR SETB INR1 CLR INR2 LJMP START

SHARP_RIGHT: ACALL DELAY SETB ENL SETB ENR SETB INL1 CLR INL2 CLR INR1 SETB INR2 LJMP START SHAPR_LEFT: ACALL DELAY SETB ENL SETB ENR CLR INL1 SETB INL2 SETB INR1 CLR INR2 REVERSE: ACALL DELAY SETB ENL SETB ENR SETB INL2 CLR INL1 SETB INR2 CLR INR1 LJMP START WAIT: MOV R7,#0FFH MOV R6,#0FFH MOV R5,#00FH LOOP5S: DJNZ R7,LOOP5S MOV R7,#0FFH DJNZ R6,LOOP5S MOV R6,#0FFH DJNZ R5,LOOP5S RET DELAY: MOV R3,#0FFH MOV R4,#006H LOOP: DJNZ R3,LOOP MOV R3,#0FFH DJNZ R4,LOOP RET

END

SIMULATION:
We have used the KEIL u vision3 simulator software for simulating and generating the hex code to load into the microcontroller.

BURNER
We have used the ARE-LAB Atmel microcontroller burner to burn the hex code into the microcontroller.

CONCLUSION:
The robot that we have designed are working properly. We have also calculated its speed. It is near about 8 Km/hr. It consumes around 4 watt of power.

APPLICATIONS:
1. It can be used in industries to carry raw materials and goods. 2. It can be used in those places where the life of a human being are in danger. 3. It can be automatic metro railways. 4. It can be used as an entertaining element (toy) by small child. 5. Since it the basic level of robot it will help us to develop an advanced stage of robot. Also it will help us to understand the basic concept of electronics and microcontroller.

FURTHER IMPROVEMENTS:
A number of improvements can be easily done by increasing the number of sensors. 1. 2. 3. 4. The movement will become more smooth. It will also be able to detect the obstacles that comes in its path. At sharp turn it will not face any problem. Even on thin track it will run smoothly.

On the other hand some mechanical improvement can be done to lift


the goods using some heavy steeper motors.

REFERENCES:

1. The 8051 Microcontroller and Embedded systems book by MA MAZIDI, JG MAZIDI, RD MCKINLAY. Electronics for you magazine. 3.Websites:

www.wikipedia.org www.robotroom.com www.kmitl.ac.th www.ieeerobotics.wikidot.com www.educypedia.be www.elecrom.wordpress.com www.scribd.com

4.Data sheets of various components like AT89C52, L293D, LM324,UM66, BC 548, IR LED ,IR PHOTODIODE, 7805, 7812 etc.

PRESENTED BY: Feel free to contact:


SHAMAIL AHMAD Electronic Engineer Rollc For Trading Limited Riyadh, KSA EMAIL: s.kawish@gmail.com
Facebook : www.facebook.com/shamail.kawish

You might also like