GRADE 7 · COMPUTING · UNIT 6 · LESSON 6.12

Sequencing and pattern recognition: Getting the message across

Final project: Sound-triggered visual alarm

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

8 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Final project: Sound-triggered visual alarm

Book extension, project or review · original companion practice

Design the sound-triggered visual alarm from explicit requirements: input rule, placement, images, brightness, timing and return to monitoring. A prototype helps investigate the design; a loudness trigger does not recognise the identity of a school buzzer.

Today’s two goals
  • Specify a sound-triggered visual alarm using a flowchart, a light-sequence sub-routine and numbered image grids.
  • Implement the planned prototype in MicroPython and flash it to suitable hardware.
Original PaxaKids illustration for Final project: Sound-triggered visual alarm. Precise program text and data are supplied in the workbook models.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Explore the clues

Tap one card to find out more.

Understand the idea

Design the sound-triggered visual alarm from explicit requirements: input rule, placement, images, brightness, timing and return to monitoring. A prototype helps investigate the design; a loudness trigger does not recognise the identity of a school buzzer.

Concept to practise: Final project: Sound-triggered visual alarm.

Work through an example

The original starter activates when a micro:bit V2 microphone reading is greater than 150 on its relative 0–255 scale. Exactly 150 does not activate it. These readings are not decibels, and the simple routine does not sample while waiting.

Try before your workbook

Which boundary and timing cases should you include before claiming that the alarm matches your specification?

Check my readiness thinking

Test below, equal to and above the threshold, no trigger, a sound during the busy sequence and a possible retrigger afterward. Record actual revision and results. Specify any change to sampling or trigger policy; do not claim buzzer recognition from loudness alone.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Design a visual signal for the classroom

Pupils wearing headphones may miss the break-time buzzer. Your project is an early classroom prototype that responds to sound with a visible LED sequence. Use it to investigate requirements, reveal problems and improve the design.

Plan where the board will be placed, what the sound input means, and which light patterns, brightness settings and timings suit the intended viewers.

Make the requirements concrete

Make the requirements concrete — original model
DecisionWhat your specification must identify
TriggerA sound-input rule and a classroom test sound representing the buzzer.
LocationWhere the board will hear the test sound and be visible to pupils.
SequenceA named routine, ordered images or letter grids and the final state.
Brightness and timingExact 0–9 digits and waits in milliseconds for each image.
Inactive behaviourWhat happens before activation and without the trigger.
Further activationsWhether sustained or repeated sounds should start another sequence.

Plan the input, selection and named routine

