Mid-year robot challenge
What you’ll do
Teams bring together everything from the first half of the year (sensors, motors, if/else, loops, line following and debugging) in one timed challenge. The aim isn’t just to win: it’s to show a design process, with testing and improvements based on evidence.
The course
START ──── line ────╮ │ (curve) ╭───────────╯ │ [box on the line = obstacle] ╰──────── line ──────── [ FINISH zone ]- Black tape line about 2 cm wide on a light floor, 3–5 m long, with at least two curves.
- One box placed on the line: the robot must stop before touching it (or detour round it for bonus points).
- A finish zone marked with coloured tape or a black bar across the line.
Rules
- Teams of 2–4. Each team gets 3 runs; the best run counts.
- The robot must be autonomous: no touching or remote control after the start.
- Time limit: 2 minutes per run.
- Between runs teams get 5 minutes to change code or hardware, and must write down what they changed and why.
- A run ends when the robot reaches the finish, leaves the line for more than 5 seconds, or time runs out.
Scoring
| Achievement | Points |
|---|---|
| Follows the line past the first curve | 10 |
| Reaches the obstacle without losing the line | 10 |
| Stops before touching the obstacle | 15 |
| Detours round the obstacle and re-finds the line | +20 bonus |
| Reaches the finish zone | 20 |
| Stops in the finish zone | 10 |
| Time bonus: finished under 60 s | +10 |
| Engineering log (see below) | up to 25 |
The engineering log
For each run, the team records: what they changed, what they expected, what happened (with numbers), and what they’ll try next. This is worth as much as most of the course: good engineers learn from every run.
Example: a strong engineering log
| Run | Change since last run | Expected | Result | Next |
|---|---|---|---|---|
| 1 | — (first run) | Finish | Lost line at 2nd curve, 34 s | Lower speed on curves |
| 2 | Turn speed 40 → 60 (only change) | Hold the curve | Held curve; touched the box | Stop distance 10 → 15 cm |
| 3 | Stop distance 15 cm (only change) | Stop before box | Stopped at 13 cm, 41 s, 65 pts | Try a detour next term |
Example: scoring a run
A robot follows the first curve (10), reaches the obstacle (10), stops in time (15) but doesn’t continue: 35 points, plus a log score of 20 = 55.
Example: teacher’s timetable for one session
| Time | Activity |
|---|---|
| 0:00 | Rules briefing, teams check robots |
| 0:10 | Run 1 for every team |
| 0:25 | 5-minute improvement window |
| 0:30 | Run 2 |
| 0:45 | Improvement window, then Run 3 |
| 1:05 | Results and 2-minute reflections from each team |
Practise the parts in the simulator
Line following:
Robot commands
motors(left, right): wheel power, −100 to 100lineLeft(),lineRight():trueover the black linedistance(): cm to the nearest thing ahead (max 200)distanceLeft(),distanceRight(): cm to the sideslinePosition(): where the line is, −1 (left) to 1 (right), ornullmillis(): milliseconds since Runprint(value): show a message belowsetup()runs once;loop()runs 50 times a second
Stopping before an obstacle:
Robot commands
motors(left, right): wheel power, −100 to 100lineLeft(),lineRight():trueover the black linedistance(): cm to the nearest thing ahead (max 200)distanceLeft(),distanceRight(): cm to the sideslinePosition(): where the line is, −1 (left) to 1 (right), ornullmillis(): milliseconds since Runprint(value): show a message belowsetup()runs once;loop()runs 50 times a second
Plan your runsEasy
Before the challenge, write which one setting you’ll change if the robot loses the line, and which if it hits the box.
Combine the behavioursMedium
Write pseudocode that follows a line and stops when something is closer than 15 cm.
Show an answer
forever: if distance < 15: stop else if left sensor sees line: turn left else if right sensor sees line: turn right else: go straightGo for the bonusHard
Plan a detour: after stopping, turn right, arc left round the box, and stop arcing when a line sensor finds the line again. See the rescue robot project for a state-machine version.
Quick check
Finished this lesson?