Lesson at a glance
maze.education/microbit/lessons/classroom-sound-meter
- Grades
- Grades 5 to 9
- 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
- micro:bit V2 onlyThis lesson needs a micro:bit V2, for its microphone.
- Code with
- MakeCode blocks, with Python as an extension
- CAPS
- Natural Sciences and Technology, Natural Sciences, Mathematics, Coding and RoboticsFits: Grade 6, Term 1 · Where it fits
Learning intentions
Learners will learn to:
- Read the micro:bit V2's microphone and show the sound level as a bar.
- Measure and compare sound levels during different activities.
- Use evidence to suggest changes that make a classroom calmer.
Success criteria
Each learner can say:
- I can program the micro:bit V2 to show the sound level as a bar, and a sad face above 128.
- I can measure the sound level during three activities, three times each, and record it in a table.
- I can use our measurements to back up a change that would make the classroom calmer.
- Grades 7 to 9: I can trace level through the loop and say what the display shows at 128 and above it.
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
- microphone
- A sensor that picks up sound. The micro:bit V2 has one built in.
- sound level
- The micro:bit's measure of loudness, from 0 (silent) to 255 (very loud). It is not in decibels.
- threshold
- The value where a decision changes, such as too loud above 128.
- echo
- Sound bouncing back off hard surfaces like bare walls, floors and windows.
- evidence
- Measurements that support an idea.
- trace table
- A table that follows the value of each variable, step by step, as a program runs.
What you need
- A micro:bit V2 for each group (the V1 has no microphone), with a USB cable and a battery holder
- A computer with Chrome or Edge for each group
- A results table with rows for silent reading, group work and a class discussion
From our shop: BBC micro:bit V2 Go, BBC micro:bit V2.21 Next Gen Classroom Pack
Safety
- Measure everyday sound only. Do not shout or bang near anyone's ears to get a high reading.
- 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.
Introduction
5 to 10 minutesRetrieval practiceWhat is a sensor? (A part that measures something in the world, such as light, temperature or sound, and gives the program an input.)
Problem statementIn a full classroom with bare walls and a hard floor, group work can get so loud that learners struggle to hear each other or the teacher. Build a sound meter with the micro:bit V2, measure the room during different activities, and use the evidence to suggest how the school could make it calmer.
- Ask: when is our classroom too loud to think? What does it feel like by the last lesson of the day?
- Read the problem statement. Explain that sound bounces off hard surfaces. Clap once in the classroom and once outside: which clap seems to last longer?
Lesson development
35 to 40 minutes- Unplugged first. Sit in silence for 30 seconds and list every sound you hear. Sort the list: sounds from inside the room or outside, from people or from things. Which could the class change, and which not?
- Plan on paper first. Groups fill in the IPO table for the sound meter and write its algorithm. Learners in Grades 7 to 9 add the trace table for four passes of the loop.
- Predict. Ask: what will the display show for a sound level of 100? Of exactly 128? Of 129? Which of our three activities will light the most of the bar? Groups write their predictions at the top of the results table.
- Build in blocks. Two learners in each group build at a time. The driver builds the meter from the Blocks tab; the navigator checks each block against the algorithm, especially the 128 in two places. Swap roles halfway, after step 3, so two others take over.
- Test and debug. Test in the simulator with its sound control: drag it past 128 and back. Did it match your predictions? Then download it to a micro:bit V2 and whisper, talk and clap. The microphone listens through the small hole on the front, next to the logo. If the bar never moves, check that the board is a V2.
- Groups record how many rows of the bar light up during silent reading, group work and a class discussion, three times each, with the board in the same place every time. If you can, measure another space at school, such as the hall or the library, at a quiet time.
- Groups suggest two changes that could make the room calmer, and name the measurement that supports each one.
Plan on paper: a model answer
In groups, fill in the IPO table for the sound meter and write its algorithm. Grades 7 to 9 also trace level through four passes of the loop.
Algorithm
- Read the sound level from the microphone into level.
- If level is more than 128, show the sad face.
- Otherwise, show level as a bar graph that is full at 128.
- Go back to step 1, forever.
IPO table
Input Processing Output Sound reaching the microphone Read the sound level (0 to 255) into level, then ask: is level more than 128? More than 128: a sad face. Otherwise: a bar that grows with the sound Trace table
Grades 7 to 9: four passes of the forever loop as the room gets louder. The levels are examples. Pass In the room level level > 128? The display shows 1 Silent reading 20 No A short bar at the bottom 2 Group work 64 No About half the bar 3 A class discussion 128 No The full bar 4 Someone claps 200 Yes The sad face Consolidation
5 to 10 minutes- Compare the results. Which activity was loudest? Was anyone surprised?
- Ask: why can we compare our numbers with each other, but not with decibel readings from a sound meter app?
- Back to the problem: which change would you suggest to the school first, and which measurement backs it up? Talk about what soaks up sound: curtains, pinboards, carpets and soft panels. See how schools do this on our Spaces page, or read how to check a classroom's echo with a clap. 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 and make a variable called level in Variables.
- In forever, add set level to with sound level from Input (it is in the micro:bit (V2) group).
- From Logic, add an if then else: if level > 128.
- In the then part, put show icon with the sad face.
- In the else part, put plot bar graph of from Led, with level and up to 128.
- Test in the simulator with its sound control, then Download to a micro:bit V2.
let level = 0
basic.forever(function () {
level = input.soundLevel()
if (level > 128) {
basic.showIcon(IconNames.Sad)
} else {
led.plotBarGraph(level, 128)
}
})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).
# Is our classroom too loud? A sound level bar, and a sad face above 128 (micro:bit V2).
from microbit import *
while True:
level = microphone.sound_level()
if level > 128:
display.show(Image.SAD)
sleep(600)
else:
rows = level * 5 // 128
for y in range(5):
for x in range(5):
if y >= 5 - rows:
display.set_pixel(x, y, 9)
else:
display.set_pixel(x, y, 0)
sleep(100)MicroPython has no bar graph block, so the Python version lights whole rows from the bottom: the louder the room, the more rows.
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
Graph a whole lesson's sound in the How loud is our classroom? A sound graph lesson.
- Challenge 2
Count how many times in five minutes the room goes over your threshold, with a variable and on loud sound.
- Challenge 3
Compare the same activity in two rooms, one with soft things on the walls and one without.
Support and extension
Support
For learners who need more help
- Give groups a table with the activities already filled in, and ask them only to count the rows that light up.
- Use one board for the whole class, held up where everyone can see it, and record together.
Extension
For learners who are ready for more
- Record the sound level every few seconds with the data logger (see the Data logger lesson) and draw a line graph of a whole lesson.
- Find a threshold that suits your class: which number is loud enough to need a reminder?
Informal assessment
Ask these as learners work. Informal assessment happens every day and is not recorded.
- What range of numbers does the micro:bit's sound level use?
- What will the display show if the level is exactly 128, and why?
- Which activity was loudest in your results, and by how much?
- Why did we repeat each measurement three times?
Which change would you suggest for our classroom, and which measurement supports it?
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 |
|---|---|---|---|---|
| Fills in the IPO table: sound in, a comparison with 128, a bar or a face out. | ||||
| Builds the if then else with 128 in both places, as driver or navigator. | ||||
| Measures fairly: the same distance and place, three times for each activity. | ||||
| Backs up a suggestion with a measurement from the results table. |
- 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
- The bar never moves.You need a micro:bit V2: look for the gold logo on the front and the small microphone hole. A V1 has no microphone.
- The sad face shows all the time.Something near the board is noisy, or the threshold is too low for your room. Try 150.
- Our numbers are different from another group's.Distance matters: keep the board the same distance from the people talking, and in the same place each time.
Where it sits in CAPS
- Coding and RoboticsFitsGrade 6, Term 1: the microphone is a sound sensor, an input the program can measure.Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 6, Term 1, Robotics, R.3 Outline the different components of a robot, page 132:
Sound sensors (microphones) allow the robot to perceive
- Coding and RoboticsFitsGrade 6, Term 3: a program that reacts to sound (the CAPS sound-controlled light pole).Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 6, Term 3, Robotics, R.7 Create, test and execute a set of robotic instructions, page 155:
Develop a project to turn on the light and set off the alarm when you clap your hands.
- MathematicsGrades 5 and 6 Mathematics: interpreting data and making predictions from it.Source: CAPS Mathematics, Grades 4 to 6, Section 3, topic 5.3 Analysing, interpreting and reporting data (Grades 5 and 6):
making predictions based on the data
- Natural Sciences and TechnologyFits Natural Sciences and Technology, Energy and Change: sound, and how it travels and reflects.
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.

