You already know how a button press can make a micro:bit show something on its lights. Today the board will notice something for itself, with no button.
Hands up: if the micro:bit could react without a button, what should set it off, a shake, a tilt, or a sound?
Keep this light. Do not open MakeCode yet and do not hand out devices. Collect three or four pupil ideas and leave the choice open; pairs will follow the shake model later and may choose a small output detail.
Link to prior work: frame button-press work as a durable skill: pupils can already write an input → process → output program. Today the input comes from a sensor instead of a button. Do not name a day or a specific previous lesson title.
Nature of STEM hook (one line only): sensors let everyday devices notice the world, from a phone that rotates its screen to a washing machine that stops when the door opens.
A sensor input means the board notices something on its own, a shake, a tilt, or a sound, without anyone pressing a button.
Every short program on the board has three parts: input (what comes in), process (what the program does with it), and output (what the lights do next).
If we shake the micro:bit, what should it do, and what are those three parts?
| Concept | Why it matters | Example |
|---|---|---|
| Sensor input — something the micro:bit can notice on its own (shake, tilt or sound) without a button press | Lots of real devices react to the world around them, not only to taps and clicks | A phone turns its screen when you tilt it; shop automatic doors open when you walk up |
| Input → process → output — the three parts of a device program: what comes in, what the program does with it, and what the device does next | Naming the three parts helps you plan a program and spot which part is broken when it fails | Shake (input) → choose a face icon (process) → LEDs show the face (output) |
| Debug — find what is wrong in a program and change it so the device does what you meant | Almost no program works first time; debugging is how coders improve their work | Shaking does nothing until you notice the input block was set to button A instead of shake |
Board talk (teach two ideas live, not three up front): sketch three boxes labelled Input, Process, Output. Fill a button example together (button A → show letter → letter on LEDs). Rub out the input and ask what could replace it today. Say the two pupil-facing words as you fill the boxes: sensor input, then input → process → output. Leave debug for the live model in the next step so the class meets it when something goes wrong.
Misconception to head off: pupils may think the micro:bit "knows" what they want. Stress that it only does the steps in the program. If the input block is wrong, nothing will happen no matter how hard they shake.
Irish everyday link: sensors sit inside phones, fitness bands, shop automatic doors, outdoor lights that come on at dusk, and weather stations used around Ireland. The same idea: notice something → run a short program → do something useful.
Hardware note (teacher only): sound input needs micro:bit V2 (on-board microphone). If the class has V1 boards or mixed kits, steer pairs to shake or tilt only so a missing microphone is not mistaken for a pupil bug.
Watch the board. We will write one short program so the micro:bit reacts when it is shaken and shows a happy face. Before we run it, predict: what will you see on the LEDs when it is shaken?
On shake → show icon: happy face. Say the icon aloud before you build so predictions have a clear target. Run on a teacher micro:bit if you have one; otherwise use the MakeCode micro:bit simulator on the IWB.
Fold the class in: after each beat, ask the room: Was that the input or the output? What would you try if nothing happened? Watching is real participation; do not set a separate desk task.
If the kit is short: run the whole model on the MakeCode micro:bit simulator on the IWB. Pupils still call out predictions and debug ideas.
With your partner, build the shake program on the board steps: when the micro:bit is shaken, it shows your chosen icon. Run it and trigger the shake several times.
Find and fix at least one bug. If it works first time, change one block on purpose, swap boards with another pair, and find that bug.
Be ready to say out loud: the input was…, the output was…, the bug was…
Pairs share one micro:bit and one laptop or tablet where possible. Keep the block steps below on the IWB for the whole build.
The whole-class model and the default pair build use shake. If a pair is secure and you have time, they may try on tilt (logo up / logo down) with the same show-icon output. Sound input needs micro:bit V2 only; if boards are V1 or mixed, do not offer sound.
Look-fors: pairs who change only one thing when debugging; pairs who test after every change; language that names input and output rather than "it just went weird".
Common bugs: wrong input event; output forever so later inputs never show; program not downloaded to the board; tilt threshold awkward on tilt tasks. Prompt: Which box is broken, input, process or output?
Differentiation: support pairs with a printed three-box IPO sketch and the first block already placed on the IWB. Stretch pairs add one clear improvement idea ready for the next talk (a clearer icon, a short pause) without racing into extra features that break the build.
Safety: cables behind the desk edge; no swinging micro:bits by the lead; simulator is the fallback if a board fails.
On your Investigation Journal page, record what you built. Use these starters if you need them:
Input was… Output was… Bug was… We fixed it by… (or: We broke… on purpose and our partners found…)
Next we would…
This is the paper recording beat for the whole class. Pupils write and draw on the Investigation Journal page (InvestigationLog). They do not type into the platform. Step 4 was oral readiness only; the full write happens here.
What to record (say this; do not invent page boxes): the sensor input they used (shake, or tilt if allowed); the output the micro:bit gave; one bug and the fix; one improvement idea. A deliberate-break story counts as a valid bug note.
Board sentence starters (leave visible): Input was… Output was… Bug was… We fixed it by… / We broke… on purpose and our partners found… Next we would…
If a pair used the simulator only: they still record the same four ideas. The program is what matters, not whether a physical board was free.
Pace: about eight minutes. Circulate and push for a real bug note even when the program worked first time.
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.