You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/251948999

Technical report of building a line follower robot

Article · August 2010


DOI: 10.1109/ICEIE.2010.5559826

CITATIONS READS

19 6,361

2 authors, including:

Seyed Ehsan Marjani Bajestani


Qazvin Islamic Azad University
4 PUBLICATIONS   19 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Localization; Control; Mapping; Navigation; Omni-directional vision View project

All content following this page was uploaded by Seyed Ehsan Marjani Bajestani on 18 February 2016.

The user has requested enhancement of the downloaded file.


2010 International Conference on Electronics and Information Engineering (ICEIE 2010)

Technical Report of Building a Line Follower Robot

Seyed Ehsan Marjani Bajestani Arsham Vosoughinia


Khorasan Science & Technology Park, Iran B.S Student of Islamic Azad University, Mashhad
ehsan_marjani@yahoo.com Branch, Iran
Arsham.vosoughinia@gmail.com

The following robot is a intelligent system as a kind of


provisional one, which has robot positions corrective
feedbacks ,toward the black or white line. In general robots
incomes are voltages of the circuits and sensors voltages -Able to finding way when the color of the line been
variations. The robot processor which is a micro AVR chip has inverted (black to white, white to black) in all items.
been set to read the incomes , compare them to the
predetermined amounts and ordering to the motors by the
driver. and the robot outcomes are to move and change the
robot's position toward the line in the best way. The traits of Project Restrictions
this robot comparing to the last ones in this field includes:
increasing man oeuvre power with sudden way point
-It has to be a battery powered.
changes ,excellent and accurate robot renovation and low price -Must be no larger than 15*15*15 cm in dimensions.
for production. This robot can be use for carrying stuff of move within 20cm of each line side.
information's between two special points like to rooms in an -Free to pass a way twice or more.
office or in a hospital. Individual Tasks
-Line sensor
Keywords:Programming,Implimentations,Logical
CircuitsS,Motor Driver,PWM -Comparator
-Micro controller
-Motor driver
I. INTRODUCTION
-Power supply
This report will outline the design construction and -Body/chassis
testing of our line follower robot. It will show detailed -Program
section on the design stage and how we paired different parts
together. II. LINE SENSOR
This report will state new features upgraded by some This is a circuit which is able to see the black & white
under graduating BC students of technical faculty of Islamic
lines on the floor and translate the wheels location in
Azad University , Mashhad branch (IAUM).
relation to the line.
Aims
Sensor development and compositions:
The aim of this robot was to follow a black line and also
In this robot we have 16 infrared ON2179 sensors which
it is a type of LF robot which is capable of doing different 13 of them implanted on an arc of a circle. Rest 3 linear are
items that we mention the next parts. on in front of sensor 7, corner left and corner right.
Objective Because our robot moving mechanism has wheelchair
This robot: system and turning axle is exactly between the wheels, we
-Follows the line path on the floor. have used arc shaped sensors implementation composition as
-Able to turn 90 & 110. you can see in figure 1.
The privilege of this composition comparing to the linear
composition is that the robot would not loose the line when
its turning a screw.

-Finds its way in several cated and separated line (jag line).

-Finds its way in changing shape of the line. (Butterfly line,


circle, half circle, square)

978-1-4244-7680-0/$26.00 C 2010 IEEE V1-1 Volume 1


2010 International Conference on Electronics and Information Engineering (ICEIE 2010)

Figure 1. Robot picture of the sole Because of diode makes 0.2V voltage on plug in the
saturation state and circuit is going to bias with 5V), but
The Infra Red option has 2 major benefits over the light with the same comparison and by ohm law the flow
sensors solution. Firstly that the Infra Red Spectrum is a lot consumption increases in the stable voltage (5V).Which this
cleaner than the visual spectrum, there is a lot less potential
experiment shows the receiving flow (IE) in several different
for interference. The other advantage is that phototransistors
colors for the same RL resistors. You can see this experiment
will react much quicker than photo cells. However, what
appears white and black to the naked eye, may not be conclusions in the table1.
distinguishable in the Infra red spectrum.
_13 sensor on arc TABLE I. IE & VC VARIATIONS TO RL AND COLOR VARIATIONS

