A web page and a micro:bit talk over USB and radio. Graph a micro:bit's sensors, send it commands, relay messages by radio, train models on photos and on movements, and finish with an AI sorter of your own.
Each lesson works two ways. Students can work through the online tutorial at their own pace (it checks their answers and saves their progress in their browser), or you can teach it to the whole class from the slides, then send students into the tutorial for the Modify and Make steps.
Every lesson guide has plain-language notes, the answers to every check, a solution for every task, and slides and a worksheet for Waypoints Prepare. These guide pages are not linked from student pages, but they are not secret either: keep printed Teacher editions for answers you do not want students to find.
Whole-course cheat sheet: Open to print (every command, grouped by unit: a handout for the final challenge)
The micro:bit sends readings to the computer as lines of text, and the computer sends it commands.
A micro:bit plugged into a computer can send and receive text, one line at a time, down the USB cable. This is called serial.
light:128. Whatever is listening (MakeCode's Show data, the board on the lesson page, a spreadsheet) turns the lines into a table or graph.happy is not Happy.Science data loggers, 3D printers, laser cutters and robot arms all talk to computers this way: short lines of text, one command or reading per line. It is the simplest way for two programs on different devices to work together.
Serial is like passing notes along a desk: one note at a time, each finished before the next. Where it breaks: a note in a language the reader doesn't know (a word the program doesn't check for) is ignored, and if the cable is in use by another page (MakeCode connected in another tab), no one else can pass notes.
The radio bridge passes these lines on by radio, and the AI lessons send a model's labels the same way.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
A micro:bit on the cable relays messages by radio, so the micro:bit doing the work can be anywhere in the room.
A micro:bit on a USB cable can't go far. A bridge micro:bit stays plugged into the computer and relays:
Both micro:bits need the same radio group, and a micro:bit never hears its own radio messages.
Smart-home hubs, farm sensor networks and wildlife cameras all send readings by radio to one hub, which passes them on to a computer or the internet. The hub is a bridge.
A bridge is an interpreter between two people who speak different languages: one by phone (radio), one by note (serial). Where it breaks: if the two micro:bits are in different groups, the interpreter can't hear; if three people share one group, they all talk at once.
The AI lessons send a model's labels through this bridge to a sorting flap or a robot.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Train a model in Teachable Machine, test it on photos it has never seen, then send its labels to a micro:bit.
A model learns to sort things from examples you give it, not from rules you write. In Teachable Machine you give it photos for each class (Paper, Plastic), click Train, and it learns patterns in the photos.
Some jobs have no simple rules: what makes a photo "plastic"? Models learn patterns from examples. Recycling sorters, photo apps and medical scanners all work this way, and all have to be tested before they are trusted.
A model is a student who learned from one textbook's pictures: great on questions like the textbook, lost on anything different. Where it breaks: unlike a student, it can't tell you it's guessing, so you have to test it.
The model's labels then drive a micro:bit; CreateAI does the same with movements; the capstone does it all on a problem you choose.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Train a model on movements with micro:bit CreateAI; it runs on the micro:bit itself, and the Machine Learning blocks act on what it recognises.
micro:bit CreateAI trains a model on movements instead of photos. A movement is a short recording (about a second) of the micro:bit's x, y and z acceleration. You record samples of each action (still, walking, running, jumping), train, and test.
Fitness trackers, fall detectors and game controllers all run small models on the device itself: faster, private, and working without a connection.
It's like recognising a friend's walk from across the playground: the pattern matters, not one moment. Where it breaks: someone who walks differently, or holds the micro:bit differently, looks like a stranger until you add their samples.
The photo model ran on the computer and needed the cable; this one runs on the micro:bit. The capstone chooses the right kind for a problem.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Choose a sorting problem, build a fair test set, train and improve a model, connect a micro:bit build, and report its limits.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Self-paced briefs students can pick up after the lesson named on each. Students tick their own milestones and claim a badge; the page lights the skills their code uses. Badges stay in the student's browser: ask them to press Show your teacher. Open the projects page
Build both ends of a micro:bit gadget: the micro:bit measures something (light, temperature, movement) and sends it, and your own web page shows it live, changes how it looks when the reading crosses a line you choose, and has a button that sends the micro:bit a command.
The page talks to the micro:bit with microbit.js, which is already in the starter. In this preview it opens a pretend micro:bit (type the lines it would send). For the real thing, download the page and open it in Chrome or Edge with the micro:bit plugged in.
Milestones:
A crossover: the micro:bit half needs lessons 1 and 2 of this course; the page half needs the DOM course (events, textContent, style), or Make it react from HTML & CSS for the basics. Students who have only done one half can pair with someone who has done the other.
The playground preview cannot use USB (it is sandboxed), so microbit.js opens a pretend micro:bit there: a panel to type lines such as temp:30, which also shows what the page sends. The real micro:bit needs the downloaded page in Chrome or Edge, and MakeCode must not be connected to the micro:bit in another tab.
basic.forever(function () {
serial.writeValue("temp", input.temperature())
basic.pause(1000)
})
serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
command = serial.readLine()
if (command == "alarm") {
basic.showIcon(IconNames.Skull)
} else if (command == "ok") {
basic.clearScreen()
}
})
let command = ""
<style>
body { font-family: sans-serif; }
#reading { font-size: 48px; margin: 10px 0; }
</style>
<h1>Classroom temperature</h1>
<button id="connect">Connect</button>
<button id="alarm">Sound the alarm</button>
<p id="reading">No reading yet</p>
<script src="microbit.js"></script>
<script>
document.querySelector("#connect").addEventListener("click", microbit.connect);
microbit.pretend(["temp:21", "temp:30"]);
microbit.onValue(function (name, number) {
if (name === "temp") {
document.querySelector("#reading").textContent = number + " °C";
document.body.style.background = number > 25 ? "#ffd6d0" : "white";
}
});
document.querySelector("#alarm").addEventListener("click", function () {
microbit.send("alarm");
});
</script>