Line follower robot(IR based)

line follower robot is machine that can follow a path, a robot that is designed to follow either a black line on white line on the ground without getting off the line.The robot has two ir sensors installed underneath.Left sensor will be controlling left motor Similarly right motor is controlled by right sensor, when the sensor is on black surface motor will be switched on else switched off constantly correcting wrong moves using feedback mechanism forms a simple loop system

Proteus Design

Code

#include<reg51.h>
sbit m0 =P2^0;
sbit m1 =P2^1;
sbit m2 =P2^2;
sbit m3 =P2^3;
sbit s1 =P1^0; //sensor1
sbit s2 =P1^1; //sensor2
void main()
{
  while(1)
   {
    while(s1==1&&s2==1)     //straight
          {m0=1;
           m1=0;
           m2=1;
           m3=0;
          }
    while(s1==1&&s2==0)     //right
          {m0=0;
           m1=0;
           m2=1;
           m3=0;
          }
    while(s1==0&&s2==1)    //left
          {
       m0=1;
           m1=0;
           m2=0;
           m3=0;
          }
    while(s1==0&&s2==0)   //stop
          {m0=0;
           m1=0;
           m2=0;
           m3=0;
          }
     }
}

Category: 

Share

Who's new

  • ravirajpatil871...
  • shubhambajoria
  • yassir
  • demiholyman890954
  • scottgillum51169040

Get Notified

 

Share

We are Social

Syndicate

Subscribe to Syndicate