Dusk-to-dawn porch lamp: LDR switching a 220 V bulb through a relay
Open in the lab ▸Make my own copy
The light comes on by itself when it gets dark. On the low-voltage side, the SENS pot and an LDR form a divider into a BC547: in daylight the LDR is a few kΩ and keeps the transistor off; at dusk its resistance climbs, the transistor turns on and pulls the relay module’s IN low (this module switches on a LOW input). The relay contact, rated 10 A 250 V, switches the mains to the porch bulb. Here it is night (the LDR sees 2 lux), so the lamp is on. Click the LDR and raise the light to see it switch off. Keep the 220 V side in a closed box, behind a breaker; only the 5 V side should be touchable.
What is on the bench
22 parts, 30 wires.
| 9 V battery | 1 |
|---|---|
| 7805 regulator | 1 |
| Electrolytic capacitor | 1 |
| Potentiometer | 1 |
| Photoresistor (LDR) | 1 |
| Resistor | 1 |
| NPN transistor | 1 |
| Relay module | 1 |
| Utility grid | 1 |
| AC breaker | 1 |
| 220 V bulb | 1 |
Put it on your page
The project runs live inside the frame: readers can press buttons, turn knobs and read the meters.
<iframe src="https://zencircuitlab.com/embed/zclduskrelay" width="100%" height="560" style="border:1px solid #2f363a;border-radius:10px" loading="lazy" title="Dusk-to-dawn porch lamp: LDR switching a 220 V bulb through a relay on Zen Circuit Lab"></iframe>
Link
https://zencircuitlab.com/p/zclduskrelay
Published by its author under the lab's community terms: it may be opened, copied and changed by anyone. Simulation results are for learning; check a real build against the parts' datasheets.