LED GURUcosycom.com
PAGE 090 OF 150 · TIMERS, FLASHERS & DIMMING

Night Light with a Light Sensor

A light sensor switches the LED when it gets dark.

LED SYMBOLTriangle points from anode to cathode; the arrows show light leaving the part.

Using an LDR

A light-dependent resistor has a resistance that is low in bright light, perhaps a few kilohms, and very high in the dark, often over a megohm.

Circuit

  • Place the LDR and a 10 kilohm resistor as a divider across the supply.
  • Feed the middle point through 1 kilohm to the base of an NPN transistor.
  • Put the LED and a 220 ohm resistor in the collector.

As it gets dark the base voltage rises and the LED lights. Add a potentiometer to adjust the switching level. Keep the LED from shining on the LDR or the light will flicker.

REMEMBER
Switching an LED on and off quickly can look like steady dimmer light.

Try it yourself

Sketch the circuit on paper first, calculate the values, then build it on a solderless breadboard using a low-voltage supply. Measure with a multimeter before you make anything permanent.

Explore LED clocks, stopwatches and electronics at cosycom.com.

Watch: COSYCOM channel videos

www.youtube.com/@cosycom