BeginnerPCB Wizard
The automatic street light is a favorite beginner project because the result is immediately visible and satisfying — cover the sensor, and the LED turns on. This tutorial covers the LDR-based version.
Components You'll Need
LDR (Light Dependent Resistor) NPN Transistor (BC547) Resistors: 10K (with LDR), 1K (base resistor), 220Ω (LED) LED (or small relay, for switching an actual bulb) 9V Battery + connector
How the Circuit Works
An LDR's resistance changes with light — high resistance in the dark, low resistance in bright light. Paired with a fixed resistor as a voltage divider, this creates a voltage that swings depending on ambient light, which is then used to switch a transistor on or off.
- In daylight, the LDR's resistance is low, keeping the transistor's base voltage too low to switch it on — LED stays off
- As it gets dark, the LDR's resistance rises, raising the base voltage enough to switch the transistor on
- The transistor then drives the LED (or, in a real installation, a relay controlling an actual street light)
Designing the PCB in PCB Wizard
1. Position the LDR at the Board Edge
Unlike other components, the LDR needs to physically sense ambient light — place its footprint right at the edge of the board, or plan for it to sit on wire leads extending past the enclosure, so it isn't blocked once the board is housed.
2. Keep the Sensing Divider Simple and Direct
The LDR and its paired resistor form the core sensing element — route this pair with short, direct tracks, since this is a low-current, sensitive part of the circuit where track length matters less for power but keeping it clean makes the design easier to verify.
3. Add a Potentiometer for Adjustable Sensitivity (Optional Upgrade)
Replacing the fixed resistor with a small trimmer potentiometer lets you tune exactly how dark it needs to get before the light switches on — a nice addition if you want the project to feel more like a finished product rather than a fixed demo.
Tip: If driving an actual bulb rather than just an LED, use the transistor to switch a relay instead of the bulb directly — the relay's isolated contacts handle mains-level switching safely, which a small signal transistor cannot do on its own.
4. Route the LED (or Relay Coil) Output Last
This is your output stage — route it after the sensing and switching sections are placed, keeping it toward the opposite edge of the board from the LDR to keep the "input" and "output" sides of the circuit visually and electrically distinct.
Watch out: If upgrading to a relay driving a real mains-powered light, that mains-side wiring must be properly insulated and is genuinely dangerous to handle without experience — for a classroom demo, stick to the LED-only version.
Testing Your Board
Cover the LDR with your hand or a small box to simulate darkness — the LED should switch on within a second. Uncover it, and the LED should switch back off. If it doesn't respond, check the LDR/resistor divider values first, since a mismatched resistor is the most common reason this circuit doesn't trigger at the expected light level.
Menu