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

  1. Place UNO R3 (Not yet)

    Provides D12, D11, D10 outputs and common ground.

  2. Place breadboard (Not yet)

    Holds the three LED circuits side by side.

  3. Insert 3 resistors (Not yet)

    Insert three 330 Ω resistors to protect each LED from overcurrent.

  4. Insert 3 LEDs (Not yet)

    Insert Red, Yellow, and Green LEDs in separate rows.

  5. Connect pins to resistors (Not yet)

    Wire D12 to Red resistor, D11 to Yellow resistor, D10 to Green resistor.

  6. Connect to anodes (Not yet)

    Connect each resistor's second leg to the corresponding LED anode (+).

  7. Return all to GND (Not yet)

    Connect all three LED cathodes (−) to the ground rail.

  8. Build sequence (Not yet)

    Red for 2 s → Green for 2 s → Yellow for 1 s. Turn previous light OFF as next turns ON.

  9. Bind blocks (Not yet)

    Bind each write block to its respective Red, Yellow, or Green LED.

  10. 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: 0 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 breadboard
  • led-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-board

    This 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.

    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.