Session 1 · 60 min
What must our gate do for every vehicle?
Before any wiring: the parts of the system (the distance sensor across the lane under the arm, the threshold that decides, the servo arm that acts) and what the gate must do for vehicles of different heights and speeds: open while a vehicle waits at the stop line, stay open while it passes, never come down on one, and close after it has gone.
The adult says first: “Today we plan. The gate must work for every vehicle.”
Learner card
- Sensor, then decide, then the arm.
- Drive up. Stop at the line.
- Go when the arm is up.
- Plan five trials.
- Guess each one first.
Key words (show each with a picture): system · trial · vehicle
Timing (15 of 60 min at the screen)
- 10 minAway from the screen: System cards: sensor, threshold, servo arm, in the order a vehicle meets them.
- 15 minAway from the screen: Role-play a real barrier: drive up with a ruler, stop at the line, go once the arm is up.
- 10 minAway from the screen: Write the pass rule; plan the five trials with a guess for each.
- 15 minAt the screen: Build the gate's blocks; with the made-up 86 the open picture never shows; try 100 to see it.
- 10 minAway from the screen: Say why the simulator cannot test the sensor.
In the studio
No studio lab or activity.
Outside the studio: MakeCode editor and its micro:bit simulator (makecode.microbit.org)
Hands-on
Nothing is powered: this session uses picture cards, toy vehicles and the simulator only. First, away from the screen, the group lines up the system cards (sensor, threshold, servo arm) in the order a vehicle meets them. On a taped road with a stop line and a gate line, the group role-plays a real barrier with no electronics: one learner is the gate, and each vehicle, pushed with a ruler, drives up, stops at the stop line and goes on only once the arm is up. Together they write the pass rule and plan five varied approach trials: low car slow, low car fast, tall van slow, tall van fast, and two vehicles one after the other (the second waiting 10 cm behind the first, and driving up to the stop line as soon as the first has passed the arm); slow and fast are how briskly the ruler pushes the vehicle on through. In MakeCode next, the learner builds the gate's blocks: “on start” opens; “forever” holds an “if then else” whose condition is “0 < 0” with “ping trig P1 echo P2 unit …” (cm) on the left and 12 on the right; then the open angle and “pause (ms)” 2000, else the closed angle; and after the “if then else”, “pause (ms)” 60, because the sensor needs about 50 ms for each measurement. To see which part runs in the simulator, the learner adds a “show leds” picture in “then” only. In the simulator the distance block always gives the same made-up number (86 in cm): it has no sensor, so it cannot measure. So with 12 on the right the picture never shows; with 100 on the right it shows: that checks the blocks, not the sensor. The picture comes out again before the real gate: in blocks, each “show leds” waits 400 ms, and the gate must check the sensor often.
Starting blocks: Built from scratch: “on start” with the open angle, and “forever” holding “if then else” whose condition is “0 < 0”, the distance in cm on the left and 12 on the right, then “pause (ms)” 60.
Evidence to collect
A prediction for each planned trial, the learner's own short test table (Trial | Vehicle and speed | My guess) for five varied trials, and the learner's spoken explanation of what the gate must do for every vehicle, and why the simulator cannot test the sensor.
Test table columns: Trial | Vehicle and speed | My guess
- Predict
- Before the simulator runs, the learner guesses whether the gate will show open or closed, and why.
- Debug
- If the simulator always shows closed, that is its made-up 86 at work: compare it with the number on the right of “<”.
- Reflect
- Which vehicle will be hardest for the gate, and why?
Works towards: Integration