Design a distance warning: an ultrasonic sensor and a buzzer or LED that warns sooner and harder as something gets closer, tested at each band edge.
Reversing cars beep faster as they get closer to a wall. Can you build one, and prove it warns at the right distances?
Client: a family whose car has no reversing sensor. Context: a model on the bench (a ruler and a box stand in for the car and the wall).
Brief: an ultrasonic distance sensor measures in centimetres. Off when the distance is over 100 cm, beeping (blinking) from 30 to 100 cm, steady under 30 cm. Kit parts only (HC-SR04 sensor, piezo buzzer or LED); USB power.
How this lesson works: Inquire, Develop, Create, Test, Evaluate
Inquire: Read the brief: who it is for, what it must do (criteria) and the limits (constraints).
Develop: Plan before you build: parts, circuit, code and the tests you will run.
Create: Build it, first in the simulator, then for real if you have the kit. Expect a few tries; that is normal.
Test: Run your tests and record what happened, including what failed.
Evaluate: Judge it against each criterion, and say what you would change.
Make your prediction first. Help opens once you've locked it in.
InquireRead the brief: who it is for, what it must do (criteria) and the limits (constraints).
Inquire: the brief
Sort each line of the brief: a criterion (what it must do, which you can test) or a constraint (a limit you must work within)?
Off over 100 cm
Blinks or beeps from 30 to 100 cm
Steady under 30 cm
HC-SR04 sensor and a buzzer or LED from the kit
USB power
DevelopPlan before you build: parts, circuit, code and the tests you will run.
Develop: two ideas first
Before you plan one design, look at two. Most design choices are a trade: one idea is better on one criterion and worse on another, and the brief tells you which matters more.
Make them really different, not the same idea with one part changed. A quick sketch of each in your book helps.
Now two ideas of your own. For each one, say which criterion in the brief it's strongest on and which it's weakest on. Then say which you'll build, and why.
Your working
One way to write it
Idea 1: one beep rate from 30 to 100 cm. Strongest on the tests: three bands with clear edges. Weakest on use: it doesn't tell you how close you're getting inside the band. Idea 2: the beep speeds up as the distance drops. Strongest on use. Weakest on testing: the edges are harder to hear when the rate keeps changing. I'll build idea 1 first, pass every test, then add idea 2 as an improvement and run the same tests again.
Check your own working
DevelopPlan before you build: parts, circuit, code and the tests you will run.
Develop: plan before you build
On the real sensor, pulseIn measures the echo time; distance in cm ≈ time (µs) ÷ 58. Tinkercad's ultrasonic sensor lets you drag the object to set the distance.
Try it yourselfYour edits are saved in this browser.
Here the knob reading stands in for the distance in cm. Write the bands so all six tests pass.
Use the board. This ticks when you get there.
CreateBuild it, first in the simulator, then for real if you have the kit. Expect a few tries; that is normal.
Create: build it
TestRun your tests and record what happened, including what failed.
Test: run your table
Before you run yours, read someone else's. Check each result against the brief, not against what looks close enough.
If everything passed first time, pick the test that came closest to failing and write about that instead.
Pick one test that failed. Write what happened, what caused it, what you changed, and what the test showed when you ran it again.
Your working
One way to write it
Test: 30 cm. What happened: steady instead of beeping. Cause: my code said if (distance <= 30) for steady, so 30 landed in the wrong band; I checked by printing the distance and the band. Change: if (distance < 30). Re-test: 30 cm beeps and 29 cm is steady, and I ran 100 and 101 cm again in case the change broke them.
Check your own working
EvaluateJudge it against each criterion, and say what you would change.
Evaluate: Against the brief
Lesson done. You've finished every step you need.
Now you can
Plan tests for every edge of a set of bands.
Read a distance sensor and act on it.
Evaluate my design against each criterion with evidence.
A Years 8–9 design project: a parking assistant with an ultrasonic sensor and three warning bands, planned with band-edge tests, prototyped on the board, built in Tinkercad and optionally on hardware, tested with a ruler and evaluated. About 180 minutes.
I can plan tests for every edge of a set of bands.
I can read a distance sensor and act on it.
I can evaluate my design against each criterion with evidence.
Before class
The sensor code (pulseIn and ÷ 58) is new: give it as a recipe card. HC-SR04 sensors are unreliable on soft or angled surfaces and under about 2 cm; good evaluations mention it. Builds on Arduino › A small system.
If you assess with MYP Design, the steps line up with the criteria:
A Inquiring and analysing: the brief, its criteria and constraints, and research into parts (Inquire).
B Developing ideas: a design specification, the circuit and code plan, and the test table written before building (Develop).
C Creating the solution: building it (in the simulator, then for real), following the plan and justifying changes (Create).
D Evaluating: testing against the specification, recording failures, improvements and impact (Test, Evaluate).
Otherwise, use the same four headings as a simple rubric: each step's reflect checks are the evidence list.
Running the lesson
Develop: ask how many edges three bands have.
Test: rulers out; record the real distance and what the device did.
The hard part (on purpose)
Real ultrasonic readings jump around; students blame their code. Print the readings first.
When students get stuck
The readings jump around. Ask: What does the sensor read when nothing moves? Fix: Average three readings, or aim at a flat, hard surface.
Stretch and support
Stretch: Beep faster as it gets closer, with the delay worked out from the distance (map).
Support: A recipe card for reading the HC-SR04, and the band table half filled.
Where it leads
Other Years 8–9 projects: Smart plant monitor, Reaction game.
Inquire: the brief: Separating what the design must do (criteria) from the limits it works within (constraints) is the first move of any design brief.
Develop: two ideas first: Comparing two concepts against the brief's criteria before planning one gives the range of ideas the Develop stage asks for (MYP Design B), and makes the choice something a student can defend.
Develop: plan before you build: Three bands mean four edges to test; prototyping the bands on the board, with the knob as the distance in cm, gets the logic right before the sensor code.
Create: build it: Building in the simulator first catches wiring and code slips cheaply; the real build then tests the design against the world.
Test: run your table: Judging another team's results against the brief first, then running the test table written in Develop and writing up one failure, is the evidence for the evaluation.
Evaluate: against the brief: Judging the design criterion by criterion, with evidence from the tests, is what separates an evaluation from a description.