Automatic Street Light
Build an automatic street light using a photoresistor (LDR) voltage divider and an LED. Turn the lamp ON below 30% brightness and OFF at 30% and above.
Automatic Street Light
Objectives
- Wire an LDR voltage divider with a 10 kΩ resistor to analog pin A0.
- Wire a 330 Ω current-limiting resistor and yellow LED to digital pin D9.
- Program the LED to turn ON when light drops below 30% and turn OFF at or above 30%.
Expected behavior
The yellow LED illuminates when ambient light is below 30%, and stays off at 30% or higher.
What this simulation can and cannot show
Teaching model: ideal voltage divider with normalized light level (0–100%, not lux). The LED models a street fixture, not municipal high-voltage power. No physical hardware connection or automated switching claim.
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 5V supply, ground, analog pin A0 and digital pin D9.
- Place breadboard (Not yet)
Connects the divider and LED components neatly.
- Insert resistors (Not yet)
Place the 10 kΩ divider resistor and 330 Ω LED resistor in different strips.
- Insert LDR & LED (Not yet)
Insert the photoresistor and yellow LED into separate breadboard strips.
- Wire divider to A0 (Not yet)
Wire 5V to the LDR, LDR junction to 10 kΩ resistor and A0, and resistor to GND.
- Wire LED from D9 (Not yet)
Connect digital pin D9 through the 330 Ω resistor to the LED anode (+).
- Return cathode to GND (Not yet)
Connect the LED cathode (−) back to board GND.
- Build decision loop (Not yet)
Read analog light level; if below 30% turn LED ON, otherwise OFF.
- Bind blocks to parts (Not yet)
Bind read block to the LDR and write blocks to the LED lamp.
- Run and observe scenarios (Not yet)
Test light levels across the 30% boundary to verify correct switching.
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
- In the LDR divider, 5V goes to one LDR leg, the other leg joins the 10 kΩ resistor and A0, and the resistor's other leg goes to GND.
- Use `analog read` divided by 10 to compare with 30 (or compare raw ADC counts to 307).
Bill of Materials
arduino-uno-r3-a000066(v1) × 1 — Microcontroller board (5V logic)fritzing-half-breadboard-420(v1) × 1 — Half-size prototyping breadboardphotoresistor-basic(v1) × 1 — Light-dependent resistor (ambient light sensor)resistor-axial-series(v1) × 1 — 10 kΩ voltage divider resistorresistor-axial-series(v1) × 1 — 330 Ω LED current-limiting resistorled-5mm-colour(v1) × 1 — 5mm yellow LED (street lamp indicator)
Wiring Explanation
Wire UNO 5V and GND to the breadboard. Form an LDR voltage divider with a 10 kΩ resistor to GND; connect the junction to pin A0. Connect digital pin D9 through a 330 Ω resistor to the yellow LED anode (+), and return cathode (−) to GND.
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-street-lighting",
"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.