Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |   Electronics Reference Design Library  |   AVR    |    PIC    |    8051    |    Electronic Projects

Line Follower Robot

Description

Contributor: 
Dishant Shah
Line follower is an autonomous robot which follows either black line in white are or white line in black area. Robot must be able to detect particular line and keep following it.
 
For special situations such as cross overs where robot can have more than one path which can be followed, predefined path must be followed by the robot.

 
In the following section, we will discuss the line follower robot which follows black line in white area and take right turn whenever cross overs or Y shaped turn arrives.
 
However with some minor suitable changes, users can make robot for other possibilities also.

 

Video

 
·         BLOCK DIAGRAM
Let us see how the line follower robot works. First see the block diagrams.
 
Line Follower Robot
 
·         EXPLANATION OF BLOCK DIAGRAM
An array of sensor is used to detect the line. Based on the status of sensors, special circuit or controller decides the position of line and also the required direction of motion required to follow the line. Motor driver circuit is used to ON/OFF the LEFT/RIGHT motors of the robot to provide desired motion.
 
·         SENSORS
Sensors are required to detect position of the line to be followed with respect to the robot’s position. Most widely used sensors for the line follower robot are PHOTOSENSERS. They are based on the basic observation that “the white surface reflects the light and the black surface absorbs it”.
 
Sensor circuit contains emitter, detector and comparator assembly.
 
·         PHOTOSENSORS
IR or VISIBLE light is emitted from the emitter (IR light is mostly preferred to avoid interference from the visible light which is generally around the robot. However IR light is also present in atmosphere but its intensity is much less than that of visible light, so IR light can give much reliable output. For better accuracy of the sensors, they must be covered properly for the isolation from the surrounding.)
 
This emitted light strikes the surface and gets reflected back. If the surface is white, more intensity of light gets reflected and for black surface very less intensity of light is reflected.
 
Photo detector is used to detect the intensity of light reflected. The corresponding analog voltage is induced based on the intensity of reflected light. This voltage is compared with the fixed reference voltage in comparator circuit and hence it is converted into logic 0 or logic 1 which can be used by the controller.
The comparator circuit may be designed in two ways.
 
Case-1
Black area=1
White area=0
 
Case-2
Black area=0
White area=1
 
In the following section, case-1 is used.
 
 
Sample circuit for the sensor is as shown in fig.
 
·         EMITTER CIRCUIT
 
 
EMITTER-CIRCUIT.jpg
 
·         OP-AMP PIN OUT
 

OP-AMP-PIN-OUT.jpg

·         PIN DESCRIPTION
Vcc is 5V power supply.
Input+ is non-inverting input terminal of an op-amp =V(+).
Input- is inverting input terminal of an op-amp=V(-).
Output is either logic1 or logic 0 depending upon both input terminals.
Output is Logic 1 if V(+) > V(-)
                Logic 0 if V(+) < V(-)
 
·         DETECTOR CIRCUIT
A= centre point of voltage divider circuit (always 2.5V)
B= Non-inverting terminal of OP-AMP
C= Inverting terminal of OP-AMP
D=Output terminal of OP-AMP
 
 
·         WORKING OF DETECTOR CIRCUIT
·         When light falls on detector D2, a voltage drop of around 0.7V occurs across D2 and hence 2.5V (voltage at A) – 0.9*V (drop across D2) = 1.6*V (voltage at C)
·         When light does not falls on detector D2, no current flows through it and hence voltage at C = Voltage at A =2.5V
 
*These values will be change with change in atmosphere, lighting conditions etc. We have to change variable resistor to get the desired output.
 
Now let us see various conditions as given in the table below.
 
Voltage at A
Voltage at B
Voltage at C
Voltage at D
output
2.5V
Less than 2*V
If light falls,(white area) 1.6*V
0V
Logic 0
2.5V
Less than 2*V
If light does not fall,(black area)
2.5V
Vcc=5V
Logic 1
2.5V
Greater than 2*V
If light falls,(white area) 1.6*V
Vcc=5V
Logic 1
2.5V
Greater than 2*V and less than 2.5V
If light does not fall,(black area)
2.5V
0V
Logic 0

 

 

 
If voltage at C is greater than 2.5V, the output will be always at logic 1. This condition must be avoided.
 
