Picture of Arduino Line Following Robot for Beginners
* Updated 08/24/2013 to include more pricing, source information, and top/bottom/wheel templates

Mostly functional for general public, use at own risk!

Hey hey! This is a Programmable Line Following Robot for Beginners. This project is designed to work in tandem with our Arduino Traffic Light for Beginners instructable. However it will work just fine without!

We estimate this can take approximately 10 to 15 hours of work for someone who hasn't done any electronics or programming. If that's a bit much, we recommend checking out this instructable! Depending on how you source your parts, the average cost for this project will probably be between $40 and $60.

This project was designed for a summer camp at a Hackerspace in Ann Arbor, MI. If you aren't already familiar with what a Hackerspace/Makerspace is, we highly recommend you check one out! They can be a wonderful resource for both tools and information. Things like access to a LASER cutter can make this project look significantly better with minimal effort. Find one near you!

Suggested Tools
- Soldering Iron
- Wire Snips
- Pliers (Needle Nose Preferred)
- Wire Strippers (22 AWG)
- Utility Knife
- Phillips Head Screwdriver (No. 1)
- Pencil
- Arduino UNO
- Breadboard
- 9V Battery Holder with 2.1mm Barrel Connector
- LASER Cutter
- Heat Gun

Suggested Materials
- 1 x ($1.50) - Photocell (Sparkfun)
- 2 x ($2.26) - QRD1114 - IR Emitter/Sensor (Sparkfun)
- 3 x ($1.00) - 100 Ohm Resistors - Brown Black Brown (Sparkfun)
- 2 x ($1.00) - 220 Ohm Resistors - Red Red Brown (Sparkfun)
- 2 x ($1.00) - 270 Ohm Resistors -Red Purple Brown (Sparkfun)
- 2 x ($1.00) - 5.6k Ohm Resistors -Green Blue Red) (Sparkfun)
- 2 x ($1.00) - Yellow LEDs -Indicators Lights on Car) (Sparkfun)
- 2 x ($1.00) - Red LEDs -Brake Lights on Car (Sparkfun)
- 1 x ($17.00) - 22 AWG Solid Core Wire in Red, Black, Yellow, Blue, and White colors (Sparkfun)
- 1 x ($2.00) -  Solarbotics Plastic Caster (Solarbotics)
- 2 x ($11.50) - DC Gear Motor (GM2) (Solarbotics)
- 2 x ($2.00) - NPN Transistors (Adafruit)
- 2 x ($1.50) - Diode 1N2001 (Adafruit)
- 1 x 9v Battery (Local Hardware Store)

- 1 x LASER Cut Acrylic Top Plate *
- 1 x LASER Cut Acrylic Bottom Plate *
- 2 x LASER Cut Acrylic Wheels *

- 2 x Thick Rubber Bands - 3.5cm diameter x 1cm width (Local Hardware/Craft Store)
- 1 x 8" Zip Tie (Local Hardware Store)
- 2 x ($0.50) - Machine Nuts - #3 1/2" Micro (Local Hardware Store)
- 2 x ($0.50) - Machine Screws - #3 1/2" Micro (Local Hardware Store)
- 2 x ($0.50) - Machine Screws - #2 1/4"  (Local Hardware Store)
- 4 x ($0.50) - Machine Screws - (~1/8" Diameter, ~1.5" Length ) (Local Hardware Store)
- 12 x ($1.00) - ?? Nuts for Machine Screws(Local Hardware Store)
- 1 x ($2.00) - Double Sided Sticky Foam Tape ~10cm length x ~1cm wide) (Local Hardware Store)
- 1 x ($2.00) - White Electrical Tape Roll (Local Hardware Store)
- 1 x ($3.00) - Foam Core Board24x36" 1/4" thick 
- 1 x ($3.00) - Heat Shrink Tube: 25cm of 3/32" (~2.4mm) diameter.

Highly Recommended
- Clean workspace
- Good lighting
- Someone awesome to work with

Short on resources?
- Find out if there's a local hackerspace near by!
- Need it today? Radioshack. Can you wait a few days? Adafruit, and Sparkfun are excellent resources.

Who made this?
- This instructable was brought to you by Khevna Shah and Josh Williams, and much help from the World's Friendliest Hackerspace: All Hands Active

