Introduction: How to Make a Line Following Robot

Picture of How to Make a Line Following Robot
Hello Instructables,

This my first time making a robot . In this instructable i will show you how to make a line following robot. Note that this a instructable for beginners who just want to make a robot for the fun of learning it. It will not be good for people who want their robot to be really fast and follow a line in less then a minute . This robot moves at a medium speed.

Step 1: Materials

Picture of Materials

For this robot you will need:
prototype board x1
-2907 transistor x2
-leds x8 (3 red,3 yellow,2 orange)
-LM339 x1
-1k resistor x2
-150 ohms resistor x 4
-Photocells x4
- 20k potentiometer x2
- DPDT switch Center off x1
- Motors x 2 (any kind of motors you would like)
- Wheels x 2 (wheels that fit your motor)
- A sandwich container, box, etc..(something strong enough to hold your circuit in)
- 9 volt battery
- 9 volt battery connecter
- Wires

- Side cutter
- Long Nose Plier
-  Soldering Ion
-  Solder
- Wire stripper

Step 2: Building the Indicator Lights

Picture of Building the Indicator Lights

In this step we will be building the indicator lights these lights tell us which photoresistors are getting more light.First place the Ic in the middle of the board so that none of the pins are connected to each other.
1. Connect Pin 2 of LM339 to 1k resistor. 
2. Connect the other end of the resistor to the base of the 2907 transistor.
3. Now connect the collector of the transistor to one end of a 150 ohms resistor and emitter to 9V.
4.  Connect the other end of the resistor to the positive end of the yellow led.  The negative end of the yellow LED then connects to the positive of the next yellow LED. Like wise connect the third yello LED so that the three yellow LEDs are connected in series and the third LED's negative is connected to ground.
5. Now connect Pin 1 of the LM339 to 1K resistor and repeat the steps 2-4 thereafter using Red LEDs instead of yellow.
6. It would be convenient to make a separate rail for the positive 9V and for the ground so that you can connect your 9V battery connector to those lines when you are finally ready to connect the battery.

Step 3: Looking at the Pins

Picture of Looking at the Pins

In this step we will look at all the pins and connect them to where they have to go. First connect pin 3 to positive (9V). Then connect pin 12 to ground. Now connect pin 4 to pin 7 and connect pin 5 to 6.

Step 4: Adding the Sensors

Picture of Adding the Sensors

1. Connect a 20k potentiometer between pin 6 and pin 7.
2. Then connect the one end of a 150 ohms resistor to the middle of the potentiometer and the other end to positive(9V).
3. Now connect 2 photocells from pin 7 to ground in series. And connect two other photocells from pin 6 to ground in series.
4. You must remember to connect the photocells so that the photocells are facing downwards to be able to sense the line.

Step 5: Making the Headlights

Picture of Making the Headlights

To make the headlights, 
1. Connect a 150 ohms resistor to the middle of the 20Kohm potentiometer and connect the other end of the resistor to positive (9V).
2. Now connect the one leg of the 20K potentiometer to the positive of the white/Orange and the negative of the LED to the positive of another white/Orange LED, and then connecting the negative of the second LED to ground.

Step 6: Adding the Switch

Picture of Adding the Switch

Now for the adding the switch.
1. First, connect one of the middle leg of the DPDT switch to one terminal of the first motor and connect the other terminal of the motor to ground.
2. Connect the other middle leg of the DPDT switch to one terminal of the second motor and connect the other terminal of this motor to ground.
3. Now, remember the two 2907 transistors that we connected to the two 150 ohms resistors in the second slide. Connect one of the remaining legs of the DPDT switch to one of the collectors and the corresponding leg of the DPDT swich to the collector of the second transistor. Make sure you use the corresponding leg.

Now give yourself a pat on the back because your line following circuit is done.

Step 7: Soldering It All Up

Finally, solder everything into place and make sure that none of the components are shorting each other. At this time, connect your battery connector to the positive and the negative rail of your board.

Step 8: Body Building

Now onto the final step body building.

For my robot, I used a cardboard box. You may use something different if you like.

1. I made holes on the sides of the box to place my motors. I also made holes at the bottom of the box for my sensors (the sensors should not touch the ground, as in ground and not the negative) and the headlights ( because I connected them upside down).
2. For my convenience, I also made a hole on the side for the 20 K potentiometer to be able to adjust the brightness of the headlight.
3. If you would like, you could screw your board inside the bottom of the body (I did not because i just liked it as it was).

Step 9: Checking Connections

Now, before you add the battery, look over everything see for loose connections or something that doesn't seem right.

Step 10: Launching the Line Follower

Finally connect your battery and make your line and see you robot follow it. (Tip) you should make your line fairly thick with black tape.

If you have any comments or questions I will be happy to answer them



Step 11: Circuit Diagram


SoubhikB2 (author)2016-08-08


I am a student of class 12 and in our schools we have to make a simmilar project. i would be thankful to you if you could email me the circuit diagram of the project to

HimanshuS90 (author)2016-04-17

can you please mail me the circuit digram.....ur explanation is really very helpful....mail me at

AtharvaI (author)2015-12-03

hey is ur project working

Because i want to build the same one

I do not like risks

So pls tell truly that did ur project worked

or u r sending just fake instructions.

dkangogo (author)2015-12-01

hi,i just read and am intrested to make my first robot using your instructions,could you please send me the circuit,to see if i can first simulate in ltspice.

PrakharS5 (author)2015-10-11

i am not having potentiometer what shld i do plz tell

PrakharS5 (author)2015-10-11

i am not having potentiometer what shld i do plz tell

PrakharS5 (author)2015-10-10

