How Does a Street Lamp Know It Is Dark? The LDR Light Sensor Circuit Explained

Street lamps switch on at dusk and off at dawn with nobody touching a switch. The sensor that does it can be as simple as a small disc whose resistance changes with the light.
The animation below follows one day-night-day cycle. You can change the fixed resistor and the switch-on voltage, and watch the light level, the LDR resistance, the voltage and the lamp.
The short answer
A light-dependent resistor (LDR) has a resistance that falls in bright light and rises steeply in the dark. In a potential divider with a fixed resistor across 12 V, the voltage across the LDR is
V = 12 × R_LDR / (R_LDR + R_fixed)
As dusk falls, R_LDR climbs and the voltage rises past the switch-on level. A relay then closes the separate mains circuit of the lamp. A small gap between the switch-on voltage (6 V in the model) and the switch-off voltage (5 V) is called hysteresis, and it stops the lamp from flickering at twilight.
In the animation's model, the LDR goes from about 300 Ω in bright daylight to about 300 kΩ in the dark, and the voltage across it rises from about 1.6 V to about 11.9 V.
What the animation shows
One day-night-day cycle is compressed into 20 seconds. The panels show the light in lux, the LDR resistance, the divider voltage, the relay and the lamp. The relay switches the lamp's own mains circuit, so the small control circuit does not carry the lamp current.
The physics: a divider with a light-dependent leg
The LDR in the model follows R ≈ 500 Ω × (illuminance / 1000 lux)^−0.75, with a lower limit of about 300 Ω in strong light. The control circuit switches the relay on above 6.0 V and off below 5.0 V.
The lamp turns on when the LDR voltage reaches the switch-on level, which happens when R_LDR equals the fixed resistor (for a 6 V threshold across 12 V). So the fixed resistor sets how dark it has to be before the lamp comes on.
What the numbers say: setting the threshold
Working out the switch-on light level from the model's formula (R_LDR equal to the fixed resistor at 6 V):
Fixed resistor | Lamp switches on below about |
500 Ω | 1,000 lux |
2,000 Ω (default) | 157 lux |
8,000 Ω | 25 lux |
With the default 2 kΩ resistor, the switch-off voltage of 5 V corresponds to about 247 lux. So the lamp comes on when the light falls below about 157 lux and goes off again when it rises above about 247 lux. A larger fixed resistor makes the lamp wait for a darker evening.
Without the gap, a lamp could switch on and off repeatedly when the light hovers around the threshold, for example under passing cloud at dusk.
Honest limits of the model
The LDR formula and thresholds are a model. Real LDRs vary a lot from one part to the next, respond slowly, and change with temperature. Real street lighting often uses photocells or timers and may use different thresholds, and local rules decide when lamps switch on.
Frequently asked questions
What is an LDR? A light-dependent resistor, a component whose resistance falls as the light on it increases.
What is a potential divider? Two resistors in series across a voltage. The voltage across one of them depends on the ratio of the two resistances.
Why does the lamp use a relay? So that a small, low-voltage control circuit can switch a separate, higher-power mains circuit safely.
What is hysteresis? Using different switch-on and switch-off levels so that the output does not flicker when the input hovers around one level.
How can I make the lamp come on later in the evening? In this circuit, use a larger fixed resistor. It needs a darker light level before the LDR voltage reaches the switch-on level.
Why does the LDR resistance change so much? Light frees more charge carriers in the sensor material, which makes it conduct better. The model uses a power law to capture the trend.
Related
Figures in this article come from the animation's model: a 12 V supply, a fixed resistor of 500 to 8,000 Ω (2 kΩ default), an LDR of about 500 Ω × (lux/1000)^−0.75 limited to a minimum of about 300 Ω, and a relay that switches on above 6 V and off below 5 V. Threshold light levels are worked out from those relations.




Comments