Skip to content
Tactiverge

BUILD 005: Build a Traffic Management System

Facilitator guide · 60 minutes · free to reuse with attribution

The objective

Design the controller for a virtual crossroads as a state machine: choose the states and transitions, guarantee that conflicting directions are never green together, fit in pedestrian crossings, and let an emergency vehicle take priority safely.

Safety. Browser simulation and paper design only. Never stand in a road or junction to observe or count traffic, and never touch traffic signals, control cabinets or street equipment; observe only from a safe place with an adult. Any physical extension needs an adult's safety review and supervision before anyone starts.

Before the session

  • Open /build/traffic-system/?level=2 and build a safe cycle yourself until the audit passes; note which rule the starter breaks first.
  • Open level 3 and play the default plan at 12× so you have seen the north–south queue grow and an ambulance wait.
  • Decide teams of three in advance. Learners who join alone can pair with the facilitator.
  • Check the live room link works, chat is off and the moderated question box is on.

Run of show

  1. 5 minHook. Show the crossroads with a pedestrian and an ambulance waiting. Ask: who goes first, and what must never happen?
  2. 8 minInside the junction. Walk through the four intro beats. Level 1 learners do the safe/conflict judgements now.
  3. 10 minThe ideas. States, transitions and the conflict interlock. Work the 90 s cycle, 60 s red average-wait example together.
  4. 14 minGroup challenge. Teams build their state machine in the Level 2 editor until the audit passes. Ask each team to show you what happens if the button is pressed during amber.
  5. 10 minDesign task. Individually, tune the rush-hour plan in the junction lab. Learners on other levels work on their own level task.
  6. 8 minQuestions. Answer moderated questions, then set the two-junction extension.
  7. 5 minReflect & save. Everyone saves their design and writes one sentence: which requirement was hardest to balance?
Team challenge
Teams of three get the same junction and the same rule: never two conflicting greens. Each team designs a state machine that serves pedestrians and lets an ambulance through, then walks the room through one tricky transition. No leaderboard: every team that gets there explains how.
Individual design task
On your own: choose a cycle time that keeps the average wait on the busy road as low as you can while giving pedestrians a crossing every cycle. Write down what you traded.
Questions
Moderated questions in the live room. Questions are answered on screen without names, and chat stays off.
Extension
Two junctions sit close together on the same road. How could you time them so a car that gets one green usually gets the next? What information would the second junction need?

Five levels, one project

LevelTaskEvidence
ExplorerJudge six moments at a crossroads as safe or a conflict, then say what the lights must show next at three moments in the cycle.
Makes: Six correct safe / conflict judgements and three correct next states.
Answer key: Safe: 1, 3, 5. Conflict: 2 (NS amber with EW green), 4 (walk with NS green), 6 (EW amber with flashing don't walk). Next: amber; all red; flashing don't walk.
Checked by the facilitator against the answer key
BuilderBuild the junction's controller as a cycle of timed states in the editor, watch it run, and pass our server's safety audit: no conflicts, amber after every green, all-red before every green and walk, flashing before don't walk, and every road and the crossing served.
Makes: A safe, complete state cycle that passes the audit, including the wrap-around from the last state to the first.
Answer key: NS green 30 → NS amber 3 → all red 2 → EW green 20 → EW amber 3 → all red 2 → walk 7 → flashing 10 → all red 2 (79 s). The starter fails on missing amber, missing clearance and no walk.
Checked by the facilitator against the answer key
InnovatorIn the junction lab, tune the greens, clearances, crossing mode and emergency pre-emption for 15 minutes of rush hour, with one road twice as busy as the other and four ambulances. Pass the safety audit and every target, then lower the average wait.
Makes: A timing plan that our server re-simulates and passes on safety, waits, queues, pedestrians and ambulances.
Answer key: Needs the crossing on demand and pre-emption, with more green for north–south: e.g. NS 45 s, EW 20 s, amber 3, all-red 2, walk 7, flashing 10 (about 25.8 s average wait). The default 25/25 fixed plan lets the north–south queue grow; all-red 0 fails the audit.
Checked by the facilitator against the answer key
Systems EngineerFor a given timing plan, calculate the cycle time, the north–south green share, the average wait using r² / (2C), one approach's capacity in cars per hour and the shortest safe flashing time. Then explain what a longer cycle gains and what it costs.
Makes: Five calculated answers and a trade-off argument, checked on our server.
Answer key: C = 40 + 3 + 2 + 20 + 3 + 2 + 7 + 10 + 2 = 89 s; 40 / 89 = 44.9%; r = 49 s, 49² / 178 = 13.5 s; 19 cars per green × 3600 / 89 ≈ 769 cars/h; 12 m / 1.2 m/s = 10 s.
Checked by the facilitator against the answer key
Research EngineerAsk one question (for example, at what pedestrian rate does a crossing on demand stop beating a fixed crossing every cycle?). Record at least four runs in the junction lab changing one setting (traffic, timing or seed), and write a short technical report.
Makes: Four or more server-recomputed runs and a report with a hypothesis, method, results and limits, reviewed by a person.
Reviewed by an adult

Common misconceptions

  • ✗ “An emergency vehicle should get green instantly.”
    ✓ Switching straight to green could put it into cross traffic. Priority still passes through amber and all-red; it just skips the wait.
  • ✗ “Longer cycles are always more efficient.”
    ✓ Longer cycles waste less time on clearance, but everyone waits longer at red. The best cycle balances both.
  • ✗ “If it works for the normal sequence, it is safe.”
    ✓ Safety has to hold in every state and for every event, including button presses and sirens at awkward moments. Check every transition.
  • ✗ “Traffic lights only need logic gates.”
    ✓ Gates make decisions, but the controller also needs memory: which state it is in, and whether the button was pressed.

Accessibility

Every light is named in words as well as colour (signal heads, state labels, the phase ribbon legend and screen-reader descriptions). The state editor and junction lab work by keyboard, with a time scrubber in place of playback when reduced motion is on, and run on a low-cost phone. We also discuss audible and tactile crossing signals as part of the design.

BUILD 005 worksheet: a junction that decides

Name: ______________________ Level: ____________

  1. List the states your junction needs, including clearance states. Why is an all-red state useful?
  2. Write the conflict rule as logic. In which states should it be 0? (Trick question: which states may it be 1?)
  3. A cycle is 90 s and your road has 30 s of green. What is its green share? How much red does it get?
  4. Using average wait ≈ r² / (2C), what is the average wait on that road? What assumptions does the formula make?
  5. The pedestrian button is pressed during north–south amber. Trace what your state machine does next.
  6. Give one requirement from pedestrians, one from bus drivers and one from emergency services. Where do two of them conflict?

Follow-up

  • Try BUILD 007 (Design a Smart Greenhouse) for another environment that measures and responds.
  • Atlas: sequential logic and memory, for how a circuit remembers that the button was pressed.
  • Playground: digital logic. Build the conflict detector and check it in every row.
  • Try BUILD 008 (Create a Virtual Computer) to see state and memory become a processor.