my please mail me the circuit diagram my email id is ..........plzzzzzzzzzzzzzzzzzzzzz

MohammedW (author)2015-06-29

MadhuB2 (author)2015-04-23

Can u send me in pdf

keerthan0206 (author)2015-03-17

please mail me the circuit diagram my email id is

PavansingP (author)2015-01-29

Kindly, Will Yu Be Able to send the Circuit diagram to my email please..?

PavansingP (author)2015-01-29

Kindly, Will Yu Be Able to send the Circuit diagram to my email please..?

sarangk.ikku (author)2015-01-20

Kindly, Will Yu Be Able to send the Circuit diagram to my email please..? It"ll be a boon to me.. Am starving to get the ckt diagram of Line Follower.. my email is ''... pleez send my friend...

AbbasA (author)2014-11-24

In the diagram u use lm 393 and in the explanation u r written lm 339 please send me the diagram of ic 339 my e-mail id is plzzzzz quick send me the circuit diagram

karan.jeet.505 (author)2014-09-04

your project is truly inspiring but i came across a hiccup.

what alternate transistor may be used as i am unable to purchase the one stated above.

sayan.dutta.58760 (author)2014-09-01

its really a great explanation and really a simple 1 to understnd

mangavelli (author)2014-08-18

hey!!! This is Chaitanya.

can you explain about the connections of photo cells in depth; because it is a bit confusing here.
and what kind of photo cells did u use?

sarany (author)2014-02-10

can you pls send the circuit diag to ..or with due respect why have not posted it right in this document ?..and can you tell me how the speed control of the motor is achieved ? it necessary to use a potenetiometer ? pls do reply ..the procedure is being real easy to follow

Vemuri Suresh (author)2013-12-15

Hey! This Circuit diagram is not of what u have explained untill now...
Plz post me the correct Circuit Diagram of this project. coz am stuck in the middle due to this.. PLease.......

Bittu Sharma (author)2013-11-22

Please send me the circuit diagram of this circuit. My EmailID is

Mayur D (author)2013-09-06

bro....its the best explanation i got . and the most beneficial...but plzz mail me ckt diagram at

botgames (author)2013-06-15

Would it be possible to email me a better copy of the schematics? I really want to make a line following robot. Your instructable looks doable. I have all the components so I'm ready to go. Thank

anand210394 (author)2013-06-10

bro....its the best explanation i got thtoughout and the most beneficial...butplzz plzz upload its ckt diagram..or mail me at

sayedruhollahdeliry (author)2013-04-24

Could you give more explanation about its sensors mechanism, please?
I mean how much the distance should be between the sensor and the ground and if it move away from the line what will happen?

chan430 (author)2013-03-02

hi... its an awesome project... can i ask for the schematic diagram? i have all the components already... :)

aswaminathan (author)2013-02-25

can u please send me the pdf to email id-

MarianNeedsHelp (author)2013-01-29

also, where you solder, is it possible to use rubber cement? If you aren't comfortable with soldering. or, maybe electrical tape? I ask because i've made a hot air balloon and for the circuitry we used electrical tape and well. as you guessed, rubber cement.

MarianNeedsHelp (author)2013-01-29

Also, is there a specific TYPE of 1k resistor?

MarianNeedsHelp (author)2013-01-29

What is the WATT of the L.E.D's?

vizmotion (author)2013-01-26

Thank you for creating this article. I am working with my son to build this robot. I see the diagram is step 11. I almost missed it. Once again thanks.

gumfekar007 (author)2012-12-28

pls send me ckt dig.

gumfekar007 (author)2012-12-28

pls send me ckt dig

rcritic (author)2012-12-24

send me ckt diagram

rcritic (author)2012-12-24

Send me the circuit diagram too

abhigyangoswami (author)2012-12-18

can you plz send the circuit diagram in my mail id

abhigyangoswami (author)2012-12-18

Plz send me the circuit Diagram in my Mail

Jayashree Mahimanna (author)2012-11-30

hey i like the project kindly mail me the circuit diagram... my email id is

bhavyamadan (author)2012-11-30

well when i bought i just said cadmium sulficide photocells so dont know if that helps but yeah

bhavyamadan (author)2012-11-29

u use cadmium sulficide photocells

Abdullah Ahsan (author)2012-09-30

plz send me the circuit diagram at

sagar.latti (author)2012-09-30

please send the ckt

guruthumb (author)2012-09-08

Check this easy line follower out. All schematics and code included:

altaf hussain (author)2012-08-15

plz upload the circuit diagram
and how many potentiometer do you use? is it one

plz reply.

altaf hussain (author)2012-08-14

second leg of second potentiometer is connected?where.and plz send me circuit diagram on email id

plz i am making this earlier reply will be encouraging.
great work

Nishant kumar shah (author)2012-08-11

hey can i get the circuit diagram for this line following robot...plz send it to my mail.   

kaktus101 (author)2012-08-05

hi is it possible to send me the circuit diagram please, very nice design. i like it

kirubasneha (author)2012-08-01

can you send circuit diagram

hemantbhatia (author)2012-07-26

please send me the circuit diagram my email id is

eopemipo (author)2012-07-19

This is very wonderful and encouraging, please i would like you to send the circuit diagram to my email and i need ur follow up to assist me in trying this project.Thanks

bhavyamadan (author)eopemipo2012-07-19

Thank you for encouraging comment. I got this design from from a book soI will scan the circuit diagram and send it to you as soon as possible. I would be delighted to answer any questions you have regarding the robot as per my understanding.

About This Instructable




More by bhavyamadan:How To Make A Line Following RobotHow to Make a styrofoam guitar
Add instructable to: