Radio messages

Boards in the same radio group send YES and NO across the room: learners build a wireless system and explore groups.

Go to the code ↓

Lesson at a glance

45 to 60 minutes · Grades 7 to 9

maze.education/microbit/lessons/radio-messages

Grades
Grades 7 to 9
Time
45 to 60 minutes
The CAPS gives Coding and Robotics 2 hours a week (Coding and Robotics CAPS, 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
Technology, Coding and Robotics
Aligned: Grade 7, Term 3 · Where it fits

Learning intentions

Learners will learn to:

  1. Send and receive messages between micro:bits by radio.
  2. Explain why boards must share a group number to talk to each other.
  3. Describe a wireless system in terms of input, process and output.

Success criteria

Each learner can say:

  • I can send a message from one micro:bit and show it on another.
  • I can explain why both boards need the same group number.
  • I can describe the system's input, processing and output.

Competencies

From the Coding and Robotics CAPS places this lesson cites.

  • R.3Outline the different components of a robot
  • D.7Present a basic understanding of the concept of input processing and output

Key words

radio
Sending information through the air with radio waves, without wires.
group
A number from 0 to 255. Boards only hear messages from boards in the same group.
transmit
To send a message.
receive
To get a message.
protocol
The agreed rules two devices use to understand each other.
trace table
A table that follows the value of each variable, step by step, as a program runs.

What you need

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

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

Safety

  • Keep USB cables tidy on the desk so nobody trips over them or pulls a laptop off the table.
  • 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.
  • Unplug the battery holder by holding its plug, never by pulling the wires.

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 do the letters IPO stand for? (Input, processing and output: what goes in, what the computer does with it and what comes out.)

    Problem statement

    On sports day, the teacher at the finish line needs to tell the teacher at the start that the lanes are clear, across a noisy field. Build a two-board radio system that sends YES and NO, and work out how to keep other pairs' messages out.

    1. Ask: how does a message get from your phone to a friend's? List the wireless things in the room: phones, Wi-Fi, Bluetooth speakers, remote controls.
    2. Read the problem statement. Explain that the micro:bit has its own simple radio, and boards in the same group number can hear each other.
  2. Lesson development

    35 to 40 minutes
    1. Unplugged first. Play radio groups: give each pair a secret group number on a card. The teacher calls out a group number and a message, and only that pair may act on it. Everyone else must ignore it.
    2. Plan on paper first. Give each pair a group number from 0 to 255 and write it on a sticky note on their desk. Pairs fill in an IPO table with a row for each input: button A, button B and a message arriving. Then they complete the trace table.
    3. Predict. Ask: if your board is in group 4 and another pair's board is in group 5, what will happen when they press A? And if two pairs both choose group 4?
    4. Build in blocks. Pairs share one computer. The driver builds the program from the Blocks tab, with the pair's own group number instead of 1; the navigator checks each block against the IPO table. Swap roles halfway, before the on radio received block. Download it to both boards.
    5. Test and debug. Press A on one board, and YES should appear on the other. Then change one board to a different group, and put two pairs in the same group. Did it match your predictions? If nothing arrives, check the group numbers first.
    6. Design a protocol: agree what three messages your pair needs (for example HELP, DONE, WAIT) and add on shake for the third.

    Plan on paper: a model answer

    In pairs, fill in an IPO table for the system, with a row for each input on either board, then complete the trace table.

    IPO table
    InputProcessingOutput
    Button A is pressedSend the string YES by radio to the pair's groupYES scrolls on the other board in the group
    Button B is pressedSend the string NO by radio to the pair's groupNO scrolls on the other board in the group
    A message arrives by radioKeep it in receivedStringreceivedString scrolls across the display
    Trace table
    What board 2 of pair 1 holds and shows. Pair 1's boards are in group 4, and pair 2's in group 5.
    EventMessage sentreceivedString on board 2Board 2 shows
    Pair 1, board 1: A pressedYESYESYES
    Pair 1, board 1: B pressedNONONO
    Pair 2: A pressedYES, to group 5NO (unchanged)Nothing new
  3. Consolidation

    5 to 10 minutes
    1. Ask: what is the input, process and output when a message is sent?
    2. Ask: why did messages get mixed up when two pairs shared a group?
    3. Back to the problem: would this system work across the sports field? The micro:bit's radio is not secret, so what should never be sent this way?

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.

Two boards in group 1: A sends YES and B sends NO, and the other board scrolls the word. A board in group 2 does not hear them.
Boards only hear messages from boards with the same group number, from 0 to 255.

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 Radio messages.
  2. From Radio, drag radio set group 1 into on start and change 1 to your pair's group.
  3. From Input, add on button A pressed with radio send string from Radio, and type YES.
  4. Add on button B pressed with radio send string NO.
  5. From Radio, drag in on radio received receivedString, and put show string from Basic inside it. Drag the round receivedString from the block's top into show string.
  6. The simulator shows two boards when you use radio. Test it there, then Download to both micro:bits.
The same blocks as text (to paste into MakeCode)
radio.onReceivedString(function (receivedString) {
    basic.showString(receivedString)
})
input.onButtonPressed(Button.A, function () {
    radio.sendString("YES")
})
input.onButtonPressed(Button.B, function () {
    radio.sendString("NO")
})
radio.setGroup(1)

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

    Send secret messages in the Morse code messenger lesson.

  2. Challenge 2

    Build a class vote in the Classroom voting system lesson.

  3. Challenge 3

    Play a game over radio in the Radio hot potato lesson.

Support and extension

Support

For learners who need more help

  • Give each pair a printed group number and the program with only the group to change.
  • Start with one message (button A) and add button B once it works.

Extension

For learners who are ready for more

  • Make a class vote: every board sends YES or NO, and the teacher's board counts each with two variables and shows the totals on A and B.
  • Use radio send number and on radio received receivedNumber to send a reading, such as the temperature, from one board to another.

Informal assessment

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

  1. What does the group number do?
  2. Which block runs when a message arrives?
  3. Two boards are in groups 4 and 5. Can they talk? Why?
Exit question

Give one way a radio message system could be used at school.

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 for both boards before building.
Sets the pair's own group number and explains why it matters.
Predicts what happens with different and shared groups, then tests it.
Designs a third message and agrees what it means with a partner.
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 7 to 9, page 163). The short descriptions are ours.

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

