A Simple and Cheap DIY Line Following Robot

About: I make hobbyist stuffs and play with electronics follow me to know more https://www.facebook.com/arduinolabviewsolidworks https://twitter.com/learnrobotix

If anyone wants to start to build robots , This robot is for them, Its easy to do, No knowledge of programming is required, Just a little bit of electronics knowledge is sufficient to finish this robot.

Key Ingredients:

1x Chassis

2x IR sensors

1x caster wheel

2x Wheels

2x Gear Motors

1x ULN 2003 IC

4x 1.5v battery or 9v battery

1x battery snap

1x battery holder

1x bread boardSpacers ,

stud and screws, and screw driver bread board connector wires

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: How It Works?

What is a line following robot?

As the name suggest this robot will follow a line either black or white line.

What is the logic behind this?

This robot follows the logic of opaque and transparent surface, usually white surface reflects back the light and black surface absorb the light,

How this logic can be used in line following robot?

We can use a IR sensor , Its a pair of IR transmitter and emitter, IR rays are emits by the transmitter and received by the receiver, If the surface usually white or other color will reflect back the sensor and the receiver start to receiver by this way the sensor produce 5v as output, This output can be connected to any logic circuit to drive motor or other appliance, If the sensor meets black surface there is no reflected rays , so the logic output will be 0v.

This is a simple and cheap line following robot, This robot doesn't need any programming and can work without a microcontroller, hence this is a robot for a complete beginner ,
Main components of this robot is IR sensor and ULN 2003A IC

Whenever the IR sensor falls on a reflective surface or white surface it starts to give 5v as output. ULN 2003A is a high-voltage, high- current, darlington transistor array. In this circuit it act as a switch , whenever it receives 5v as input , the output switch opens. if there is no input, switch closes.

whenever IR sensor produces 5v as output, the output pin of IR sensor is connected with the input pin of ULN 2003 IC , so the motor starts to run, if there is no output , the motor stops.

Step 2: IR Sensor and Circuit

Step 3: Circuit Diagarm

Step 4: Logic Behind


When sensor 1 and 2 in white surface:

In the first case both the sensors are in white surface or reflective medium, which gives 5v as output and it drives both the left and right motors .


When sensor 1 in white surface and sensor 2 in black surface:

In this case sensor 1 is in white surface and the sensor will produce 5v as output and only one motor rotates, which makes the robot to take a turn in right side.


When sensor 2 in white surface and sensor 1 in black surface:

In this case sensor 2 is in white surface and the sensor will produce 5v as output and only one motor rotates, which makes the robot to take a turn in left side.

Step 5: Robot Track

We can use any track for the robot , the above one I used for the robot I made. Make sure The black line is opaque and the surface is transparent.

Step 6: Working Robot

IF you are looking for more simpler project like this take a look into this blog :http://learnhowtomakerobot.blogspot.in/

Formlabs Contest

Participated in the
Formlabs Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    17 Discussions


    3 years ago

    bro can u tell me why the variable resistor is used.....?


    3 years ago

    Plz tell the components in the ir sensors circuit diagram.


    3 years ago

    Do every kind of ir sensor work with this circuit?is it necessary that it should produce 5v ir radiation??


    3 years ago

    Where to fit the ir sensor in step three

    Sanchit Bahl

    3 years ago

    Will LM 358 be OK for this projects?

    Coz I can't find the ULN 2003A IC


    Reply 3 years ago

    It is only valid for small simple mazes.

    otherwise you will need to implement the PID concept for which a microcontroller is neccessary

    Nope.You need an Op-amp to amplify the output of photodiode otherwise it will produce a small voltage output.The Op-amp will amplify the output to 5 volts.


    4 years ago on Introduction

    Nice work on your robot! I'm glad you included a video to show it in action. Pretty impressive stuff!

    1 reply