Radio hot potato

A secret timer travels by radio between two boards: shake to throw the potato before it bursts. Learners build a game on random numbers and messages.

Go to the code ↓

Lesson at a glance

45 to 60 minutes · Grades 5 to 8

maze.education/microbit/lessons/hot-potato

Grades
Grades 5 to 8
Time
45 to 60 minutes
The CAPS gives Coding and Robotics 2 hours a week (Coding and Robotics CAPS, Grades 4 to 6, page 22; Grades 7 to 9, page 22).
Level
Some experience
For classes that have used the micro:bit and MakeCode once or twice.
Board
Any micro:bit
Code with
MakeCode blocks, with Python as an extension
CAPS
Coding and Robotics, Natural Sciences and Technology, Technology, Mathematics
Fits: Grade 7, Term 4 · Where it fits

Learning intentions

Learners will learn to:

  1. Pick a random time and count it down in steps.
  2. Send a number by radio so the game's state moves from one board to the other.
  3. Explain how two boards share one game, and why only one of them may hold the potato.

Success criteria

Each learner can say:

  • I can pick a random fuse and count it down in steps of 100 milliseconds.
  • I can send the fuse by radio so that the potato moves to the other board.
  • I can explain how two boards share one game, and why only one of them may hold the potato.

Competencies

From the Coding and Robotics CAPS places this lesson cites.

  • R.3Outline the different components of a robot
  • R.7Create, test and execute a set of robotic instructions

Key words

fuse
The secret time left before the potato bursts, in milliseconds.
random
Chosen by chance, so nobody knows how long the fuse is.
state
What the game knows right now: who is holding the potato and how much fuse is left.
message
Information sent by radio. Here the message is the number of milliseconds left.
gesture
A movement the micro:bit recognises, such as a shake.
trace table
A table that follows the value of each variable, step by step, as a program runs.

What you need

  • Two micro:bits for each pair, with USB cables and battery holders
  • A computer with Chrome or Edge for each pair
  • Sticky notes to label each pair's radio group number

From our shop: BBC micro:bit V2 Club Pack, BBC micro:bit V2.21 Next Gen Classroom Pack

Safety

  • Shake the board in your hand; never throw a micro:bit. Keep a firm grip and stay an arm's length from your partner.
  • Keep the volume low and the micro:bit away from ears. Someone may be sensitive to sudden sounds, so warn the class before the first sound plays.
  • Use the battery holder with two AAA batteries. Never mix old and new batteries, and take the batteries out before the kits are packed away.

The lesson plan

One lesson of 45 to 60 minutes in three parts: introduction, lesson development and consolidation. The CAPS gives Coding and Robotics 2 hours a week, so it fits one of the week's lessons. Times are a guide.

  1. Introduction

    5 to 10 minutes
    Retrieval practice

    What does pick random 1 to 6 do? (It chooses a whole number from 1 to 6 by chance, so nobody can predict it.)

    Problem statement

    In hot potato or pass the parcel, whoever runs the timer never gets to play, and whoever is caught can always say it was stopped on purpose. Build a two-board game in which a secret fuse travels with the potato by radio, so nobody controls when it bursts.

    1. Ask: who has played hot potato or pass the parcel? What makes it exciting? (Nobody knows when the music will stop.)
    2. Read the problem statement. Explain the plan: the micro:bit hides a random fuse time, and the potato and its fuse fly by radio to the other board each time you throw.
  2. Lesson development

    35 to 40 minutes
    1. Unplugged first. Play it with a ball of scrunched-up paper: the teacher secretly picks a number from 10 to 25 and counts down quietly. Learners pass the paper ball in a circle. At 0 the teacher says pop, and whoever holds it sits out. Ask: how did the paper ball carry the countdown? (It did not; the teacher did. On the micro:bit, the fuse travels with the potato.)
    2. Plan on paper first. Give each pair a radio group number from 0 to 255 and write it on a sticky note. Pairs write the algorithm and fill in the IPO table, with a row for each input. Learners in Grades 7 and 8 add the trace table for one throw.
    3. Predict. Ask: board 1 is shaken with 5 300 milliseconds of fuse left. What will board 2 show, and for about how long? What will board 1 show? What would happen if both boards pressed A and B?
    4. Build in blocks. Pairs share one computer. The driver builds the start, the throw and the catch from the Blocks tab, with the pair's group number instead of 12; the navigator checks each block against the IPO table. Swap roles halfway, after step 4, so the new driver builds the fuse in forever. Download it to both boards.
    5. Test and debug. Test in the simulator, which shows two boards: press A and B on one, then shake it with its SHAKE button. Does the potato move across? Did it match your prediction? If it does not arrive, check the group numbers first. Then play on real boards: when the fuse reaches 0, the holder's board shows a skull and plays a sad sound.
    6. Play best of five. Then change the game: a shorter fuse, a longer one, or a fuse that gets shorter each round. Which is most fun, and why?

    Plan on paper: a model answer

    In pairs, write the game's algorithm and fill in the IPO table. Learners in Grades 7 and 8 also trace holding and fuse on both boards through one throw.

    Algorithm
    1. When A and B are pressed together, pick a random fuse from 10 000 to 25 000, set holding to true and show the potato.
    2. Every 100 milliseconds, if holding is true, take 100 off the fuse.
    3. If the fuse reaches 0, set holding to false, show the skull and play the sad sound.
    4. When the board is shaken and holding is true, set holding to false, send the fuse by radio and clear the screen.
    5. When a number arrives by radio, set the fuse to that number, set holding to true and show the potato.
    IPO table
    InputProcessingOutput
    A and B pressed together on one boardSet fuse to a random number from 10 000 to 25 000, and holding to trueThe potato shows
    A shake while holding is trueSet holding to false and send fuse by radioThe screen clears, and the potato appears on the other board
    A number arrives by radioSet fuse to the number, and holding to trueThe potato shows
    100 milliseconds pass while holdingTake 100 off fuse, then ask: is fuse 0 or less?A flickering light; at 0, the skull and a sad sound
    Trace table
    Grades 7 and 8: one pair's two boards through a throw. The random fuse on board 1 is 10 300.
    EventBoard 1 holdingBoard 1 fuseSent by radioBoard 2 holdingBoard 2 fuse
    A and B on board 1true10 300Nothingfalse0
    About 5 seconds latertrue5 300Nothingfalse0
    Board 1 is shakenfalse5 3005 300true5 300
    About 5 seconds laterfalse5 300Nothingtrue300
    300 milliseconds laterfalse5 300Nothingfalse0: the skull shows
  3. Consolidation

    5 to 10 minutes
    1. Ask: what is sent by radio when you throw? Why send the fuse, not just a message that says 'catch'?
    2. Ask: what would go wrong if three boards shared one radio group?
    3. Back to the problem: did the game work with nobody running the timer? Is it fair, or does the player who starts lose more often? How could we find out? Learners check themselves against the success criteria.

