Traffic Lights
Build a three-LED traffic signal sequence modeled after intersection controls: Red (≥ 2 s) → Green (≥ 2 s) → Yellow (≥ 1 s) with strict single-light mutual exclusion.
Traffic Lights
Objectives
- Wire Red (D12), Yellow (D11), and Green (D10) LEDs with individual 330 Ω resistors.
- Program the sequence: Red (≥ 2 s) → Green (≥ 2 s) → Yellow (≥ 1 s).
- Ensure exactly one light is illuminated at any moment, including between transitions.
Expected behavior
Cycles in order: Red ON (≥ 2 s) → Green ON (≥ 2 s) → Yellow ON (≥ 1 s). Never are two LEDs illuminated at the same time.
What this simulation can and cannot show
Teaching simulation: timing demonstration with ideal LEDs and series resistors. Does not connect to real road signals or municipal traffic hardware.
Choose how to start
Start blank to place every part yourself, or load the starter: board, breadboard, resistor, LED and an unbound blink program. You still insert parts, make each connection and bind the blocks.
Build steps
0 / 10 steps complete
- Place UNO R3 (Not yet)
Provides D12, D11, D10 outputs and common ground.
- Place breadboard (Not yet)
Holds the three LED circuits side by side.
- Insert 3 resistors (Not yet)
Insert three 330 Ω resistors to protect each LED from overcurrent.
- Insert 3 LEDs (Not yet)
Insert Red, Yellow, and Green LEDs in separate rows.
- Connect pins to resistors (Not yet)
Wire D12 to Red resistor, D11 to Yellow resistor, D10 to Green resistor.
- Connect to anodes (Not yet)
Connect each resistor's second leg to the corresponding LED anode (+).
- Return all to GND (Not yet)
Connect all three LED cathodes (−) to the ground rail.
- Build sequence (Not yet)
Red for 2 s → Green for 2 s → Yellow for 1 s. Turn previous light OFF as next turns ON.
- Bind blocks (Not yet)
Bind each write block to its respective Red, Yellow, or Green LED.
- Observe two cycles (Not yet)
Observe at least two complete cycles with single-light mutual exclusion.
Lesson check
Run the circuit when every build step is done. Completion needs three observed ON/OFF cycles with both one-second waits.
Cycles observed: of 2
Completion is saved only in this browser. It is not synced to an account and is not a certificate.
Open the Code tab to read the generated C++: both delay(1000) waits appear inside the repeat loop. It is not compiled or flashed.
Hints
- Turn off the previous LED when turning on the next one; simultaneous lights will cause assessment to fail.
- Red must hold for at least 2 seconds, Green for at least 2 seconds, and Yellow for at least 1 second.
Bill of Materials
arduino-uno-r3-a000066(v1) × 1 — Microcontroller board (5V logic)fritzing-half-breadboard-420(v1) × 1 — Half-size prototyping breadboardled-5mm-colour(v1) × 1 — 5mm red LED (stop indicator)led-5mm-colour(v1) × 1 — 5mm yellow LED (caution indicator)led-5mm-colour(v1) × 1 — 5mm green LED (go indicator)resistor-axial-series(v1) × 3 — 330 Ω LED current-limiting resistors
Wiring Explanation
Connect UNO GND to the breadboard rail. Wire digital pins D12, D11, and D10 through individual 330 Ω resistors to the Red, Yellow, and Green LED anodes (+). Return all three cathodes (−) to the ground rail.
Draft lesson and translations — fluent educator review pending.
Board inspector
This project has no board yet.
Add a supported board to check wiring, simulate and preview code. Physical compatibility is unverified.
Lessons keep their board. Use a free project to try another board.
Wiring checks
Limited virtual teaching rules — not physical safety certification or a general electrical solver. Passing wiring checks does not run code or award completion.
Draft explanations and translations — fluent educator review pending.
Wiring checks blocked
Error: 0 · Warning: 0 · Unsupported: 1
Unsupported ·
missing-boardThis draft has no programmable board.
Repair hint: Add a supported board and connect its named terminals explicitly.
Involved IDs
Parts tray
Planned boards and parts
Shown for planning only. They cannot be added, simulated or exported yet.
- Raspberry Pi Pico W · RP2040 · Not available yet · Planned gate C
- Raspberry Pi Pico 2 · RP2350 · Not available yet · Planned gate C
- Raspberry Pi 4 Model B · other RAM sizes and PCB revisions · Not available yet · Planned gate D
- BeagleBone Black Wireless · Not available yet · Planned gate D
- Analog temperature and water-level circuit inputs · Not available yet · Planned gate C
- Motors, servos, other displays and SPI/UART bus modules · Not available yet · Planned gate C
Terminal inspector
None
Connections
Use these labelled controls instead of dragging or selecting small terminals. Wires cross without joining.
No wires yet.
Program components
Choose the actual component for each block. Names can change; IDs and wiring stay fixed. Pin selection never rewires the circuit.
Draft translations — fluent educator review pending.
Add an ON/OFF, brightness, button, analog reading, temperature or display block to bind a component.
Board code and wiring
Read-only generated code and simulation illustration. Not compiled, flashed or physically verified. Draft translations need educator review.
Export unavailable: repair wiring, board modes and program bindings in Circuit / Blocks.
Export unavailable: repair wiring, board modes and program bindings in Circuit / Blocks.Circuit document (JSON, read-only)
Limited circuit simulation for the published UNO R3 and ESP32-DevKitC V4 teaching profiles. Code view offers qualified C++ and JavaScript previews (plus MicroPython for ESP32) with wiring manifests, plus document JSON. No CPU, Wi-Fi or Bluetooth is simulated, and physical compatibility is unverified.
{
"schemaVersion": 3,
"kind": "circuit",
"circuitSchemaVersion": 1,
"mode": "lesson",
"board": null,
"components": [],
"connections": [],
"configuration": {
"teachingModel": "circuit"
},
"workspace": {
"blocks": {
"languageVersion": 0,
"blocks": [
{
"type": "irr_start",
"id": "program-start",
"x": 30,
"y": 30
}
]
}
},
"bindings": [],
"layout": {
"viewport": {
"x": 0,
"y": 0,
"zoom": 1
},
"panel": "circuit"
},
"lesson": {
"id": "wired-traffic-lights",
"version": 1
}
}Select a part, then drag it or use arrow keys to move it. In Wire mode, choose two terminals. Visual overlap never creates electrical contact; use the attachment form to occupy a breadboard hole.
Limited circuit simulation for the published UNO R3 and ESP32-DevKitC V4 teaching profiles. Code view offers qualified C++ and JavaScript previews (plus MicroPython for ESP32) with wiring manifests, plus document JSON. No CPU, Wi-Fi or Bluetooth is simulated, and physical compatibility is unverified.
Draft learning copy and translations — fluent educator review is still required.
Guest circuit projects
Saved on this browser. Nothing uploads automatically; a signed-in adult or educator can press Save to cloud for a private copy. Download a copy before clearing browser data.
Local save pending
Draft explanations and en/rw/fr translations need fluent educator review.