Professional Documents
Culture Documents
A line follower robot is a mobile machine that can detect and follow the line drawn on the floor. Generally, the path is
predefined and can be either visible like a black line on a white surface with a high contrasting colour or it can be invisible
like a magnetic field.
Components required:
● 8051 Microcontroller
● IR Sensors (2)
● Motors (2)
● 11.0592MHz Crystal
● 10µF Capacitor
● Push Button
● 12V Battery
● 5V DC Power source
Code:
#include<reg51.h>
sbit s1=P1^0;
sbit s2=P1^1;
else if((s1==1)&(s2==0))
{
motor_pin_1 = 0;
motor_pin_2 = 0;
motor_pin_3 = 1;
motor_pin_4 = 0;
}
else if((s1==0)&(s2==0))
{
motor_pin_1 = 0;
motor_pin_2 = 0;
motor_pin_3 = 0;
motor_pin_4 = 0;
}
}
}