The original starter uses a micro:bit V2 microphone and the rule level > 150 on its relative 0–255 scale. It repeatedly samples outside the light routine. A reading exactly 150 does not activate this rule.

    Decision: level > threshold?

    True branch
    1. light_sequence
    False branch
    1. Clear display

    Number every image and its brightness grid

    These grids illustrate one possible design: an exclamation mark at setting 3, then 9, then a blank frame, with 500 ms after each. You may design a different sequence, word or image when it is fully specified and tested.

    Each five-by-five table gives exact LED brightness digits: 0 is off; 9 is maximum. Rows run top to bottom and columns left to right.

    Example frame 1
    Row / column12345
    100300
    200300
    300300
    400000
    500300
    Example frame 2
    Row / column12345
    100900
    200900
    300900
    400000
    500900
    Example frame 3
    Row / column12345
    100000
    200000
    300000
    400000
    500000

    Edit the complete original project starter

    Open FinalProjectStartingCode_Paxa.py. Replace all three all-off frame definitions with your numbered grids. Keep a matching routine name and update the trigger/timing policy if your specification requires it.
    Original program model
    from microbit import *
    
    TRIGGER_LEVEL = 150
    frame_1 = Image("00000:00000:00000:00000:00000")
    frame_2 = Image("00000:00000:00000:00000:00000")
    frame_3 = Image("00000:00000:00000:00000:00000")
    
    def light_sequence():
        display.show(frame_1)
        sleep(500)
        display.show(frame_2)
        sleep(500)
        display.show(frame_3)
        sleep(500)
        display.clear()
    
    display.clear()
    while True:
        level = microphone.sound_level()
        if level > TRIGGER_LEVEL:
            light_sequence()
        else:
            display.clear()
        sleep(30)

    Plan tests before coding; record observations after

    Complete FinalProjectTestPlan_Paxa.docx to match your own flowchart. First trace the plan using specified inputs. Then test the saved program and enter actual results separately.

    Use micro:bit V2 for the built-in microphone. A V1 board needs a suitable external sound sensor and changed input code. A button/shake adaptation is a separate preparation activity.

    The simple starter does not sample while its routine is waiting. When sound remains above the threshold, a later sample can start another sequence. A short sound occurring entirely between samples can be missed. Check whether that behaviour fits your requirement.
    Plan tests before coding; record observations after — original model
    CheckWhat to specify and compare
    Trigger / no triggerIntended sound, background sound and any numeric boundaries.
    Sequence / completionEvery grid, brightness, order, wait and final display state.
    Repeated input / visibilitySustained or repeated sound; viewing position and lighting.

    Practice files for this lesson

    Save a copy of these original PaxaKids learner files before editing in suitable software. Some code and datasets deliberately need completion or repair. Downloading a file does not run it. Use invented data; record actual tests separately from predictions. Native software practice files are not print-optimised; use the student PDF for printing.

    Paxa the Fox

    Try one step with Paxa!

    Use supplied fictional records. Do not disclose personal details, upload private photos or bypass browser warnings to complete an activity. Save personal responses before leaving.

    Our Unit 6 learning path
    1. Lesson 6.1: Prototyping
    2. Lesson 6.2: Pattern recognition
    3. Lesson 6.3: Patterns between text-based programming languages
    4. Lesson 6.4: Boolean selection and sub-routines
    5. Lesson 6.5: Project plans and test plans
    6. Lesson 6.6: Identifying errors and debugging
    7. Lesson 6.7: Sequences and lights
    8. Lesson 6.8: Creating a moving sequence of lights
    9. Lesson 6.9: Extending a light sequence
    10. Lesson 6.10: Light brightness
    11. Lesson 6.11: Loading-screen and name-sequence extensions
    12. Lesson 6.12: Final project: Sound-triggered visual alarm
    13. Lesson 6.13: Evaluation
    14. Lesson 6.14: What can you do?
    For grown-ups: using this lesson

    Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

    Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

    2. Fill in your workbook

    Read the teaching and the complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

    Final project: Sound-triggered visual alarm8 student pages · original artwork

    Opening your PDF…

    Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

    TAKE YOUR PRACTICE OFFLINE

    3. Download the student worksheet

    All 8 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

    Student worksheet only · PDF · 8.3 MiB · No answer key included

    Download worksheet PDF ↓

    TRY FIRST, THEN CHECK TOGETHER

    Download the student worksheet →

    4. Answers & guidance

    Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

    Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

    Show answers for all 8 worksheets

    Worksheet 1

    1. Question 1: What is the purpose of this prototype? test and improve a proposed classroom visual alert
    2. Question 2: Which input is required for this final project? a sound sensor

    Worksheet 2

    1. Question 3: Does an ordinary sound-level threshold uniquely recognise the buzzer? no; other sounds can also cross it

    Worksheet 3

    1. Question 4: For the starter threshold 150, which reading activates? 151

    Worksheet 4

    1. Question 5: What makes a different learner sequence acceptable? a clear purpose, complete grids and agreement between plan, source and tests

    Worksheet 5

    This page introduces the activity. There are no marked responses on this sheet.

    Worksheet 6

    This page introduces the activity. There are no marked responses on this sheet.

    Worksheet 7

    1. Question 6: Write a short paragraph explaining the meaning and purpose of your prototype for the classroom problem. Create the main flowchart with sound input, explicit True/False branches and a named light-sequence subroutine. Number every image and provide its complete five-by-five brightness grid, timing and final state. Complete the editable test plan and apply it to the flowchart before coding. Identify the saved planning files, findings and any correction. Retain source1 and2a–c: original prototype explanation tied to headphone users/classroom break signal, sound-triggered plan with named routine, all numbered image grids and expected tests applied to the flowchart. Specify intended test sound, location, trigger/API, brightness0–9, timings, inactive and repeated-input policy. Sound threshold is not buzzer identity recognition. Correct symbols, branch labels, call/return, row order and exact digits. Tests cover relevant inputs and expected behaviour, with plan-trace findings labelled separately from actual device results. No invented official learning outcomes or numeric scores. Grown-up review; personal evidence is required.

    Worksheet 8

    1. Question 7: Edit FinalProjectStartingCode_Paxa.py to implement your plan and save the source revision. Connect suitable hardware and flash it. Apply the same test plan to the program and compare it with your flowchart: record actual sound input, all output stages, brightness/timing, final state and repeated/inactive behaviour. Test the intended sound and background noise, then document errors, corrections and retests if needed. Identify the final files and evidence; mark unavailable practical steps Pending. Retain source3a–c: original starter edited to match the learner specification, actual compatible flash, test-plan comparison and correction/retest. Require suitable sound hardware: V2 built-in microphone, or a tested named external-sensor adaptation with changed code; button/shake alone does not meet this final sound requirement. Complete visible sequence and exact source/plan/grid agreement. Actual data and observations with method/revision, or honest Pending. For unmodified strict >150 rule:149/150 inactive,151 active; sustained high can retrigger after the blocking sequence. Do not claim unique buzzer recognition or guaranteed classroom visibility. Correct actual faults if present; no need to invent an error in correct work. No numeric scores. Grown-up review; personal evidence is required.
    Back to my workbook ↑

    Curriculum & workbook reference

    Computing for your homeschool day

    Explore Final project: Sound-triggered visual alarm with this free Grade 7 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

    Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

    Understand your results

    Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

    Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

    For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

    The book pages identify the related teaching topic. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

    Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.