Build it, step by step

Pairs build the program in blocks, following the numbered steps, with the same program as text beside them to check against or paste. Test in the simulator before sending it to a board.

A and B start a secret fuse of 10 000 to 25 000 milliseconds and show the potato; a shake sends the fuse by radio to the other board, and the holder's fuse drops by 100 every 100 milliseconds until a skull shows at 0.
The game's state, the fuse left, moves between boards as a radio number, so only one board holds the potato at a time.

These are the MakeCode steps. The other routes are on the lesson's web page.

Build it in MakeCode blocks

  1. Start a New Project called Hot potato. Put radio set group 12 in on start, with your pair's number.
  2. In Variables, make holding and fuse. Add on button A+B pressed: set fuse to pick random 10000 to 25000, set holding to true, and show leds with a potato shape.
  3. From Input, add on shake: if holding then set holding to false, radio send number fuse and clear screen.
  4. From Radio, add on radio received receivedNumber: set fuse to receivedNumber, set holding to true and show the potato.
  5. In forever, add if holding then: change fuse by -100, then if fuse ≤ 0 then set holding to false, show icon with the skull and play melody wawawawaa in the background. Else toggle x 2 y 4 so the potato flickers.
  6. End forever with pause (ms) 100. Test in the simulator (it shows two boards), then Download to both micro:bits.
The same blocks as text (to paste into MakeCode)
let fuse = 0
let holding = false
input.onButtonPressed(Button.AB, function () {
    fuse = randint(10000, 25000)
    holding = true
    basic.showLeds(`
        . . . . .
        . # # # .
        # # # # #
        . # # # .
        . . . . .
        `)
})
input.onGesture(Gesture.Shake, function () {
    if (holding) {
        holding = false
        radio.sendNumber(fuse)
        basic.clearScreen()
    }
})
radio.onReceivedNumber(function (receivedNumber) {
    fuse = receivedNumber
    holding = true
    basic.showLeds(`
        . . . . .
        . # # # .
        # # # # #
        . # # # .
        . . . . .
        `)
})
basic.forever(function () {
    if (holding) {
        fuse += -100
        if (fuse <= 0) {
            holding = false
            basic.showIcon(IconNames.Skull)
            music.play(music.builtInPlayableMelody(Melodies.Wawawawaa), music.PlaybackMode.InBackground)
        } else {
            led.toggle(2, 4)
        }
    }
    basic.pause(100)
})
radio.setGroup(12)

To use the text instead: open MakeCode, start a new project, click JavaScript at the top, replace what is there with this code, then click Blocks to see it as blocks.

To send it to the board, click Download. In Chrome or Edge, MakeCode can connect to the micro:bit by USB so the program goes straight onto it. Otherwise a .hex file downloads: drag it onto the MICROBIT drive.

Extension or homework

