Skip to content
ThinkNMake — Don't just think. Make it.
BeginnerAges 10–14 2 h

Line Following Robot

Teach a rover to follow a black track using two IR sensors and simple logic.

Project kit

$23.19

9 parts in one box

Unlocks the code, wiring and step-by-step guide.

Or get the kit

$16.19

Robo Obstacle Kit · 2 projects

Objective

Build a two-wheel robot that follows a black line on a white surface without human control.

How it works

Two TCRT5000 sensors sit either side of the line. Each reports whether it sees dark or light. The Arduino reads both and steers: if the left sensor sees the line, slow the left wheel; if the right sees it, slow the right; if neither, drive straight.

Components you'll need

ComponentQtyAvailabilityPrice
Arduino UNO R3 (compatible)×1In stock$5.19
IR Sensor×2In stock$1.18
Bo Motor×2In stock$2.18
L298N Dual Motor Driver×1In stock$2.29
2WD Acrylic Robot Chassis×1In stock$2.99
4×AA Battery Holder with Switch×1In stock$0.59
Jumper Wire Set (120 pcs)×1In stock$2.99
Bought one by one$17.41

All of these come in Robo Obstacle Kit and ThinkNMake Maker Kit.

Circuit & connections

The full wiring diagram and pin-by-pin connections.

Already bought it? Log in

Code

The complete, tested sketch (20 lines), ready to upload.

Already bought it? Log in

Step-by-step instructions

6 illustrated steps:

  1. 1Assemble the chassis
  2. 2Mount the electronics
  3. 3Wire the motors
  4. 4Add the sensors
  5. 5Upload the code
  6. 6Tune
Already bought it? Log in

Troubleshooting

Fixes for the problems makers hit most often on this build.

Already bought it? Log in

Watch the build