← Field Notes

Light-dependent resistors: a first sensor

Light-dependent resistors: a first sensor

A light-dependent resistor, also called an LDR or photoresistor, is about the simplest sensor there is. It has two leads, no polarity, and one behaviour: its resistance falls as more light lands on it.

What the numbers look like

A typical small LDR measures a few hundred ohms in bright light, several thousand ohms in ordinary room light, and a megohm or more in darkness. The exact figures vary a lot from part to part, so measure yours with a multimeter while you cover and uncover it.

Turning resistance into a voltage

A circuit cannot use a changing resistance directly, but it can use a changing voltage. Put the LDR in series with a fixed resistor, about 10 kΩ is a good start, across your supply. The junction between the two is a voltage divider whose output rises or falls with the light level.

Which way it moves depends on which part is on top. With the LDR connected to the positive side, more light gives a higher output voltage. Swap the two and you have a darkness detector instead.

What to build with it

Feed that voltage into the base of a transistor, through a resistor, and you can switch an LED on at dusk. Feed it into a comparator and you get a clean on or off at a threshold you set with a potentiometer.

Two things to know. LDRs are slow, taking tens of milliseconds to respond, so they suit daylight sensing rather than fast signals. And the common type contains cadmium, which is restricted in some regions, so a phototransistor is the usual modern substitute.

If you want the fundamentals in one place, with hand-drawn diagrams, start with Getting Started in Electronics, or browse all four books.

See the guides