Line position
Turn five on and off sensors into one number a controller can use: the line’s position in millimeters, by a weighted average. Find out how fine it can see, and where it goes blind.
Open it in the simulatorA line-following race car taught as real control engineering: a five-sensor array, the line’s position in millimeters, differential drive on a TB6612, P then PD steering, speed against grip, and lap timing with a wheel encoder.
0 of 7 done
7 lessons in 3 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.
Turn five on and off sensors into one number a controller can use: the line’s position in millimeters, by a weighted average. Find out how fine it can see, and where it goes blind.
Open it in the simulatorThe controller that makes it a racer. Steer in proportion to the error, see the wheel commands saturate, then add a derivative term that brakes the turn before it overshoots.
Open it in the simulatorTurn the racer into a race car: a race of three laps that stops at the flag, your own tuned gains in the code, a failsafe for a lost line, and a race day run.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Infrared, comparators and five bits, then one number in millimeters a controller can steer by.
Five TCRT5000 reflective sensors in a row are the racer’s eyes. See how infrared light, a phototransistor and a comparator turn black tape into a high pin, and read all five as one number.
0 of 6 steps
Turn five on and off sensors into one number a controller can use: the line’s position in millimeters, by a weighted average. Find out how fine it can see, and where it goes blind.
0 of 5 steps
Two wheels through an H-bridge, then a PD controller that turns the error into wheel commands.
A line follower steers like a tank: two wheels at different speeds. Drive two gearbox motors through a TB6612FNG, spin on the spot, and see why its brake is not a coast.
0 of 5 steps
The controller that makes it a racer. Steer in proportion to the error, see the wheel commands saturate, then add a derivative term that brakes the turn before it overshoots.
0 of 5 steps
Speed against grip, laps timed to the hundredth, and a three lap race with a failsafe.
Faster is not always quicker. Put real numbers on base speed, the corner speed tires can hold, slowing down in the bends, and the pack that gets slower as it empties.
0 of 4 steps
A bar across the track starts the clock. Time each lap to the hundredth, measure it in millimeters with the wheel encoder, and keep the best.
0 of 4 steps
Turn the racer into a race car: a race of three laps that stops at the flag, your own tuned gains in the code, a failsafe for a lost line, and a race day run.
0 of 5 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Build a line-following racer is part of the maker track, a ladder of courses from zero to expert.
Bumpers and cliff sensors, wheel encoders and a map, random bounce against spiral against rows, a five-layer behavior ladder, and a battery that sends it home to its dock.
Open the next courseFollow the starter kit you already own, then build a claw machine, a balance bot, a handheld console or an LED cube, each a short course checked by the simulator.
See every course on the trackEvery lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Build a line-following racer are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 6 hours: 7 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Line position, P then PD and Project: a race track.
With "Sensor arrays", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.