* Don't have a LASER Cutter?
- See the PDF files! They contain a printable version of the Top and Bottom car plates, along with wheels. Print them out and purchase a sheet of 1/8" Baltic Birch. Along with a drill, a good assortment of bits and an appropriate saw will make for a classy wooden version!
Remove these adsRemove these ads by Signing Up
1-40 of 49Next »
bob30301 year ago
Excellent job, from station setup forward. I think a novice could use these instructions to build. You got my vote for weekend project.
Khevna (author)  bob30301 year ago
Thank you!

On breadboard connectivity picture, left motor is connected pin2->NPN base,

Are you sure this is correct?
i think it should be connected to pin3 :)

You are correct as pin 3 is PWM

buck71312 days ago

Final code?????? I've built I just need the code. please

Please can you give me the final code.....

BrandonS32 months ago

Do you have the final code please? would love to try this out.

goldenshuttle2 months ago

very good tutorial

great work ..but plz i need the final code cuz it seems a little bit complicated :D

Hi, can I have the final code for this project? Kinda new to this field. Thank you.
Hi, can I have the final code for this project? Kinda new to this field. Thank you.
Ridoy.light3 months ago

Hi khevna , I just love your work. It's so amazing. But could you please send me the final code? I would like to look at it.

thyish4 months ago

Great work. Would you please send me the final code? I am doing for my school project.


Roman_22994 months ago
(removed by author or community request)

I started putting the wiring together on the Breadboard and in step 4b you indicate connecting a 1K ohm resistor from J14 to the Ground. In the supply section, there is no listing for a 1K Ohm resistor. I have one 100 Ohm resistor left, should I be using the 100 Ohm Resistor or the 1K Resistor? Thanks!

I used the 1K ohm resistor and the project is working. Thanks for the schematics and detailed instructions, they were very helpful in completing the project.

kiranrs5 months ago


OsmanA15 months ago

hey could you send me the final code pls

benitosavage5 months ago

Hello Khevna, I love this, its very detailed. I have been struggling (I'm new with this stuff) with trying to make my line following robot work from other instructables so I'm going to take a stab at your version. Any chance you finished your final code yet? If so could I pretty please have it? Thanks

It's a great project. I would like made it. Could you please email me the final code. Thanks in advance. My email:

shmx7 months ago
grt job I appreciate.
Dietrick K.9 months ago

so I built a line follower out of a book called Beginning Arduino. and when I made it and coding the robot with the exactly same code it didn't work. well to e exact half my wheels didn't run. they got information but no power. I ran a test program and the robot worked. still half my robot dosent work. I really need some help if you can please reply or email me at

umbra_victus9 months ago

Hey first I wanna start by saying that this is amazing and really helped me do what I want. I have looked over there a few times and I still have some problems with my code. I can't figure it out :(

Could I get an email with the final code? I would really love to see where I messed up. Please and thank you.

romanbasnet9 months ago

could you please send me the final code at

hulu_hili10 months ago

Could you please email me the final code. Thanks in advance. My email:

favouredbilly10 months ago

please , email me the final code

gsingh3711 months ago

Please email me the final code at:

Great tutorial! Could you send me your full code? Thanks! My email is

pu_k981 year ago

please send me your full code , I need this for mechatronic actuator project.

Excellent, i will use this to a disciplin Project.

Thank vou for the Great job.

If you have the full code please sent me to:

hai, what is the kind this black ribbon

Thank you!! I'm about to try to do this project. Do you already have the final code? It may be such a big help because I'm just starting to learn programming. Thank You. I'll let you know when I finish it haha.

areevkumar1 year ago

Great helps a lot to persons like me who are new to arduino

I've only two days to submit my project.

When will the final code be ready?

abrownlee21 year ago

When will the final code be ready?

hurry up !! I can't wait for this project.....
I searched for a project like this for weeks and thank you for make things easier to beginners just like me.
tonmoy15181 year ago
This project theme is excellent....
but it will be more helpful if we can get the whole circuit diagram....
Thanks in Advance..:)
kodagames1 year ago
(removed by author or community request)
Hello Khevna, Greatly Appreciate the Tutorial! Im new to Arduino and just purchased my first arduino (microcontroller) kit and can't wait to get started on this project.

Hopefully, by the time I get the rest of the parts needed to follow along and get caught up (where it is now), the final code (step 27) will be ready? When are camps over?

I also noticed you are a Unity fan as well (good stuff!). Amazing Amazing Community over there as well!
j135791 year ago
How do you got this photos??
Is this from some stimulation software??
If yes can you please name it.
1-40 of 49Next »