DIY – Means Do It yourself. Make simple and Low cost LFR-Line Following Robot using AT89c51 Micro controller IC.
A line follow robot is autonomous robot that follows here my robot either BLACK LINE IN WHITE BACKGROUND or WHITE LINE IN BLACK Background.
The motor drive circuit is used to ON/OFF the LEFT/RIGHT motors of the robot to provide desired motion. Here 2 sensors is used to detect the line and its logic level. Based on the status of the sensors, the comparative circuit gives output to input of micro controller circuit. MCU decides the position of line and also the required direction of motion required to follow the line. BLACK LINE FOLLOWER ROBOT LOGIC STATUS.
The MCU reads the 2 line sensor outputs for the position of the left sensor and right sensor logic level. Here my robot follows the black line. FORWARD Condition:
So that initially the left and right sensor outputs are HIGH. So that left and right motor starts forward direction.
TURN RIGHT Condition:
If robot turns left direction, the left sensor value goes to Low, then MCU stops left motor and start its right motor to forward direction. TURN LEFT Condition:
If robot turns right direction, the right sensor value goes to Low, then MCU stops right motor and start its left motor to forward direction. STOP:
If both sensors are on the black line, the left and right sensor logic output goes to low then left and right motor will OFF. HOW TO ASSEMBLE Line Follow Robot.
Chassis for two motors and Castor Wheel assembled.
Wheel and Motor assembly.
Assembled Chassis Top View.
At Top of the chassis MCU board and motor drive circuits.
Complete assembled line Following Robot
PROGRAM FOR BLACK LINE FOLLOWING ROBOT.
sbit SR=P1^7; //right sensor
sbit SL=P1^6; //left sensor
sbit MRp=P1^4; //right motor positive terminal
sbit MRn=P1^3; //right motor negative terminal
sbit MLp=P1^2; //left motor positive terminal
sbit MLn=P1^1; //left motor negative terminal
while(1) // Long Loop
if(SR==0 && SL==0)
MRp=1; MRn=0; //forward
if(SR==1 && SL==0)
MRp=1; MRn=0; //left turn
if(SR==0 && SL==1)
MRp=0; MRn=1; //right turn
if(SR==1 && SL==1)
MRp=0; MRn=0; //stop