*These values will be change with change in atmosphere, lighting conditions etc. We have to adjust variable resistor to get the desired output.
 
·         LDR (LIGHT DEPENDENT RESISTOR)
 
It is a special type of resistor. Its resistance is dependent upon the intensity of light falling upon it.
 
It has wide range of resistance depending upon the intensity of light. Its resistance can vary from few ohms to some kilo-ohms or even more.
 
 
To use LDR, above circuits with the following modifications can be used.
1.      Use visible LED instead of IR emitter.
2.      Replace detector with LDR.
 

Circuit Diagram

Source Code

This Code is only visible to Registered users. Please Login/Register

 

Comments (34)

keep it up.  

keep it up.

 

simple but use full 

simple but use full

 

Thanks.

Thanks.

it is quit simple 

it is quit simple

 

it cannt be excuted 

it cannt be excuted

 

why can't it?

why can't it?

Check with connections...We

Check with connections...

We have tested it before uploading...

effective ^^

effective ^^

(y)

(y)

give full code plzzzzzzz 

give full code plzzzzzzz

 

which controller u hv used in

which controller u hv used in this project?

 

 

You are welcome :)

You are welcome :)

Its based on 8051

Its based on 8051 controller...!!
Program was tested on P89V51RD2BN.

Thanks for sharing this

Thanks for sharing this simple line follower robot project. It is very useful for me

You are welcome Madhavi :)

You are welcome Madhavi :)

wow its working and making

wow its working and making fast line follower

 

You are welcome :)Its fast

You are welcome :)

Its fast because its using less complex yet effective way of testing the sensors and providing output.

Hello Am new at this. I've

Hello Am new at this. I've made several circuits but I've never done programming. There's a CODE2 link given, what is that for? And if that is for programming can you tell me the software and hardware I should buy? And how to program it

i want code for avrstudio

i want code for avrstudio atmeg8

Hi,If you have worked on the

Hi,

If you have worked on the given code, you can easliy make the same for AVR also.

 

Actually programming in AVR is easier than 8051

thanks

thanks

You are welcome

You are welcome

ala code free ma al ne...! 

ala code free ma al ne...!

 

hiiii

hiiii

please i need help for line

please i need help for line following autonomous vehicle, how write the codes using 8051 microcontroller  

 

Hi, For basic understanding

Hi,

 

For basic understanding of software, refer the tutorials section. 

You will find very nice tutorials with videos..

 

Feel free to contact us on any query...

Hi, For understanding Keil,

Hi,

 

For understanding Keil, refer the tutorial section.

 

Working code of line follower robot is given in this article already.

could anyone send me the

could anyone send me the whole code I am using Atmega8 in my bot...It would be really helpful if someone send me the code.Please send me at ajay.dusa@gmail.com 

Hi, It will be nice if you

Hi,

 

It will be nice if you give a try and ask us if you are facing any issue.

We will help our best to solve it...

HELLO AM NEW I SHOULD GET 2

HELLO AM NEW I SHOULD GET 2 CODES FREE

Hi, If you have not used it,

Hi,

 

If you have not used it, you will get 2 codes free...!!!

source code not open.but add

source code not open.

but add in this site.

please open source code.

 

Check with the login and try

Check with the login and try again.

 

If not happening, send a mail to support department of this site.

great code. Thanks. 

great code. Thanks. 

APPLICATIONS & TECHNOLOGIES

Learn about the latest applications and industry trends with tutorials and white paper design resources on vertical markets.

Automotive
Energy Harvesting
MEMS Technology
OpenSource Hardware
RFID & NFC
RF Wireless
Sensor
Solar
Touch
Wireless Charging

 

You are here