0% found this document useful (0 votes)
42 views5 pages

Line Following Robot Design

The document outlines the design and algorithm for a line-following robot, detailing the components required such as an Arduino Uno, DC motors, and IR sensors. It includes a circuit diagram and a basic sketch of the code that controls the robot's movement based on sensor readings. The robot is programmed to follow a line by adjusting the motors' speeds and directions according to the input from the sensors.

Uploaded by

Ibrahem Masoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views5 pages

Line Following Robot Design

The document outlines the design and algorithm for a line-following robot, detailing the components required such as an Arduino Uno, DC motors, and IR sensors. It includes a circuit diagram and a basic sketch of the code that controls the robot's movement based on sensor readings. The robot is programmed to follow a line by adjusting the motors' speeds and directions according to the input from the sensors.

Uploaded by

Ibrahem Masoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LINE FOLLOWING ROBOT

DESIGN
Design and algorithm

Component List:
- 1 Arduino Uno
- 1 base (where the other components will be fixed)
- 2 wheels
- 2 dc motors (to activate the wheels)
- 1 roller bal (for the rear part to follow front wheels)
- 2 IR transceiver sensors (to detect the line)
DC Motor Driving with IC L293D
As L293D IC has two H-Bridges, each H-Bridge can drive a
DC motor (Max two DC motors can be driven by L293D).

5V for constant speed


Circuit

Digital sensors
// turn left: Left motor stop, Right motor go
// turn right: Left motor go, Right motor stop
Sketch (basic)
void loop() else if(rs==LOW && ls==HIGH)
{ {//right s. Black, Left s. white
int lsPin=2, rsPin=3; //sensor pins rs=digitalRead(rsPin); // turn right
ls=digitalRead(lsPin); digitalWrite(RM1,HIGH);
int ls, rs; //sensor read values
if(rs==HIGH && ls==HIGH) digitalWrite(RM2,HIGH);
int RM1=10, RM2=11, LM1=12, LM2=13; {//both sensors see white digitalWrite(LM1,HIGH);
//Right Motor (RM) and Left Motor (LM) Pins // go straight digitalWrite(LM2,LOW);
digitalWrite(RM1,HIGH); }
void setup()
digitalWrite(RM2,LOW); else if(rs==LOW && ls==LOW)
{ digitalWrite(LM1,HIGH); {//both sensors see black
pinMode(RM1,OUTPUT); digitalWrite(LM2,LOW); // stop
} digitalWrite(RM1,HIGH);
pinMode(RM2,OUTPUT); else if(rs==HIGH && ls==LOW) digitalWrite(RM2,HIGH);
pinMode(LM1,OUTPUT); {//Right s. White, Left s. Black digitalWrite(LM1,HIGH);
pinMode(LM2,OUTPUT); // turn left digitalWrite(LM2,HIGH);
digitalWrite(RM1,HIGH); }
pinMode(lsPin,INPUT); digitalWrite(RM2,LOW);
pinMode(rsPin,INPUT); digitalWrite(LM1,HIGH); delay(100);
digitalWrite(LM2,HIGH); }
}
}

You might also like