Line Follower robot with IR array Sensor
The robot which follows a black line by it’s intelligent. Actually this intelligent is due to the code uploaded in the Controller. In this project, we will use an array of the IR sensor in which there is 5 sensor which works more accurate than the normal ir sensor. Line follower robot simple and cheap to make. Line follower robots are the most creative and simplest robot in Embedded system. A robot which walks only on the black line . it gets instructions the IR array Sensor. we are using Infrared sensors. The IR sensors, since the colour on the behalf of the reflection of the light.
IR sensor has the properties to gives different values for both dark and light colours. So we calibrate the sensors value and input it into the Arduino with some conditions. In this tutorial, IR sensors having the two parts one is transmitter and another is a receiver. transmitter transmits the light and receiver receive the light from the photodiode. there is also a potentiometer to calibrate or adjust the value needed in the program. Line follower robot can be made by any of the controllers such as STM, ARM, AVR.
Line follower robot with Arduino can learn you numerous points in Embedded and mechanical technology. how to use input devices and output devices Arduino microcontroller. The most effective method to design and how to send and get information from an information gadget or sensors. Arduino based Line follower robot having Motors, motor driver and IR sensors etc. here you can become familiar with every one of these things in this full instructional exercise. so read the full article. we have more article on the equivalent Arduino activities like a self-adjusting robot
Components Required to make line follower robot:-
- IR Array sensor

- Geared DC motors
- Circuit Diagram For Line Follower Robot with Arduino/ Arduino line follower diagram
Code for Line follower robot with IR array sensor:-
void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
int L= digitalRead(2); //sensor 1
int AL= digitalRead(3); //sensor 2
int M= digitalRead(4); //sensor 3
int AR= digitalRead(5); //sensor 4
int R= digitalRead(6); //sensor 5
if (L==HIGH && AL==HIGH && M==LOW && AR==HIGH && R==HIGH)
{
digitalWrite(7, HIGH); //motor 2
digitalWrite(8, LOW); //FORWARD
digitalWrite(9, HIGH); //motor 2
digitalWrite(10, LOW);
}
else if(L==HIGH && AL==HIGH && M==HIGH && AR==LOW && R==HIGH)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, HIGH); //RIGHT
digitalWrite(9, HIGH); //motor 2
digitalWrite(10, LOW);
}
else if(L==HIGH && AL==HIGH && M==LOW && AR==LOW && R==HIGH)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, HIGH); //RIGHT
digitalWrite(9, HIGH); //motor 2
digitalWrite(10, LOW);
}
else if(L==HIGH && AL==HIGH && M==HIGH && AR==LOW && R==LOW)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, HIGH); //RIGHT
digitalWrite(9, HIGH); //motor 2
digitalWrite(10, LOW);
}
else if(L==HIGH && AL==LOW && M==HIGH && AR==HIGH && R==HIGH)
{
digitalWrite(7, HIGH); //motor 2
digitalWrite(8, LOW); //LEFT
digitalWrite(9, LOW); //motor 2
digitalWrite(10, HIGH);
}
else if(L==HIGH && AL==LOW && M==LOW && AR==HIGH && R==HIGH)
{
digitalWrite(7, HIGH); //motor 2
digitalWrite(8, LOW); //LEFT
digitalWrite(9, LOW); //motor 2
digitalWrite(10, HIGH);
}
else if(L==LOW && AL==LOW && M==HIGH && AR==HIGH && R==HIGH)
{
digitalWrite(7, HIGH); //motor 2
digitalWrite(8, LOW); //LEFT
digitalWrite(9, LOW); //motor 2
digitalWrite(10, HIGH);
}
else if(L==LOW && AL==LOW && M==HIGH && AR==LOW && R==LOW)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, LOW); //RIGHT
digitalWrite(9, LOW); //motor 2
digitalWrite(10, LOW);
}
else if(L==HIGH && AL==HIGH && M==HIGH && AR==HIGH && R==HIGH)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, HIGH); //RIGHT
digitalWrite(9, HIGH); //motor 2
digitalWrite(10, LOW);
}
else if(L==LOW && AL==LOW && M==LOW && AR==LOW && R==LOW)
{
digitalWrite(7, LOW); //motor 2
digitalWrite(8, LOW); //RIGHT
digitalWrite(9, LOW); //motor 2
digitalWrite(10, LOW);
}
else
{
digitalWrite(7, HIGH); //motor 1
digitalWrite(8, LOW); //STOP
digitalWrite(9, HIGH ); //motor 2
digitalWrite(10, LOW);
}
}
Upload the given code into your arduino baord.