Line Follower Robot with Arduino and IR Sensors
Line follower robot is easy to make. creative and simplest robot in Embedded system.A robot which walks without any instructions. it gets instructions by itself from the Sensor. we are using Infrared sensors which act like our sense organs. The IR sensors, sense the colour. IR sensor gives a different value for both colours. So we calibrate the sensors value and input it into the Arduino with some conditions. In this tutorial, you will learn this line follower robot with Arduino and IR sensors. Arduino is the simplest and easy to use a microcontroller. Arduino Based Line follower Robot can make easily.
Line follower robot with Arduino can learn you many topics in Embedded and robotics. Uses of Input and output in Arduino microcontroller. How to configure and how to send and receive data from an input device or sensors. Arduino based Line follower robot having Motors chassis. Motor driver and many other things. here you can learn all these things in this full tutorial. so read the full article. we have more article on the same Arduino projects like a self-balancing robot
You need All these component to make this awesome IR robot
- Components Required to Make Line Follower Robot
- IR sensors
- Geared DC motors
- Circuit Diagram For Line Follower Robot with Arduino/ Arduino line follower diagram
- Connect Arduino PIN 2 with IR sensor 1 Output Signal pin
- Connect Arduino PIN 3 with IR sensor 2 Output Signal pin
- Connect Arduino PIN 4 with motor driver IN1 pin
- Connect Arduino PIN 5 with motor driver IN2 pin
- Connect Arduino PIN 6 with motor driver IN3 pin
- Connect Arduino PIN 7 with motor driver IN4 pin
- Connect motor driver Output 1 pins with Motor 1
- Connect motor driver Output 2 pins with Motor 2
- C Code for Arduino line follower /Line Follower Robot with Arduino code
// put your setup code here, to run once:
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
int m= digitalRead(2); //sensor 1
int n= digitalRead(3); //sensor 2
if (m==HIGH)
{
digitalWrite(4, HIGH); //motor 2
digitalWrite(5, LOW);
digitalWrite(6, LOW); //motor 2
digitalWrite(7, HIGH);
}
else if
(n==HIGH)
{
digitalWrite(6, HIGH); //motor 1
digitalWrite(7, LOW);
digitalWrite(4, LOW); //motor 2
digitalWrite(5, HIGH);
}
else
{
digitalWrite(4, HIGH); //motor1
digitalWrite(5, LOW);
digitalWrite(4, HIGH); //motor 2
digitalWrite(5, LOW);
}
// put your main code here, to run repeatedly:
}
Note:- sensor 1 should near the motor 1 & sensor 2 should near the motor 2 on the chassis
It’s not my first time to go to see this web page, i am visiting this website
dailly and obtain good data from here everyday.
thanks a lot for your valuable comment