Line Follower Robot: Acies Secutor

Acies Secutor (line follower in latin) is a self guided autonomous automated bot. This robot is programmed to follow line embedded on the floor. There are two IR sensors integrated with Arduino Board which senses the path. In case of any curves, respective IR sensors send signal to Arduino Board and voltage being provided to DC Motors are regulated accordingly using Arduino Motor Shield.

// Program developed by Abhishek Mishra//

#include <AFMotor.h> //import your motor shield library
#include “Arduino.h”
#define LS 2 // left sensor
#define RS 3 // right sensor
AF_DCMotor motorL(3); // set up motors.
AF_DCMotor motorR(4);



void setup() {
motorL.setSpeed(65); //SPEED BETWEEN (50 to 240 max)
motorR.setSpeed (65);
pinMode(LS, INPUT);
pinMode(RS, INPUT);
}


void loop() {
if(digitalRead(LS) && digitalRead(RS)) // Move Forward
{
motorL.run(FORWARD); //if there’s no turning go straight
motorR.run(FORWARD);
}

if(!(digitalRead(LS)) && digitalRead(RS)) // Turn right
{
motorL.run(BACKWARD); //turn right dir
motorR.run(FORWARD);
}

if(digitalRead(LS) && !(digitalRead(RS))) // turn left
{
motorL.run(FORWARD); //turn left dir
motorR.run(BACKWARD);
}

if(!(digitalRead(LS)) && !(digitalRead(RS))) // stop
{
motorL.run(RELEASE); //turn left dir
motorR.run(RELEASE);
}
}