Line Follower Robot. 03doc
Line Follower Robot. 03doc
Line Follower Robot. 03doc
PROJECT REPORT
Submitted To :
Sir Azhar Zaidi
Submitted By :
Nida Afaq
08-EE-128
Qurat ul-ain
08-EE-137
Mohsin Majeed
08-EE-17
Hamza Shahid
08-EE-116
Abstract:
1
Acknowledgement:
Table Of Contents:
Project description:
The project mainly comprises of three sections.
microController section
Mechanical section
Sensors
3
Microcontroller:
Different microcontrollers are available like Motorola,Intels 8052,Atmels AVR,Zilogs Z8 and
PIC.PIC is chosen for this project as
It is cost effective.
Software and hardware development tools like compilers, assemblers,
debuggers and emulators are easily available.
It meets our computing needs more efficiently.
PIC:
PIC has different families 10xxx,12xxx,14xxx,16xxx,17xxx and 18xxx.they all are 8 bit
processors .data larger than 8 bit is broken into 8-bit pieces to be processed.PIC 18xxx
family is used as it has the highest performance of all the families of 8-bit PIC
microcontrollers and it is available in 18- tpo 80- pin packages with easy migration to more
powerful version of chip without losing software compatibility.
PIC18F458:
PIC 18 has a RISC architecture that comes with some standard features such as on-chip
program(code) ROM, data RAM, data EEPROM, timers ,ADC and USART and I/O
ports.PIC 18 deals with 16 bit instructions and PIC family having letter F in part no indicates
that on-chip ROM is flash.
PIC 18F458 is used for this project because it has easy bidirectional motion .
It is a 40 pin IC that comes in different packages such as DIP(dual in-line
packages),QFP( quad flat package) and LLC (leadless chip carrier).a total of 33 pins are set
aside for the five port A,B,C,D,E with their alternative functions. The rest of the pins are
4
Mechanical section:
The mechanical sector comprises of motors, wheels, and aluminum sheet and arm lifter.
The figure below shows the full mechanic al structure
Motors:
5
The motors used are the motors of power window of car .three motors are used in total ,two
for moving the line follower and one is used for raising and lowering the arm lifter. The
speed of motor is more than our requirement so it is coupled with the gear to increase the
torque and consequently reduce the speed to our required level.the output of the gear is
connected to the shaft which is passing through the wheels.
Ratings:
The motor is of 12V and 1.5 A.
Wheels:
6
Arm lifter:
It is made up of aluminium sheets and with the help of nut it is connected to shaft of motor.
The arm moves up and down by the clockwise and anticlockwise rotation of motor.
specifications of motor are same (12V & 1.5 A)
Aluminum sheets :
The sheets used are of 19 guage.the sheet which is used to place motors and batteries is of
width 16 inches and of length 19 inches. The aluminum rods which connect the base sheet
with top sheet are of 10 inches. The top sheet is used to place PCB s.The aluminum sheets
are bended to increase the mechanical strength.
Batteries:
In this project two batteries are used to power the circuit and these are of 12 V ,5A/20H.
9
Sensors:
Seven sensors are used in total. Five of them are used to keep the robot in line and two of
them are used to detect junction. The sensing utilizes the properties of LDRs
Five sensors used are labeled as Sc, Sl , Sl , Sr , Sr. If Sc and one of Sr is active it means
robot is turning right so speed of left motor is increased to bring it back onto center line and
if Sc and one of Sl is active it means it is turning towards left so speed of right motor is
increased to bring it back onto centre line.
Junction sensor:
Sensors at junction are labeled as Jl and Jr.if Jl gives 0 output followed by 0 output of j r it
means that robot have crossed some junction.
Schematic:
10
PCB Designing:
PCB designs of project is as follow
11
Algorithm of project
Code:
12
//five sesors
#define sll PORTA.F0;
#define sl PORTA.F1;
#define sc PORTA.F2;
13
void start();
void stop();
void linetr();
void arm(int);
void turnrght();
void turnlft();
void reverse();
void rght6();
void rght4();
void rght2();
void rght1();
void lft6();
void lft4();
14
//#pragma code
//#pragma interrupt multi_chk_isr
void multi_chk_isr()
{
if(INTCON.F0==1)
{
JR++;
JL++;
}
if (JR==2 && JL==2)
{
stop();
arm(1);
start();
reverse();
INTCON.F0=0;
}
15
linetr();
INTCON.F0=0;
}
if (JR==6 && JL==6)
{
stop();
arm(2);
start();
reverse();
INTCON.F0=0;
}
16
void rght6()
{
20
void start()
{
PORTD.F0=1;
PORTE.F0=0;
PORTD.F1=1;PORTE.F1=0;
PORTD.F2=1;
PORTB.F0=0;
PORTD.F1=1;
PORTB.F1=0;
}
27
void main()
{
TRISD=0x00;
TRISE=0;
INTCON.F0=0;
INTCON.F3=1;
INTCON.F7=1;
//TMR2IE=1;
TRISA.F6=0;
TRISA.F7=0;
28
TRISA.F4=1;
TRISA.F5=1;
TRISA.F4=1;
TRISA.F5=1;
TRISA.F4=1;
linetr();
Future advancements:
29
30