You can watch the video of this project at youtube by this link:
https://www.youtube.com/watch?v=vGtz5N80xrs
Simple Line Following Robot Using At89S52 Microcontroller
1) simple Follow black line on a white surface .
2). IR sensor is used .
3). Comparator ic used LM324
4). At89S52 Micro controller
5). Optocouplers 4N25
6). Transistor Tip142 for drive motor
7). 2 Gear motor used
Water Industry Process Automation & Control Monthly - April 2024
Line Follower Robot Using At89S52 Microcontroller
1. 1
Line Follower Robot
Using AT89S52 Microcontroller
SUBMITTED TO
Engr.Saif Uddin Hirani
SUBMITTED BY:
NAME: Danish Amin ROLL NO:BEES/S13/0161
NAME: Abdul Moiz ROLL NO:BEES/S13/0178
NAME:Hunain Shuja ROLL NO:BEES/S13/0170
NAME: Ammar Imran ROLL NO:BEES/S13/0171
DATED: 20-jan-2015
2. 2
Sensor Circuit
The sensor part consists of a set of IR sensor pairs for the left
side and right sides. In the circuit, resistors R1 and R4 limits the
current through the illuminating LEDs.Resistors R2, R6 and R3, R5 forms
a voltage divider network together with the corresponding Ir receiver
the output of the sensor circuit is taken from the points labelled left
and right in the circuit diagram.
The table below shows the voltage at nodes left and right for the
possible orientations of the sensor module.
3. 3
Comparator circuit.
The job of the comparator circuit is to convert analog voltage
output of the sensor into a digital format for the microcontroller to
read. The comparator circuit is built around opamp IC LM324 (IC1).
LM324 is a general purpose quad opamp.
Preset resistor R10 and R11 are used to set the 1V reference for the
left and right comparators respectively. Output from the left and right
sensors (node A and B) are connected to the non-inverting input on the
left and right comparators. Output of the left comparator is connected
to P1.o of the microcontroller and output of the right comparator is
connected to P1.1 of the microcontroller. The table given below shows
their output voltage with respect to the possible input voltage
combinations.
4. 4
Microcontroller (AT89S52)
The task of the microcontroller here is to control the left and
right motors according to the feedback signals from the left and right
comparators so that the robot remains on the correct path (the black
line). The logic executed by the microcontroller for keeping the robot
in track is illustrated in the table below.
Optocoupler (4N25)
The Output from the microcontroller goes to the Optocoupler.
Optocoupler is used here to just protect the microcontroller from and
high voltage. In this project we used to two power supply one for
microcontroller and other for motor. Both supply are separate from each
other.
5. 5
Motor driver circuit
The job of the motor driver circuit is to drive the motors according
to the output signals from the optocoupler. The motor driver circuit
is based on Tip142 (NPN DARLINGTON TRANSISTOR). Tip142 is a high
current (10A), high voltage (50V).
Assembly Code.
ORG 000H ;origin
MOV P1,#00000011B ;sets port 1 as input port
MOV P0,#00000000B ;sets port 0 as output port
BACK: MOV P0,#00000000B ;starts both motors
JB P1.0, LABEL1 ;branches to LABEL1 if left sensor is ON
setb P0.0 ;stops left motor
clr P0.1 ;runs right motor
ACALL WAIT1 ;calls WAIT1 subroutine
SJMP BACK ;jumps back to the BACK loop
LABEL1: JB P1.1, LABEL2 ;branches to LABEL2 if right sensor is ON
clr P0.0 ;runs left motor
setb P0.1 ;stops right motor
ACALL WAIT2 ;calls WAIT2 subroutine
SJMP BACK ;jumps back to the BACK loop
LABEL2: SJMP BACK ;jumps back to the BACK loop
WAIT1:JNB P1.0,WAIT1 ;waits until robot is back from rightward
RET ;returns from WAIT1 subroutine
WAIT2:JNB P1.1,WAIT2 ;waits until robot is back from leftward
RET ;returns from WAIT2 subroutine
END ;end statement