Home › Projects › Dusk-to-dawn porch lamp: LDR switching a 220 V bulb through a relay

Dusk-to-dawn porch lamp: LDR switching a 220 V bulb through a relay

by Zen Circuit Lab · published 5 days ago · 1 opened in the lab · 8 page views

Dusk-to-dawn porch lamp: LDR switching a 220 V bulb through a relay: the circuit on the lab bench

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 battery1
7805 regulator1
Electrolytic capacitor1
Potentiometer1
Photoresistor (LDR)1
Resistor1
NPN transistor1
Relay module1
Utility grid1
AC breaker1
220 V bulb1

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.