Design a reaction timer: an LED lights after a random wait, the player presses a button, and the game shows their time in milliseconds, fairly.
Who in the class has the fastest reactions? To find out fairly, the game has to stop people guessing when the light will come on.
Client: the class, for a lunchtime competition. Context: two players take turns.
Brief: after a random wait of 2 to 5 seconds an LED lights; the player presses a button; the game shows the reaction time in ms. Pressing before the light is a false start and must be caught. Kit parts only; USB power; it must explain itself on the serial monitor or an LCD.
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)?
Waits a random 2 to 5 s before lighting
Shows the reaction time in ms
Catches a press before the light (false start)
Kit parts only
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: B's millis() loop, with the time on the serial monitor. Strongest on false starts: it watches the button the whole time. Weakest on explaining itself without a laptop. Idea 2: the same loop with an LCD. Strongest for a lunchtime game nobody has to set up. Weakest on parts: more wiring to go wrong. I'll build idea 1 first, because catching false starts is the hard criterion, then add the LCD once every test passes.
Check your own working
DevelopPlan before you build: parts, circuit, code and the tests you will run.
Develop: plan before you build
Put the game's loop() in order.
Pieces (click to add)
Your program
The LED lit at millis() = 41200 and the button was pressed at 41487. What is the reaction time in ms?
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: false start 3. What happened: it showed 0 ms instead of "Too soon!". Cause: I only checked for an early press once, at the start of the wait, so a press near the end slipped through; I checked by pressing late on purpose. Change: check the button on every pass of the waiting loop. Re-test: ten more false starts at different times, all caught, and the ten normal rounds still fine.
Check your own working
EvaluateJudge it against each criterion, and say what you would change.
A Years 8–9 design project: a fair reaction timer with a random wait, a button and millis(), planned as an ordered loop with a false-start test, built in Tinkercad and optionally on hardware, tested and evaluated. About 150 minutes.
random(2000, 5001) and millis() are new: give them as a recipe card. A first version with delay() for the wait cannot catch false starts; that limitation is a good Evaluate point and a reason for the millis() version.
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 the game could know about a press during the wait.
Test: the class tries to cheat it.
The hard part (on purpose)
The false start is the hard part: it needs the button checked during the wait, not delay(). Let students meet the problem with delay() first.
When students get stuck
False starts are never caught. Ask: Is the button read while the game is waiting? Fix: Wait in a loop that checks millis() and the button, not one long delay().
Stretch and support
Stretch: Keep the best time of the session, and show a two-player result.
Support: A recipe card for random and millis, and the loop with the false-start check given.
Where it leads
Other Years 8–9 projects: Smart plant monitor, Parking assistant.
What each step is for
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: Putting the game loop in order and tracing its timing plans the logic; the false-start check is the part most designs forget.
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.