Line follower robot: a first robot project: building a line follower
Zeta42 · 25 October 2026
A line follower robot drives itself along a dark line. Here is the 45-minute RobolaB build, the block program and the fixes for a robot that wanders off.
A line follower robot is a small robot that drives itself along a dark line on a light surface, and building one takes about 45 minutes. The RobolaB version uses a MIEO kit, two line sensors under the robot and a short block program, and it is rated intermediate on the project page.
What a line follower robot does
The robot reads the floor beneath it. MIEO has two line sensors on its underside, and they look at the black line printed on the kit's line follower chart. When the line drifts toward one side, the robot speeds one wheel up or slows it down to steer back. It repeats this many times every second, so the movement looks like one smooth drive around the curves.
Children who build it learn four things: how a sensor tells a dark line from a light floor, how steering works by changing the speed of each wheel, why a loop that runs many times a second gives smooth movement, and how to tune speed and sensor values until the robot stays on track.
What you need for the build
The parts list is short. You need the MIEO board, two N20 motors with their wheels, a battery, the 3D-printed mountings, a caster wheel, screws and a screwdriver, the line follower chart and the free block coding app on a computer. The project is tagged for both MIEO and MIEO Pro, so either kit will do.
An adult should help with the small screws. Before uploading any driving program, lift the wheels off the table so the robot cannot drive off an edge while the program starts.
How to build a line follower robot in five steps
- Fix the two motors into their mountings and attach a wheel to each motor.
- Screw the mountings to the MIEO board, one wheel on each side.
- Fit the caster wheel, so the robot balances on its two wheels and the caster.
- Fit and connect the battery, then switch MIEO on.
- Lay the chart flat on the floor or a large table, with the line sensors facing down just above the paper.
Coding the line follower in blocks
The program is five short steps in the block coding app.
- Choose MIEO as the device, connect it and set the switch to Upload.
- Under the block for when MIEO starts up, set the line follower speed to 60 per cent, with a left threshold of 1700 and a right threshold of 2200. These are the app's starting values.
- Add a happy face and a startup sound, so you can see and hear that the program has started.
- Put the "do line following" block inside a forever loop. Leave the empty gap in that block alone for now.
- Upload the program, lift the robot and set it on the chart with the black line between its two sensors.
The app converts the blocks to code and sends it to the robot over USB or Bluetooth. After that MIEO runs the program by itself, even when it is unplugged from the computer. The project page also offers a starter project file, and it was checked in version 1.0.10 of the app.
Fixing a line follower robot that will not behave
Most first runs need a small adjustment, and the project page lists three common cases.
- If the robot drives off the line straight away, start it with the line exactly between the sensors and keep bright light from shining directly on the chart.
- If it wobbles or misses tight curves, lower the speed from 60 to 40 and upload again.
- If it ignores the line, switch to Arena mode, use the sensor reading blocks to measure each sensor over black and over white, then set the thresholds between those two readings.
In the last case the child measures the sensors and picks the thresholds from those readings, so the numbers in the program come from the robot's own floor and light.
Three ways to take the project further
Once the robot follows the line, the page suggests extensions at three levels. The easy one is to test speeds of 40, 60 and 80 and find the fastest setting that stays on the line. The medium one is to add a beep inside the loop, so the robot beeps each time it crosses a line. The hard one is to count the crossings with a variable and stop at the third, which is a step toward the autonomous delivery robot project. Related projects on the site include line follow with stop detection, a table edge guard and a delivery bot.
Where this fits at home or in school
For a parent, the project is a 45-minute build with a troubleshooting list the child can work through, and an adult only needs to help with the small screws. For a teacher, the same build and the same list can run in one session with a class. RobolaB also supports schools with lab setup, teacher training, hackathons and competitions, and MIEO is the rung before the DOBOT desktop arms in Zeta42's robotics ladder from age three to university. If you are planning a club or a lab, see the RobolaB kits or our STEM and robotics training.
Common questions
- How long does it take to build a line follower robot with MIEO?
- The RobolaB project page gives 45 minutes for the build and the program, and rates it intermediate. An adult should help with the small screws.
- Why does my line follower robot drive off the line?
- Start it with the black line exactly between the two sensors and keep bright light off the chart. If it still wobbles or misses tight curves, lower the speed from 60 to 40 and upload again.
- Which kit do I need for the line follower project?
- The project is tagged for both MIEO and MIEO Pro. You also need the line follower chart and the free block coding app on a computer.
Source: robolablearn.com