Line Following Robot is a very simple and logical robot, If you have interest in Electronics and Making Projects then you are at 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.
- 1 What is Line Following Robot?
- 2 Connections of Line Following Robot:
- 3 Arduino Code For Line Following Robot:
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.
- Arduino Uno R3
- Pair of IR (Infrared) Sensor (Approx: 2 to 5 will work great)
- Motor Driver IC LM293D
- Body for Robot (You can Make body from Plastic or Wood it Depends on you)
- Two DC Gear Motor
- Two Wheels
- Hot Glue and Cable Ties
- Connecting Wires.
- 9v Battery
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.
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:
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.
If Right IR Sensor Goes On Black Line:
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:
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.
Assembling the Components of the Line Following Robot:
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:
- 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.
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.
#define LS 2 // left sensor
#define RS 3 // right sensor
#define LM1 4 // left motor
#define LM2 5 // left motor
#define RM1 6 // right motor
#define RM2 7 // right motor
if(digitalRead(LS) && digitalRead(RS)) // Move Forward
if(!(digitalRead(LS)) && digitalRead(RS)) // Turn right
if(digitalRead(LS) && !(digitalRead(RS))) // turn left
if(!(digitalRead(LS)) && !(digitalRead(RS))) // stop
Or you can Donwload the code here.
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.
- Want to learn and make Arduino Based Radar System.
- Want to learn and make Arduino Based Calculator Project.
- Want to learn and make IR Remote tester Project Control LED on Remote.
- 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…