Common mistakes and fixes

  • Problem: Nothing arrives on the other board.Fix: Check both boards have the same group number and were both given the new program.
  • Problem: Messages from other pairs appear.Fix: Another pair is using your group number. Choose a different one from 0 to 255.
  • Problem: A Python board and a MakeCode board cannot talk.Fix: Their radio messages are made differently. Put the same version on both boards.

Where it sits in CAPS

  • Coding and RoboticsAlignedGrade 7, Term 3: sending messages 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.
  • Coding and RoboticsAlignedGrade 7, Term 3: boards on the same channel (radio group) can talk to each other. The words are in the picture on that page.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: So, it means they communicate with each other on the same channel.
  • Coding and RoboticsAlignedGrade 7, Term 3: input, processing and output in a network.Source: Coding and Robotics CAPS, Grades 7 to 9 (opens in a new tab), Grade 7, Term 3, Digital Concepts, D.7 Present a basic understanding of the concept of input processing and output, page 83: Input, processing, output, communication (networks)
  • TechnologyFits Technology: a system with an input, a process and an output, spread across two devices.

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 7 to 9Needs a micro:bit V2

    Grades 7 to 9Needs a micro:bit V245 to 60 minLevel: Confident coders

    Data logger

    The micro:bit V2 records temperature, light and sound every ten seconds; learners open the data as a table, graph it and explain the pattern.

    Subjects: Mathematics · Natural Sciences · Coding and Robotics

    Code with: MakeCodePython

  • Grades 7 to 9

    Grades 7 to 945 to 60 minLevel: Confident coders

    Fall alarm

    The accelerometer senses a fall, or the wearer presses a panic button, and an alarm goes off on a carer's board across the room.

    Subjects: Technology · Coding and Robotics · Natural Sciences

    Code with: MakeCodePython

  • Grades 6 to 9

    Grades 6 to 945 to 60 minLevel: Some experience

    Reaction timer

    Wait for the dot, then press A as fast as you can: learners time their reactions in milliseconds and analyse the class's data.

    Subjects: 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