Introduction

Line follower robots in competition
A line follower robot is an autonomous robot that reads a black line on a white surface with infrared sensors and drives the track as fast as it can. A first robot needs two sensors and two motors; a competition robot adds a sensor array, a PID controller, a light chassis, fast motors and sometimes a suction fan (EDF).
This article is about racing. To build your first line follower, see our step-by-step build guide; for the basics of the format, our line follower rules guide. The topic is timely: team Kavtazi won the Line Follower category at Georgia's STEAM and Robotics Championship, which we held on 20 June 2026, and now represents the country at RoboChallenge 2026 in Bucharest.
What wins a line follower race?
The robot follows the line from start to finish, fully autonomous, while an electronic gate times it; the best time wins. Tracks mix straights and tight curves, and a fast robot that loses the line loses to a slower, steady one. So a winning robot balances three things:
- a sensor that tells you exactly where the line is;
- an algorithm that reacts correctly;
- hardware that carries out the reaction quickly.
Sumo contests are covered in our guide to SUMO robot competitions.
Sensors: how a racer sees the line
Each sensor pairs an infrared LED with a phototransistor: white reflects most of the light, black absorbs it (wiring is in our build guide). The classic single sensor, Vishay's TCRT5000, has a 950 nm emitter, a peak operating distance of 2.5 mm, a 0.2–15 mm operating range and a daylight blocking filter. Racers usually use arrays such as Pololu's QTR-8A: 8 sensors at a 9.525 mm pitch, best at 3 mm from the surface and at most 6 mm.
The RoboChallenge line is 15 mm wide. With a pitch smaller than that, the line always covers one or two sensors and its exact position can be interpolated; wider spacing leaves blind spots.
- 2 sensors: only "left or right"; a first robot on a slow track.
- 3–5 sensors: rough position, P control; classroom races.
- 8 sensors: precise position, wide view; PID robots.
- 12 or more: more margin at sharp angles; fast competition robots.
A wider array (8 sensors at 9.525 mm span about 67 mm) loses the line later in a sharp turn.
Calibration is the cheapest upgrade. Identical sensors read differently and lighting varies, so before the start sweep the robot over the line: the program stores each sensor's minimum (white) and maximum (black) and scales every reading to 0–1000. Calibrate on the official track.
PID for racing: a worked example
Two-sensor bang-bang control ("turn hard" or "do nothing") zigzags and leaves the line at speed. Proportional (P) control on an array turns in proportion to the error, the line's distance from the robot's centre, but it only sees the present and overshoots at speed. A PID controller combines three terms: P, the error times Kp; I, the accumulated error times Ki, which removes a steady offset but is often zero or tiny on a line follower; and D, the error's rate of change times Kd, which sees the robot closing on the centre and eases the turn in time. The basics are in our build guide.
Take 8 calibrated sensors numbered 0 to 7. The line position is a weighted average: each reading times its weight (sensor number × 1000), summed and divided by the sum of readings. Position runs from 0 to 7000, centre 3500.
Say sensors 3, 4 and 5 read 600, 1000 and 400, the rest 0:
- Sum 2000; weighted sum 600 × 3000 + 1000 × 4000 + 400 × 5000 = 7,800,000.
- Position 7,800,000 / 2000 = 3900, so the error is 3900 − 3500 = 400.
- The previous error was 300, so the change is 100.
- With Kp = 0.05 and Kd = 0.5: P = 20, D = 50, correction 70.
- Base speed 150 (PWM 0–255): one motor gets 220, the other 80, and the robot turns towards the line.
Next loop the error falls to 320: P = 16, but D = 0.5 × (320 − 400) = −40, so the correction is −24 and the robot eases off before the centre instead of overshooting. The faster the robot, the faster the error changes and the harder D damps the swing. At 2 m/s a robot covers 2 mm every millisecond, so the loop must be fast and evenly timed.
The control loop in plain words
On an Arduino Nano (8 analog inputs, A0–A7) the race program repeats these steps without pause:
- Read the 8 sensors and scale each to 0–1000 with the calibration values (1000 = black).
- Work out the line position. If the readings add up to less than 300, the line is lost: use the far end on the side where it was last seen, so the robot turns back towards it.
- Error = position − 3500.
- Correction = Kp × error + Kd × (error − previous error); store the error for the next loop.
- One motor gets the base speed plus the correction, the other the base speed minus it, within 0–255.
If your sensor reads lower on black, reverse the scale; if the robot steers away from the line, flip the sign. Leave delay() and Serial.print() out of the race version. New to Arduino? See Arduino for beginners.
Tuning Kp and Kd
1. Start slow, with Ki = 0 and Kd = 0.
2. Raise Kp until the robot follows the line but wobbles on straights.
3. Lower Kp slightly and raise Kd until the wobble disappears.
4. If the motors buzz and the robot jitters, Kd is too high.
5. Raise the speed a little and repeat, as Pololu also advises.
6. Add Ki only if the robot keeps drifting to one side. Log every setting and lap time.
Hardware for speed: chassis, motors, wheels, battery and EDF
Motor and driver basics are in our build guide.
Chassis. Lighter means quicker acceleration and braking, so fast line followers often use the circuit board itself as the chassis.
Motors. Usually N20-size micro metal gearmotors (10 × 12 mm gearbox, 3 mm shaft). Pololu's 6 V HPCB versions reach about 1,100 rpm unloaded at 30:1, 3,300 at 10:1 and 6,500 at 5:1. Speed = rpm × π × wheel diameter / 60: with 30 mm wheels, about 1.7 m/s at 1,100 rpm and 5.2 m/s at 3,300 rpm, less under load. Faster gearing means less torque (about 0.17 kg·cm at 10:1 versus 0.45 at 30:1), so beginners find a higher ratio easier. Fast robots replace the classroom L298N with small MOSFET drivers such as the TB6612FNG or DRV8833.
Wheels. Soft rubber or silicone tyres grip better. Sticky coatings are banned: at RoboChallenge a tyre must not hold an A4 sheet (80 g/m²) for over two seconds. Clean the tyres before every run.
Battery. Usually a light LiPo, often 2S. Its voltage drops as it drains, changing how the PID behaves, so measure it and scale the PWM.
EDF. A small electric ducted fan lowers the pressure under the robot, pressing it onto the track so it corners faster. RoboChallenge's standard class allows it.
Line follower competition rules: RoboChallenge and our championship
Here is RoboChallenge's standard Line Follower next to our Line Follower Classic from Georgia's 2026 championship. Our full rules are in the line follower rules guide and the article on the championship's SUMO and Line Follower events.
RoboChallenge Line Follower
- Size and weight: max 25 × 25 cm, max 1 kg.
- Control: fully autonomous.
- Line: black, 15 mm, on white.
- EDF: allowed.
- Who: one operator, up to 2 robots.
Our Line Follower Classic
- Size and weight: fits a 30 × 30 cm box, up to 3 kg.
- Control: own program, no remote control.
- Who: from age 14, teams of 2–5.
- Line and EDF: not specified in our 2026 championship report.
RoboChallenge track and attempts
- a 4.14 × 2.80 m surface; start and finish coincide;
- no crossings; line sections stay 15 cm or more from each other and from the edge;
- minimum curve radius 75 mm, no angle sharper than 70°;
- track mapping is banned (if it happens, the track is changed), so the robot reads the track live;
- runs last up to 3 minutes; up to 3 attempts in the first 120 minutes, then up to 10 more for the top 10 in the last 60;
- losing the line once means a restart, twice a recorded 3:00;
- each robot's best time counts.
RoboChallenge's other line follower classes
Per the official regulations, RoboChallenge 2026 has five more line follower classes:
- Kids: under-18s, same 25 × 25 cm and 1 kg; the EDF clauses contradict each other, so ask the organisers;
- Enhanced: a 10 cm gap in the line, a brick to drive around and a seesaw;
- Turbo: EDF mandatory, with loop segments;
- Advanced: EDF mandatory, and the robot also runs upside down on a ceiling with a white line on black;
- NXP Track Follower: autonomous cars on a 55 cm track with 2 cm black edge lines and intersections.
Kavtazi: Georgia's line follower champions
On 20 June 2026 we held Georgia's STEAM and Robotics Championship at Radio City | District 4 in Tbilisi. Team Kavtazi, Rati Gogichashvili and Nino Meshveliani, won the Line Follower category. All winners are in our article on Georgia's 2026 robotics championship.
The three SUMO and Line Follower winners earned the right to represent Georgia at RoboChallenge 2026 (30 October to 1 November, POLITEHNICA University, Bucharest), the first time a Georgian national team takes part. With Kavtazi are RageByte, the Mega Sumo winners, and Kokadama, the Mini Sumo winners (see our Mega Sumo robot and Mini Sumo robot guides).
We wrote this on 31 October 2026, mid-competition, so results are not here yet. More about the team: Georgia's national team at RoboChallenge 2026 and how to support it.
Common mistakes and a race-day checklist
- Zigzags on straights: high Kp or low Kd; lower Kp, raise Kd.
- Flies off at sharp angles: too fast, narrow array; remember the last side, slow down.
- Motors buzz: too much Kd, noise; lower Kd, average the readings.
- Fine at home, not at the event: different light and surface; calibrate on site.
- Changes as the battery drains: voltage drop; scale the PWM by voltage.
- Slides in curves: dusty tyres, too heavy; clean, lighten, add an EDF.
Before the start: sensors 2–3 mm above the surface, all at one height, calibrated on the official track; battery charged, tyres clean, debug code off; the last working PID values saved; the robot within the size and weight limits.
Training tips
- Raise the speed only after ten mistake-free laps in a row.
- Change one parameter per test.
- Practise the tightest curve separately on a short track: that is where lines get lost.
Safety: LiPo batteries and EDF fans
Mishandled, a LiPo can swell or catch fire. Key points from the University of Pennsylvania safety checklist:
- charge a cooled battery with a quality charger, balance lead connected;
- never charge unattended, and charge in a LiPo safety bag;
- keep each cell above 3.0 V with a voltage monitor or alarm;
- store at about 3.8 V per cell;
- retire a puffed battery and keep it away from anything combustible.
EDF blades spin very fast: keep fingers clear, hold the robot firmly before switching on, tie back hair, wear safety glasses and disconnect the battery while working on it. Children should handle such robots only under adult supervision.
Frequently asked questions
How many sensors does a line follower robot need?
Two for a slow first robot; for PID, an 8-sensor array, which gives the exact line position. Keep the pitch smaller than the line width, often 15 mm.
What is a PID controller in simple terms?
A formula that turns the error into a correction: P reacts to the offset, I to its sum, D to its rate of change. On a line follower, P and D do most of the work. More terms are in our robotics glossary.
Why does my robot lose the line in sharp turns?
Usually it is too fast or the array is too narrow. Remember the last side, slow before the turn, use a wider array and improve grip.
Who can take part in Georgia's robotics championship?
Our 2026 championship was open to anyone from age 14, school teams included, in teams of 2–5, with robots running their own programs. We announce future events on our competitions page and on Facebook.
Next step
A line follower puts sensor, algorithm and mechanics in one small car, and every improvement shows on the stopwatch. Start with an Arduino, two TCRT5000 sensors, two motors and a driver (my first robot, then our line follower build guide), and move on to an array, P, and finally D.
When your robot runs clean laps, bring it to our competitions. Our next event is ROBO BATTLE 2026, on 21–28 November: see the ROBO BATTLE 2026 guide. Follow us on Facebook for the results of Kavtazi and the whole team from Bucharest.
Sources
- Line Follower: regulation, RoboChallenge
- Georgia's robotics championship: SUMO and Line Follower, GRA
- Georgia's robotics team at RoboChallenge 2026, GRA
- TCRT5000, TCRT5000L: Reflective Optical Sensor with Transistor Output, Vishay
- QTR-8A Reflectance Sensor Array, Pololu
- 3pi Robot User's Guide: Advanced Line Following with PID Control, Pololu
- Micro Metal Gearmotors, Pololu
- Lithium Polymer Battery Use Checklist, University of Pennsylvania EHRS
- Photo: Celesta IITPatna, CC BY-SA 4.0, Wikimedia Commons.




