Skip to content

Line Follower

You'll build a small robot that tracks a tape course with corners, a gap and a crossing, and tune it until it does three clean laps.

About

Line following is the first robot that feels like a robot: it reacts faster than you can and it fails in ways you have to think about. A ten-dollar chassis, two gear motors, a driver module and a three-sensor reflectance array is everything, plus black tape on a light floor. The jump from the Common badges to here is control. On-off steering wobbles, and proportional steering (turn harder the further off the line you are) is the trick that makes it smooth. The thing nobody tells you is that room light changes the sensor readings, so calibrate on the floor you'll run on, every time.

At a glance

Per requirement
35 XP
Completion bonus
300 XP
Requirements
6
Takes
Two or three weeks
Skill level
Intermediate (months of practice)
Cost
Moderate (under $100)
Supplies
You need some
Where
At home
Other people
With other people
Locked for now
Earn two more Uncommon badges in Microcontrollers & Robotics to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Build the chassis and drive it in a straight line under code. Two gear motors never match, so trim one side's PWM until it tracks straight over three meters. Film three meters straight. Video
  2. 2
    Calibrate three or more reflectance sensors on your floor and print the readings. Sweep the array across the tape for a few seconds at startup, record the min and max per sensor, and scale each to 0 to 1000. Take a screenshot of the readings with the sensors on tape and off. Photo
  3. 3
    Follow a simple oval with on-off steering, then with proportional steering. On-off: if the left sensor sees the line, turn left, and so on. Proportional: compute a position from the weighted sensors and steer by a gain times the error. Film both, one after the other, so the wobble and the smoothness are both visible. Video
  4. 4
    Add a 90-degree corner, a 10 cm gap and a crossing to the course, and handle each. Corners need a sharper turn when the outside sensor loses the line, gaps need a moment of going straight on memory, and crossings need all-black to be ignored. Film the robot clearing all three features. Video
  5. 5
    Do three clean laps without touching it. Clean means no wheel leaves the tape and no hand reaches in. Film all three laps in one take. Video
  6. 6
    Run it on a course someone else drew. A friend, a kid or a makerspace lays the tape. Note what broke and what you changed. Film the run. Video