This Post is updated as per new modifications in Line Following Robot Using Arduino Uno

Line Following Robot is a very simple and logical robot, If you have an interest in Electronics and Making Projects then you are at the right place, my friend. Today in this tutorial I will tell you that how you can make Line Following Robot in Easy Way.

Line Following Robot using IR Sensors has become trendy for Beginners and for those who have an interest in making Projects and New things. This is a very basic project and I am sure if you make this project then your interest level will be increased and it will give you the boost to make other projects too 😉 So let’s get Started.


[adsforwp id=”3715″]
Arduino_Logo

What is Line Following Robot?

A-Line Following Robot is toy car type robot which follows a particular line (Black or White Line) it is Autonomous Robot which is consist of Micro-Controller and Pair of IR (Infrared) Sensors and DC Gear Motors.

We will put Some Instructions into an Arduino( Micro-Controller) and that instruction will decide whether a Robot have to run in the forward direction or in the left direction or right direction. So I hope now you have an idea of Line Following Robot.

So let’s Move on another part which is Components Required for Making Line Following Robot.

Read More: How to Interface Ultrasonic Sensor with Arduino

Components Required:

  1. Arduino Uno R3
  2. Pair of IR (Infrared) Sensor (Approx: 2 to 5 will work great)
  3. Motor Driver IC LM293D
  4. Body for Robot (You can Make body from Plastic or Wood it Depends on you)
  5. Two DC Gear Motor
  6. Two Wheels
  7. Hot Glue and Cable Ties
  8. Connecting Wires.
  9. 9v Battery


[adsforwp id=”3715″]

Line Following Robot Following Black Line

Working of Line Following Robot using IR sensor is Very simple and logical too. It is simple in that way it will follow the Black or White line. but to do that we have to make some logical operation into Arduino.

In-Line Following Robot  we are using Two Dc Motors two IR modules which are consist of IR Transmitter and IR Reciever whenever the IR Transmitter emits the light than it strikes on the surface and then it reflects back toward the IR Reciever (Except Black line), then IR Reciever gives output proportional to the reflectance of the surface and Then Arduino gives instruction to the DC motor according to that Motors will go in forward direction or left or right.

Read More: What is Arduino? And How to Learn Arduino

WORKING OF IR SENSOR

Quite Difficult nah? Don’t Worry Let me make it simple 😀

How will Line Following Robot Change Direction Autonomously?

If Line (Black or White) Goes Straight:

line follower robot using arduino and ir sensor code

When Line goes straight we have to make IR pairs in such manner that it will be on the white surface and our motors will move in the Forward Direction.


[adsforwp id=”3713″]
If Right IR Sensor Goes On Black Line:

Line following robot using arduino

When Right IR Sensor Goes On Black Line then It will not receive any signal and the other IR Pair which is on the white surface will receive the signal and make the motor of right side to be stopped and the motor from the left side will be in the forward direction and that will produce turn on the right side.

If Line (Black or White) Goes Left:

line follower robot using arduino uno and ir sensor

When LEFT IR Sensor Goes On Black Line then It will not receive any signal and the other IR Pair which is on the white surface will receive the signal (same as Previously) and it will make the motor of the left side to be stopped and the motor from the right side will be in the forward direction and that will produce turn on the left side.

line follower robot using arduino

Here is the complete Infographic of working of Line Following Robot:

infographics of line following robot using arduino uno and ir sensors

Read More: Download any E-Book for Free from Z-Library

[adsforwp id=”3713″]

Assembling the Components of the Line Following Robot:

Line_following_robot with chassis

Line_following_robot with chassis

Take the plastic or wood chassis and put the two DC gear motors on the left and right edges and stick them with Hot Glue. mount the Arduino UNO R3 and Breadboard on the surface of the Chassis using Cable Tie and also connect
ICL293D on the breadboard and then connect the 9v Battery on the surface of Chassis and now connect the pair of IR Module and make sure that the pair has minimum distance towards the surface so they can work well. Now The
Assembling Part is Complete let’s go for Connection of Line Following Robot.

Connections of Line Following Robot:

Line Following Robot Circuit Diagram

Line Following Robot Circuit Diagram

Note:

  • All Red Wires are connected with Postive Supply (9v).
  • All Black Wires are connected with Negative Supply(Gnd).
  • And The Green Wires are connected with Digital Pins of Arduino (4,5,6,7).
  • All Blue Pins are connected to the Digital pin (2,3).
  • Zoom in Circuit Diagram for better Understanding.

Also Read: How to Interface IR Sensor with Arduino Step by Step GUIDE

Arduino Code For Line Following Robot:

To Upload the Code you Need an Arduino IDE Software click here to download that software.

If you want to learn about Arduino then Click here.
[adsforwp id=”3725″]

#define LS 2      // left sensor
#define RS 3      // right sensor

/*-------definning Outputs------*/
#define LM1 4       // left motor
#define LM2 5       // left motor
#define RM1 6       // right motor
#define RM2 7       // right motor

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))     // Move Forward
{
digitalWrite(LM1, HIGH);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
}

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

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

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

[adsforwp id=”3711″]

Or you can Donwload the code here.

Also See: Latest 500+ Final Year Projects For Electronics Engineering Students

Just Copy and Paste this code into Arduino IDE then upload the code your Line Following Robot is Ready to make a path try your robot and have fun.

  1. Want to learn and make Arduino Based Radar System.
  2. Want to learn and make Arduino Based Calculator Project.
  3. Want to learn and make IR Remote tester Project Control LED on Remote.
  4. Want to learn and make Visitor Counter Using LDR and 7 Segment Display.

If you find this article helpful then comment below and appreciate the efforts and if you have any query regarding this post just comment below I will put my maximum efforts to help you out. Thanks For Visiting Stay Connected with Better and Best Stuff…

Sending
User Review
4.67 (6 votes)