Their duty is to keep robot on and guide it not to deviant


from the line. Sensors by reporting to the micro controller
announce robots positions comparing with line and micro
determine motors face and speed.
_3 linear
They are designed for special features of the
competitions map. Therefore the competition field had
several special features, we have used 3 linear sensors to
guide the robot truly when passing these features.
For example:
-If sensors 15 & 16 were on (robot on the black line) the
robot entered in the color switching area.
-If sensors 7 & 8 were on the robot is on line and moving
forward with the maximum speed.
-And if one the sensors 7 or 8 were on it means deviance of Now as much as distance between the sensor and the
the robot from the line that micro controller by sending the ground rise up(d>5mm) the voltage variance increases as
necessary command makes it back on the line. well and because the receiver and sender waves receive and
-Likewise if sensor 1 was on shows that wheel 1 is too close send like cones shape, the more distance from the ground
to the line and because of that motor 1 moving invert and shows more noise in the outcome as you can see in figure 3.
motor 2 moving straight to bring robot on the line and also
the amount robot deviation controls the turning speed of the
wheels for example if sensor 1 was on motors weather in the
straight or invert form turning faster comparing with the
time that sensor 2 or 3 are on.
Sensor circuit
This circuit contains 16 infrared sensors (ON2179).

Figure 3. Efficient sensor distance to ground

And the resistor which shows less noise in the 1cm height,
has a range between 100K and 300K, that we have chosen
180K. For preventing high flow pass and burning of a
sensor and also there for infrared outcome be adequate. We
Figure 2. Sensor experimental circuit serialize sender by 180Ω and 180KΩ for receiver.(figure4)

Sensor ON2179 includes one sender diode and one infrared


receiver diode. In the following circuit (figure2) voltage of
A spot for different colors with different RLs is similar to
these table and graph. Idealistic for us is high voltage
variance in different colors to
distinguish accomplishes less noise. In this experiment,
sensor distance with ground spoted 5mm.
Definitely, more voltage variance would create, as much
as RL resistor become less (Until the sensor activation limit.

V1-2 Volume 1
2010 International Conference on Electronics and Information Engineering (ICEIE 2010)

PWM
DC motors speed are immovable and for changing it
should use gearbox & cag wheel or variable power supply
and because we want to variably motors speed by
programming, then we should handle this by voltage
control.
Pulse width modulation is a square pulse which we
control efficient voltages go to motors. For controlling the
speed of motors, MCs generate this pulse. And in the robot
programming to varied this speed we specify pulse amount
range (periodic) and 12V time amount.
Figure 4. Sensors circuit For example you can observe motor driver outcomes in
several positions comparing to the line by oscilloscope in
figure 6 .
III. COMPARATOR
The sensors outcomes are analog and from voltage
substance we connected them to OPAMP (Operational
Amplifier) board by electrical sucets.
OPAMP is a voltage comparator. We compare sensors
circuit voltage with potentiometer circuit voltage and
OPAMP outcome is the conclusion of this comparison (code
1[5V]or code 0[0V]).
The LM324 consist of four independent, high-gain
operational amplifiers on a single monolithic substrate.

In the circuit as you can see in figure 5 each LED you


see in the circuit shows one sensor state weather it has Figure 6. motor driver outcomes
sensed the line or not. If a LED be on shows the sensor
detected the line at that time. In the previous robot some V. POWER SUPPLY
time has been used LCD for this work, but using LED s is
easier to understand and design and they are cheaper. This circuit which supplies necessary voltage to all the
circuits and systems on the set. For supplying MCs 5
permanents voltage and basic voltage of rest of the circuit
we used 7805IC. A 12V battery supplies simultaneously this
ICs incomes (that is the voltage supplier of whole circuit)
and motors.

Figure 5. OPAMP circuit

IV. MICRO CONTROLLER


Digital amounts of OPAMP outcome coming to MCs
incomes (A,B parts) and MCs outcomes go to motor driver.
Beside, MCs board include series of diodes connected to
A&B ports to show MCs incomes. A diode connected to C.3
port for programming use and one buzzer connected to port
D.4 for programming. and micro controllers board includes
DC motors driver circuit, buffer and voltage confirmer.
Motor driver
We have used H-bridge circuit to drive our motors. As
Figure 7. Micro controller's, Motor driver's & Power supply's circuit
you know it’s a famous circuit which we surrendered to
explain it hear.

V1-3 Volume 1
2010 International Conference on Electronics and Information Engineering (ICEIE 2010)

VI. BODY/CHASSIS And to pulling down the robot gravity center to the least
In order that designing robot chassis with metal was hard, possible amount we have used plumb masses.
inexactly and expensive we have used plaxy glass that we Because of wheels tire little friction we have used two side
sniped it with laser. strip glue on the tires to increase the tires friction to prevent
In spite of robot moving mechanism is complicated we used robot deviance by gliding.
to two dander balls at the corners front of the robot.

Figure 8. Body parts

//3-1: Robot recognizer state tab comparing to the line


VII. PROGRAM (including straight, turning left and right)
//1: Programs global variables definition //3-2: Motors and PWMs pointer tab.Formatting: Insert one
//2: Programs main tab (including sensors reader, saver and hard return immediately after the last character of the last
invert recognition)
//3: Programs secondary functions

