Skip to content

Robotics

Teaching material for the robotics lesson of Part 2: AI & Science — "A rover learning on an exoplanet". Students program a micro:bit rover with an AI co-pilot: first calibrating basic movement, then building a Q-learning grid simulation, and finally deploying it on a Cutebot.

Lesson material

Which version do I need?

The student version is the worksheet you hand out. The teacher version is the same lesson including the worked answers, for your own preparation.

Backup and solution files are a last resort

Give a group the backup/solution files below only if they are genuinely stuck after trying with the AI co-pilot first — struggling productively with the AI is the point of the lesson.

Assignment 1 — Calibration

Backup solutions for the three calibration tasks (drive forward, turn 90°, walk a square). Copy-paste only as a last resort.

Assignment 2 — RL grid

What students receive

Code_RL_grid_TO_ANNOTATE.docx is the file to print and hand to students: the RL grid code with blank space for them to annotate each block. Everything else in this section is a backup or teacher resource.

Q-values notebook

A notebook with pictures and a simulation of how Q values evolve throughout learning — useful to walk through with the whole class.

Click Open in Colab to run it in your browser without installing anything, or download the .ipynb file to run it locally.

Run it Download
Open in Colab .ipynb

Assignment 3 — Cutebot

  • cutebot.py — required library; add this to the micro:bit project before the RL code.
  • RL_cutebot.hex — ready-to-flash version of the full RL + line-following Cutebot code, in case a group's save fails.
  • RL_cutebot.py — the plain source, as a copy-paste backup.