The board sends your model's label down the USB cable as a line of text. The micro:bit's program decides what each label does, and must also handle labels it doesn't expect.
A sorting machine's camera and its motors are separate parts. The camera's model only says 'Plastic'; a small controller decides which flap to move. The two have to agree on every word.
Last lesson you trained a model that labels photos. Now its labels drive a micro:bit, the same way the board's buttons did in Commands from the computer: the board sends the label as a line of text over the USB cable, and the micro:bit's program decides what to do.
You need: a micro:bit, a USB cable, and Chrome or Edge on a laptop or Chromebook (other browsers can't talk to a micro:bit). The MakeCode simulator can't receive these messages, so the board steps run on a real micro:bit.
Make your prediction first. Help opens once you've locked it in.

serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
label = serial.readLine()
if (label == "Paper") {
basic.showString("P")
} else {
basic.showString("L")
}
})
let label = ""
Click Download in the editor and copy the program to your micro:bit. Leave it plugged in. If the editor is connected to the micro:bit, disconnect it (or close that tab): only one page can use the cable at a time.

serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
label = serial.readLine()
if (label == "Paper") {
basic.showString("P")
} else {
basic.showString("L")
}
})
let label = ""
Paste your model's link and click Load, then Connect a micro:bit and choose it in the list. Click a test photo to send its label, or use the webcam: it sends a label once the same label has held above 80% confidence for a moment. Watch the micro:bit.
Connect your micro:bit and send at least three labels.
Use the board. This ticks when you get there.

serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
label = serial.readLine()
if (label == "Paper") {
basic.showString("P")
} else {
basic.showString("L")
}
})
let label = ""

serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
label = serial.readLine()
if (label == "paper") {
basic.showString("P")
} else if (label == "plastic") {
basic.showString("L")
}
})
let label = ""
Give Neither its own branch that shows a cross, and make Plastic a branch of its own too.
Change else to else if, and add a third branch: label = "Neither".
A sorter should say what it did. Make the micro:bit reply with serial write value: bin 1 for Paper, 2 for Plastic, 0 for anything else. On the board, the replies appear under the buttons.
serial write value is in Serial. Give it a name such as bin and a number.
Paper sends bin 1, Plastic bin 2, anything else bin 0.
Plastic shows L, and Neither shows a cross (show icon).
This ticks by itself when your blocks do what is asked.
The micro:bit replies with which bin it chose (bin 1, 2 or 0).
This ticks by itself when your blocks do what is asked.
A sorter on a conveyor belt is not plugged into a laptop. This is the bridge from A radio bridge: the micro:bit on the cable passes each line on by radio, and passes radio values back to the board. Add on radio received string so a second micro:bit shows the first letter of each label and replies got 1. Download the same program to both micro:bits; plug one into the computer.
On radio received string, show the first letter and send the value got 1 back.
This ticks by itself when your blocks do what is asked.
Build a sorting flap: a servo on P0 on the second micro:bit tips left for Paper, right for Plastic, and stays in the middle for anything else, then replies with the bin. Try it with your model and real items.
A servo on pin P0: servo write pin P0 to 30 for Paper, 150 for Plastic and 90 (the middle) for anything else.
After each move, send the bin back by radio: radio send value bin 1, 2 or 0.
A sorting flap: the radio label sets a servo on P0 to one angle per label, the middle for anything else, and replies with the bin.
This ticks by itself when your blocks do what is asked.
Students send their model's labels from the board to a micro:bit over USB, program the micro:bit to act on each label and reply, then pass labels on by radio to a sorting flap. About 50 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
The idea: the model sends only a word. The receiving program gives it meaning, so both sides must agree on the exact words (capital letters included), and the program needs a sensible action for anything else.
How it works: the board (in Chrome or Edge) connects to the micro:bit with Web Serial at 115200 baud, MakeCode's default. When students click a test photo, the board sends its predicted label as a line of text; with the webcam, it sends a label once it has held above 80% confidence for a moment and differs from the last one sent. Lines the micro:bit sends back (serial write value gives bin:1) appear on the board.
Hardware: a micro:bit and USB cable per pair; for Make, a second micro:bit and a small servo on P0. The MakeCode simulator cannot receive serial, so the board steps need real micro:bits. The hardware steps are marked typical, so students without hardware can still complete the lesson.
Before class: check that Chrome or Edge on student devices lists the micro:bit after Connect a micro:bit. Assign each pair a radio group.
Seeing that the model sends only a word. When the micro:bit does nothing, ask whether the board shows the label leaving and the word matches exactly.
Stretch: Count how many items go in each bin and show the totals when button A is pressed.
Support: Give the reply branch complete; students add the Neither branch only.
Next: AI on the micro:bit, a model trained on movements that runs on the micro:bit itself. Later, AI robots: a robot driven by a model, where a wrong or unsure label becomes a wrong move.