Challenges for learners who finish early, or to take further in a club or as homework.

  1. Challenge 1

    Play 20 games and record who started and who lost. Is the player who starts more likely to lose? Explain why or why not.

  2. Challenge 2

    Add a rule: you must hold the potato for at least one second before you can throw it.

  3. Challenge 3

    Race a partner in the Two-player reaction race, which also shares one game between two boards.

Support and extension

Support

For learners who need more help

  • Play with the finished program first, then build it in two parts: throwing and catching, then the fuse.
  • Use button A to throw instead of a shake, so the game can be played sitting down.

Extension

For learners who are ready for more

  • Make the potato beep faster as the fuse gets shorter, using an if on fuse.
  • Keep score: the board that did not burst adds a point, and A shows the score.

Informal assessment

Ask these as learners work. Informal assessment happens every day and is not recorded.

  1. Why do the two boards need the same radio group, and other pairs a different one?
  2. The fuse starts at 12 000 and goes down by 100 every 100 ms. Roughly how many seconds is that?
  3. Which part of the program makes the game different every time?
Exit question

What number travels by radio when you throw the potato, and why that number?

Observation checklist

Watch pairs as they plan, build and test. Write each pair's initials under the level you see.

Watch forBeginningDevelopingAccomplishedExemplary
Fills in the IPO table with a row for each input on either board.
Predicts what the second board will show before testing.
Checks the radio group first when the potato does not arrive.
Explains why the fuse, and not a catch message, is sent.
Beginning:
not yet, even with help
Developing:
with help
Accomplished:
on their own
Exemplary:
on their own, and explains it or takes it further

The four levels are the CAPS rubric levels (Coding and Robotics CAPS, Grades 4 to 6, page 176; Grades 7 to 9, page 163). The short descriptions are ours.

This lesson is not a formal task, but it is good practice for the term's practical task in Grades 4 to 6 (Coding and Robotics CAPS, Grades 4 to 6, page 170), and for the mini-PATs in Grades 7 to 9 (Coding and Robotics CAPS, Grades 7 to 9, page 157).

Common mistakes and fixes

  • Problem: The potato does not arrive on the other board.Fix: Check both boards have the same group number and were given the new program.
  • Problem: Both boards show the potato at once.Fix: Someone pressed A and B on the second board too. Only one board starts the game.
  • Problem: The potato flies back straight away.Fix: Shake once, firmly, then hold the board still to catch. In Python, keep the line that clears old shakes.

Where it sits in CAPS

  • Coding and RoboticsFitsGrade 7, Term 4: a micro:bit countdown that makes a sound when it reaches zero.Source: Coding and Robotics CAPS, Grades 7 to 9 (opens in a new tab), Grade 7, Term 4, Robotics, R.7 Create, test and execute a set of robotic instructions, page 86: When the timer reaches 0, make a sound.
  • Coding and RoboticsFitsGrade 7, Term 3: passing a message between two micro:bits by radio.Source: Coding and Robotics CAPS, Grades 7 to 9 (opens in a new tab), Grade 7, Term 3, Robotics, R.3 Outline the different components of a robot, page 79: The learners are introduced to the concept of message passing between two devices.
  • TechnologyFits Technology: a system spread over two devices that pass information to each other wirelessly.
  • MathematicsFits Mathematics: time in milliseconds and seconds, and the chance of losing as the game goes on.

Coding and Robotics quotes come from the Department of Basic Education's final CAPS, with the page number of the 2024 printed edition (the Department's October 2025 library copies number their pages differently). Schools may teach a topic in another term: the CAPS leaves the order to each school's annual teaching plan.

Ready to teach it?

Get a micro:bit for every learner or pair, and let us train your staff to run lessons like this one.

More lessons

All lessons →
  • Grades 5 to 7

    Grades 5 to 745 to 60 minLevel: Some experience

    Night light

    The micro:bit measures the light in the room and switches its own lights on when it gets dark.

    Subjects: Coding and Robotics · Natural Sciences and Technology · Natural Sciences

    Code with: MakeCodePurple MashPython

  • Grades 5 to 7

    Grades 5 to 745 to 60 minLevel: Getting started

    Thermometer

    Learners turn the micro:bit into a thermometer, compare it with the weather report and work out the difference.

    Subjects: Mathematics · Natural Sciences and Technology · Natural Sciences · Coding and Robotics

    Code with: MakeCodePurple MashPython

  • Grades 5 to 9Needs a micro:bit V2

    Grades 5 to 9Needs a micro:bit V245 to 60 minLevel: Some experience

    Is our classroom too loud?

    Learners build a sound level meter with the micro:bit V2's microphone, measure their classroom and suggest ways to make it calmer.

    Subjects: Natural Sciences and Technology · Natural Sciences · Mathematics · Coding and Robotics

    Code with: MakeCodePython

micro:bit is a trade mark of the Micro:bit Educational Foundation, and BBC is a trade mark of the British Broadcasting Corporation. Maze Education is an independent reseller of genuine BBC micro:bit products. Our teacher training and our other products and services are our own, and are not endorsed by the Foundation or the BBC.

WhatsApp