#include <mega32.h> while (1)


//======*1*======= {
unsigned int SensorPort,Sen,i=0, n=0,n2=0, PWMRM=0, SensorPort=PINA+(PINB*256);
PWMLM=0; //===========Invert ==========
unsigned int SpeedRobot=100; Sen=0xc003;
unsigned char R=0,L=0,Invert=0,white=0,turn=0; Sen &=SensorPort;
const char Front = 1;const char Back = 2; if (Sen==0xc003)
const int SP1 = 250;const int SP2 = 270; const int SP3 = 275;const {SensorPort=~SensorPort;
int SP4 = 280; const int SP5 = 285;const int SP6 = 290; PORTD.4=1;Invert=2;}
void MoveRobot(unsigned int Sensor); else if(Sen==0x8001||Sen==0x4002)
void PWM(unsigned int MotorRight, unsigned int {R = Front;L = Front;
MotorLeft,unsigned char Right,unsigned char Left); PWMLM=80;PWMRM=80;
//=============*2*============ SpeedRobot=SP5;Invert=1;
void main(void) PWM(PWMRM,PWMLM,R,L);}
{PORTA=0x00;DDRA=0x00; else if(Sen==0x0000)
PORTB=0x00;DDRB=0x00; {Invert=0;PORTD.4=0;}
PORTC=0x00;DDRC=0xFF; if (turn==1) n++;
PORTD=0x00;DDRD=0xFF; else
TCCR0=0x00;TCNT0=0x00; {n=0;n2=0;}
OCR0=0x00;TCCR1A=0x00; if (n>=30000)
TCCR1B=0x00;TCNT1H=0x00; {n2++;n=0;}
TCNT1L=0x00;ICR1H=0x00; if (n2>=3)
ICR1L=0x00;OCR1AH=0x00; {n2=0;n=0;turn=0;}
OCR1AL=0x00;OCR1BH=0x00; if (turn==1) PWM(PWMRM,PWMLM,R,L);
OCR1BL=0x00;ASSR=0x00; if ((Invert!=1)&&(turn!=1)) MoveRobot(SensorPort);};}
TCCR2=0x00;TCNT2=0x00; //============*3*=============
OCR2=0x00;MCUCR=0x00; //=========*3-1*==========
MCUCSR=0x00;TIMSK=0x00; void MoveRobot(unsigned int Sensor)
ACSR=0x80;SFIOR=0x00; {
PORTD=0X00; //==========SA=========
PORTC.3=0;

V1-4 Volume 1
2010 International Conference on Electronics and Information Engineering (ICEIE 2010)

if (Sensor==0x0180 || Sensor==0x03c0 || Sensor==0x07e0 || { if (Left==1)


Sensor==0x0ff0 || Sensor==0x1ff8) { PORTD.0=0; PORTD.1=1;PORTD.6=1;}
{ R = Front;L = Front; if (Left==2)
PWMLM=100;PWMRM=100; {PORTD.0=1; PORTD.1=0;}}
SpeedRobot=SP1; white=0; else
PORTC.3=0; turn=2;} { PORTD.0=0; PORTD.1=0;PORTD.6=0;}
else if (Sensor==0x0280 || Sensor==0x00c0 || Sensor==0x0380 || i++;
Sensor==0x01c0 || Sensor==0x0100 || Sensor==0x0080 ) if (i>=SpeedRobot)
{ R = Front;L = Front; i=0;}
PWMLM=100;PWMRM=100;
SpeedRobot=SP2; white=0; VIII. CONCLUSION:
PORTC.3=0; turn=0;} Sensor : Its outcome should be partly high variant for white
//===========TL==========
and black colors .
else if (Sensor==0x0300 || Sensor==0x0200 || Sensor==0x07c0 ||
Sensor==0x0fe0 || Sensor==0x1ff0) OPAMP : Should convert the outcome of sensors which is
{R = Front;L = Front; analog voltages to digital amount of 1 and 0 by a voltage
PWMLM=85;PWMRM=100; border. (1means black, 0 means white).
SpeedRobot=SP3; white=0; Micro : Micro by considering the sensors composition and
PORTC.3=0; turn=0; } OPAMP outcomes, detect robot position comparing to the
............ line and command the necessary order for moving to the
else if (Sensor==0x8380 ||Sensor==0x8180|| Sensor==0x81c0|| motor driver.
Sensor==0x3180|| Sensor==0x3980|| Sensor==0x1980|| Motor Driver : Should apply the sent micro order which is
Sensor==0x1d80|| Sensor==0x4180|| Sensor==0x6180||
(a logical order) low powered, to motors with high power.
Sensor==0x7180|| Sensor==0x7980)
{ R = Front;L = Back; Power Source : Should supply needed voltage for logical
PWMLM=100;PWMRM=100; circuits (5V) and motors (12V).
SpeedRobot=SP1; white=0; Body : Should have the ability of turning to surround with
PORTC.3=0; turn=1;} high speed, without gliding to turn invert, and beside at the
//============TR========== time of starting to move, the wheels shouldn’t be separated
else if (Sensor==0x0140 || Sensor==0x0040 || Sensor==0x03e0 || from the ground causing by sudden turning of the motors.
Sensor==0x07f0 || Sensor==0x0ff8)
{ R = Front;L = Front; REFERENCES
PWMLM=100;PWMRM=85; [1] 1. ON2179 Datasheet.
SpeedRobot=SP3; white=0; [2] 2. LM324 Datasheet.
PORTC.3=0; turn=0;}
[3] 3. Atmega32 Datasheet.
……..
else if (Sensor==0x01c1|| Sensor==0x0181|| Sensor==0x0381|| [4] 4. 74LS245 Datasheet.
Sensor==0x018c|| Sensor==0x019c|| Sensor==0x0198|| [5] 5. BD139 Datasheet.
Sensor==0x01b8|| Sensor==0x0182|| Sensor==0x0186|| [6] 6. TIP42 Datasheet.
Sensor==0x018e|| Sensor==0x019e) [7] 7. TIP41 Datasheet.
{R = Back;L = Front; [8] 8. 7805 Datasheet.All 8 above from www.alldatasheet.com
PWMLM=100;PWMRM=100; [9] 9. AVR and programming book by Dr.Zare,2009 edition
SpeedRobot=SP1; white=0;
PORTC.3=0; turn=1;}
//==========00&Other===========
else if ((Sensor==0x0000)&&(white==0)&&(turn!=2))
{ R = Back;L = Back;
SpeedRobot=SP6; white=1;
PORTC.3=0;}
else if (white==0) PORTC.3=1;
PWM(PWMRM,PWMLM,R,L);}
//==============*3-2*==========
void PWM(unsigned int MotorRight,unsigned int
MotorLeft,unsigned char Right,unsigned char Left)
{if (i<MotorRight)
{ if (Right==1)
{ PORTD.2=1; PORTD.3=0;PORTD.5=1;}
if (Right==2)
{ PORTD.2=0; PORTD.3=1;}}
else
{ PORTD.2=0; PORTD.3=0; PORTD.5=0;}
if (i<MotorLeft)

V1-5 Volume 1

View publication stats

You might also like