Lesson at a glance
maze.education/microbit/lessons/morse-messenger
- Grades
- Grades 4 to 7
- Time
- 45 to 60 minutesThe 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 experienceFor 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, Social Sciences, Natural Sciences and Technology, TechnologyFits: Grade 6, Term 3 · Where it fits
Learning intentions
Learners will learn to:
- Explain how Morse code turns letters into short and long signals.
- Send a message by radio and show and sound it on another board.
- Agree a protocol (the rules for sending) so the receiver can decode the message.
Success criteria
Each learner can say:
- I can explain how Morse code turns each letter into short and long signals.
- I can send a dot and a dash by radio, and show and sound them on another board.
- I can agree a protocol with my partner and use it to decode a secret word.
- Grade 7: I can trace what the receiving board shows, and what its user writes down, for a short word.
Competencies
From the Coding and Robotics CAPS places this lesson cites.
- R.3Outline the different components of a robot
- D.8Interpret a pattern to represent or communicate a message or image
- D.9Create a pattern to represent or communicate a message or image
Key words
- Morse code
- A code that writes each letter as dots (short signals) and dashes (long signals). SOS is ... --- ...
- telegraph
- A way to send messages along wires using electricity. Telegraphs that used Morse code spread around the world from the 1840s.
- encode
- To turn a message into a code.
- decode
- To turn a code back into the message.
- protocol
- The rules both sides agree, such as a pause between letters.
- 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
- A printed Morse code chart for each pair, and paper to write the dots and dashes
From our shop: BBC micro:bit V2 Club Pack, BBC micro:bit V2.21 Next Gen Classroom Pack
Safety
- 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.
- 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.
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.
Introduction
5 to 10 minutesRetrieval practiceWhat does a red flag on a beach tell swimmers, and how does it work without any words? (It is not safe to swim. It works because everyone has agreed what the flag means.)
Problem statementLong before cellphones, urgent news crossed South Africa by telegraph in Morse code, and where there is no signal a torch or a whistle can still send SOS that way. Build a two-board Morse messenger, agree the rules for sending, and decode each other's secret words.
- Ask: how did people send urgent news across the country before phones? Show a picture of a telegraph key and a Morse chart. Tap SOS on the desk: three short, three long, three short. Ask the class to write what they heard as dots and dashes.
- Read the problem statement. Ask: what must the sender and the receiver agree before a code like this can work?
Lesson development
35 to 40 minutes- Unplugged first. In pairs, sit back to back. One learner taps a three-letter word on the desk (a short tap for a dot, a long scrape for a dash, a pause between letters). The other writes the dots and dashes and decodes it with the chart. Swap and try a longer word.
- Plan on paper first. Give each pair a radio group number from 0 to 255. Pairs fill in the IPO table, write the algorithm and agree their protocol: wait two seconds between letters, and raise a hand at the end of a word. Grade 7 learners add the trace table for the word TEA.
- Predict. Ask: when you press A, what will your own board show? What will the other board show and sound? How much longer will a dash beep than a dot?
- Build in blocks. Pairs share one computer. The driver builds the program from the Blocks tab, with the pair's group number instead of 3; the navigator checks each block against the IPO table. Swap roles halfway, after step 3, so the new driver builds the dot and the dash. Download it to both boards.
- Test and debug. Press A on one board: the other board shows a dot and, on a micro:bit V2, beeps briefly. Press B: a line and a longer beep. Did it match your prediction? If nothing arrives, check both group numbers. If a dash arrives as a dot, check the hyphen in radio send string.
- Send three secret words each, following your protocol. The receiver writes the dots and dashes, decodes them with the chart, and checks with the sender.
Plan on paper: a model answer
In pairs, fill in the IPO table for both boards, write the algorithm and agree a protocol. Grade 7 learners also trace the receiving board for the word TEA.
Algorithm
- Set the radio group to the pair's number.
- When A is pressed, send a dot by radio. When B is pressed, send a dash.
- When a dot arrives, light the centre light and beep for 150 milliseconds.
- When a dash arrives, light three lights across the middle and beep for 450 milliseconds.
- Clear the screen, ready for the next signal.
IPO table
Input Processing Output Button A is pressed Send the string . (a full stop) by radio Nothing on this board; a dot on the other Button B is pressed Send the string - (a hyphen) by radio Nothing on this board; a dash on the other A message arrives by radio If it is a full stop, light the centre for 150 ms; if it is a hyphen, light three lights for 450 ms; then clear A dot or a dash, seen and, on a micro:bit V2, heard Trace table
Grade 7: the receiving board as the sender taps TEA (- . .-), keeping to the protocol. The sender Sent by radio The receiver shows Beep (ms) The receiver's paper Presses B - Three lights across the middle 450 - Waits two seconds Nothing Nothing None - (T) Presses A . The centre light 150 - (T) . Waits two seconds Nothing Nothing None - (T) . (E) Presses A . The centre light 150 - (T) . (E) . Presses B - Three lights across the middle 450 - (T) . (E) .- Raises a hand Nothing Nothing None - (T) . (E) .- (A): TEA Consolidation
5 to 10 minutes- Ask: which letters were easy to send? Why do E (.) and T (-) have the shortest codes? (They are the most common letters in English.)
- Ask: what went wrong when you forgot the pause between letters?
- Back to the problem: what is the same and what is different between the telegraph and sending a text message today? Could your messenger carry a message where there is no cellphone signal? 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.
These are the MakeCode steps. The other routes are on the lesson's web page.
Build it in MakeCode blocks
- Start a New Project called Morse. Put radio set group 3 in on start, with your pair's number.
- From Input, add on button A pressed with radio send string "." (a full stop). Add on button B pressed with radio send string "-" (a hyphen).
- From Radio, add on radio received receivedString. Inside, add if then else if from Logic: if receivedString = "." then, else if receivedString = "-" then.
- For the dot: plot x 2 y 2 from Led, then play tone from Music with Middle E and until done. The beat menu has no milliseconds, so drop the round 0 block from Math over 1 beat and type 150.
- For the dash: three plot blocks for x 1, 2 and 3 on y 2, a short line, and play tone Middle E until done, with a 0 block from Math set to 450 over the beat. A dash lasts three times as long as a dot, as in real Morse code.
- After the if, add clear screen. Test in the simulator (it shows two boards), then Download to both micro:bits.
input.onButtonPressed(Button.A, function () {
radio.sendString(".")
})
input.onButtonPressed(Button.B, function () {
radio.sendString("-")
})
radio.onReceivedString(function (receivedString) {
if (receivedString == ".") {
led.plot(2, 2)
music.play(music.tonePlayable(330, 150), music.PlaybackMode.UntilDone)
} else if (receivedString == "-") {
led.plot(1, 2)
led.plot(2, 2)
led.plot(3, 2)
music.play(music.tonePlayable(330, 450), music.PlaybackMode.UntilDone)
}
basic.clearScreen()
})
radio.setGroup(3)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.
No Purple Mash route for this lesson
We could not find a Purple Mash unit or project that matches this lesson, so it is MakeCode blocks, with Python as an extension. These lessons have a Purple Mash route:
Extension: text-based coding, beyond the CAPS
The same program in MicroPython, for the micro:bit Python Editor. It suits Grade 7 to 9 learners who are ready for text-based code. The CAPS itself follows a block-based approach (Coding and Robotics CAPS, Grades 7 to 9, page 24).
# Morse code messenger: A sends a dot, B sends a dash, and the other board shows and sounds it.
from microbit import *
import radio
import music
radio.on()
radio.config(group=3)
DOT = Image("00000:00000:00900:00000:00000")
DASH = Image("00000:00000:09990:00000:00000")
while True:
if button_a.was_pressed():
radio.send(".")
if button_b.was_pressed():
radio.send("-")
message = radio.receive()
if message == ".":
display.show(DOT)
music.pitch(330, 150)
display.clear()
elif message == "-":
display.show(DASH)
music.pitch(330, 450)
display.clear()
sleep(20)On a micro:bit V2 the beep comes from the built-in speaker. A V1 has no speaker, so it shows the dots and dashes without sound. Both boards need the same version, MakeCode or Python.
Open the Python editor, replace the code that is there with this program (or open the downloaded file), then click Send to micro:bit. MakeCode also has a Python view, which is written a little differently.
Extension or homework
Challenges for learners who finish early, or to take further in a club or as homework.
- Challenge 1
Add a third button signal: A and B together send a slash for the end of a word.
- Challenge 2
Build a decoder: store the dots and dashes in a text variable, and when the slash arrives, show the letter for the codes you know.
- Challenge 3
Time how long it takes to send your name in Morse code, then to type it on the computer. How many times faster is the computer?
Support and extension
Support
For learners who need more help
- Give pairs a short list of easy words made from E, T, A, N, I and M, and a chart with only those letters.
- Let the sender say the letter out loud after sending it, until the receiver gets the hang of it.
Extension
For learners who are ready for more
- Show the sender what they sent too, so they can check their own message.
- Make the receiver count the signals in each letter and show the count, as a first step towards a decoder.
Informal assessment
Ask these as learners work. Informal assessment happens every day and is not recorded.
- What does a dot mean in Morse code, and what does a dash mean?
- Write your name in Morse code using the chart.
- What travels by radio when you press A?
Why do sender and receiver need to agree a protocol before they start?
Observation checklist
Watch pairs as they plan, build and test. Write each pair's initials under the level you see.
| Watch for | Beginning | Developing | Accomplished | Exemplary |
|---|---|---|---|---|
| Encodes and decodes words correctly with the chart. | ||||
| Matches each input in the IPO table to a block in the program. | ||||
| Keeps to the agreed protocol when sending. | ||||
| Checks the radio group and the characters sent when a signal goes wrong. |
- 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
- Nothing arrives on the other board.Check both boards have the same radio group and were both given the new program.
- The dash arrives as a dot.Check the text in radio send string for B is a hyphen "-", the same character the receiver checks for.
- Letters run together and cannot be decoded.Leave a two-second pause between letters, and write a space on paper at each pause.
Where it sits in CAPS
- Coding and RoboticsFitsGrade 6, Term 3: Morse code on the micro:bit, as a pattern that communicates a message.Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 6, Term 3, Digital Concepts, D.9 Create a pattern to represent or communicate a message or image, page 159:
Microcontroller with microcontroller app, e.g., road signs, morse
- Coding and RoboticsFitsGrade 4, Term 2: a pattern that stands for a message, like the CAPS beach flags. Morse code does it with short and long signals.Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 4, Term 2, Digital Concepts, D.8 Interpret a pattern to represent or communicate a message or image, page 77:
Albert uses flags to send them messages
- Coding and RoboticsFitsGrade 7, Term 3: sending a message from one micro:bit to another by radio.Source: Coding and Robotics CAPS, Grades 7 to 9, 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.
- Social SciencesGrade 4 History: communication through time, including the telegraph.Source: CAPS Social Sciences, Grades 4 to 6, Grade 4, History, Term 4: Communication through time:
How communication has changed over time, and how many forms of communication have stayed the same.
- TechnologyFits Technology: a communication system with an input, a process and an output on 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.
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.

