Through a microcontroller, we can able to make robot run on specified path without human interference.

An RC robot which follows a specified path.


A microcontroller device which operates on certain program encoded in it. It follows black lines through sensors attached to its front side. In addition motors, battery, a motor driver jumper wires were used in making.

Software used: Arduino.exe ( Arduino UNO )

    //Kumar Sparsh
//very simply written code
//code for Arduino line follower bot


#define LS 2 
#define RS 3
#define LM1 5
#define LM2 4
#define RM1 7
#define RM2 6

void setup() 
{
  pinMode(LS,INPUT);
  pinMode(RS,INPUT);
  pinMode(LM1,OUTPUT);
  pinMode(LM2,OUTPUT);
  pinMode(RM1,OUTPUT);
  pinMode(RM2,OUTPUT);
}

void loop() 
{
  if(digitalRead(LS) && digitalRead(RS))
  {
    digitalWrite(LM1,HIGH);
    digitalWrite(LM2,LOW);
    digitalWrite(RM1,HIGH);
    digitalWrite(RM2,LOW);
  }

  if(digitalRead(LS) && !(digitalRead(RS)))
  {
    digitalWrite(LM1,HIGH);
    digitalWrite(LM2,LOW);
    digitalWrite(RM1,LOW);
    digitalWrite(RM2,HIGH);
  }

  if(!(digitalRead(LS)) && digitalRead(RS))
  {
    digitalWrite(LM1,LOW);
    digitalWrite(LM2,HIGH);
    digitalWrite(RM1,HIGH);
    digitalWrite(RM2,LOW);
  }

  if(!(digitalRead(LS)) && !(digitalRead(RS)))
  {
    digitalWrite(LM1,LOW);
    digitalWrite(LM2,LOW);
    digitalWrite(RM1,LOW);
    digitalWrite(RM2,LOW);
  }
}
Kumar Sparsh

Maker Pro Logo
Continue to site
Quote of the day

-