Microbit
Beginner
50 mins
Teacher/Student led
+55 XP

Connecting Two Micro:bits with Radio

Students program two micro:bits to talk to each other using the built-in radio, sending and receiving strings, numbers and name-value pairs, then test and debug their messages on real devices.

Teacher Class Feed

Load previous activity

    1 - Start: What We're Building ~5 mins

    Last time we saved a project we'd been building — open it now so we can keep going. Quick recap: what does it mean for two devices to communicate? Today each pair will code two micro:bits so they can talk to each other over radio: press a button on one and watch a message appear on the other. We'll predict first, then build it step by step, run it on real devices, and fix anything that misbehaves.

    2 - Predict Before You Run ~10 mins

    Before anyone runs or downloads anything, look at what we're about to build and commit to a prediction. When you press a button on one micro:bit, what do you think the other one will do? What will you see on its screen first? Say your prediction to your partner and be ready to share it.

    3 - Introduction ~4 mins

    Microbits have a radio transceiver built into them. A transceiver is an electronic device which is a combination of a radio transmitter and a receiver, hence the name. It can both send and receive radio waves using an antenna, for communication purposes.

    For this project you will need 2 Microbits so you can send and receive messages.


    4 - Create a New Project ~3 mins

    Go to the https://makecode.microbit.org website and create a new project.

    5 - Choose a Radio Group ~3 mins

    The first thing we need to do is set the radio group that our Micorbits will be broadcasting on. A radio group is the channel that the Microbit both sends it's messages and listens for other messages. A Microbit can only send or receive in one group at a time.

    A Microbit that is on radio group 2 will not be able to receive a message from another Microbit that is on radio group 3. However if they are both on radio group 3 then then we can communicate with each other.

    Add the following code to set the radio group to 1.

    radio.setGroup(1)
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more