What Is an LDR? The Complete Guide to Light Dependent Resistors

An LDR is short for Light Dependent Resistor — the component engineers reach for when they need to detect ambient light without spending much money. A small disc of cadmium sulfide (CdS), sealed under a clear epoxy coating, changes its resistance in response to the photons landing on it. In a dark room, the GL5528 — the most common variant — sits at roughly 1 MΩ. Walk outside into sunlight and it drops toward a few hundred ohms. No power supply needed. No calibration either, if you can live with the imprecision.

This is why you find LDRs in things like automatic street lights, solar garden lights, and the entry-level Arduino light sensor kits sold in electronics starter packs. They are not accurate. They are not fast. But they are dirt cheap and they work well enough for a surprising number of tasks.


How Does an LDR Work?

The physics is called photoconductivity. Cadmium sulfide has a bandgap of about 2.4 eV. Light with wavelength shorter than around 520 nm carries enough photon energy to kick electrons across that gap. Once in the conduction band, those electrons are free to move, which lowers the material’s resistance.

Because the bandgap is roughly in the green part of the spectrum, a standard CdS LDR is most sensitive to green light — around 540 nm. This actually works out well for human-centric applications, since “what a person perceives as bright” and “what the LDR sees as bright” end up being roughly the same thing.

The resistance follows a power law that engineers write as:

R = k × L^(-γ)

R is resistance in ohms. L is illuminance in lux. The constants k and γ are determined by the specific batch of CdS material — you pull them from the datasheet or measure them against a reference lux meter. For the GL5528, γ is usually between 0.7 and 0.8, which means that if you double the light, the resistance drops to roughly 62–65% of what it was. Not a clean logarithmic response, but close enough to calibrate out in firmware.

Condition Typical GL5528 Resistance
Pitch black 1 MΩ to 10 MΩ
Indoor room light (~100 lux) 10–50 kΩ
Overcast sky (~1,000 lux) 1–5 kΩ
Direct sunlight (~100,000 lux) 100–500 Ω

One quirk worth knowing: the LDR reacts faster to light appearing (about 20 ms to settle) than to light disappearing (up to 200 ms). This asymmetry is baked into the carrier generation and recombination rates. For street light switching, it does not matter. For anything that involves detecting fast changes, it will.


LDR Specifications and Types

The GL5528 is the 5 mm CdS disc most people end up buying, often on a small breakout board labeled KY-018. Here is what the datasheet says:

  • Spectral peak: 540 nm (green)
  • Resistance at 10 lux: 10–20 kΩ
  • Dark resistance: 1 MΩ minimum
  • Operating range: -30°C to +70°C
  • Rise time: ~20 ms; fall time: ~200 ms

Smaller variants exist — the GL5537 is a 3 mm package with slightly faster response. The GL5539 has a steeper gamma value, which means its resistance changes more dramatically per lux change, making it useful for wide-range measurements where you want to resolve both indoor and outdoor conditions with one device.

One practical thing: LDRs age, particularly under sustained UV exposure and high temperature. The dark resistance creeps up over months to years in outdoor installations. If you are designing something that needs to hold its calibration for years, budget for recalibration or consider a silicon alternative.


LDR vs Photodiode — Key Differences

These two technologies both detect light, but they go about it differently.

A photodiode is an active semiconductor junction that generates a current proportional to incident light. An LDR is a passive bulk resistor that changes value. The photodiode needs a bias voltage. The LDR does not. The photodiode responds in nanoseconds. The LDR takes tens to hundreds of milliseconds.

Linearity is the other big difference. A photodiode output scales linearly with lux over five or six orders of magnitude. An LDR follows that power law — gamma ≈ 0.8 — which means the same lux change produces a much larger resistance change near the low end than near the high end. You can compensate for this in code, but you cannot eliminate it.

Cost matters too. A GL5528 costs less than $0.10 in quantity. A photodiode with comparable active area costs ten to a hundred times more, plus you need bias circuitry.

For street light switching, cheap night lights, and Arduino experiments: LDR wins on economics. For camera exposure meters, precision lux measurements, and fiber optic receivers: photodiode wins on performance.


Common Applications

Street light control. An LDR plus a simple comparator — the LM393 is popular for this — flips a relay when ambient light crosses a threshold. At dusk, the light comes on. At dawn, it goes off. This circuit has been running in millions of installations since the 1960s.

Night lights and solar garden lights. A small solar panel charges a battery during the day. At night, an LDR detects darkness and connects the LED. No microcontroller. No firmware. One transistor and an LDR will do it.

Arduino light sensor. The KY-018 module pairs a GL5528 with a 10 kΩ resistor in a voltage divider. The analog output feeds any microcontroller ADC. This is the “blinky” of light sensing — the simplest possible way to read lux with a microcontroller.

Camera exposure meters. Before silicon sensors became cheap, CdS LDRs were the standard in handheld exposure meters. A few novelty cameras still use them.

Laser security and optical interruption detection. The LDR monitors a laser beam. When something breaks the beam, resistance spikes. The 20 ms response time is fine for a system that cares about presence, not signal speed.


How to Use an LDR with Arduino

Wire the LDR into a voltage divider:


VCC (5V) → 10 kΩ resistor → Analog pin A0
                         ↓
                    GL5528 LDR
                         ↓
                       GND

Higher light = lower LDR resistance = lower voltage at A0. The Arduino ADC maps 0–5V to 0–1023.

To convert ADC to lux, use the empirical formula:


int raw = analogRead(A0);
float ldrR = (5.0 * 10000.0) / raw - 10000.0;
float lux = pow(ldrR / 500.0, -1.25);

The 500.0 and 1.25 are GL5528 calibration constants. They are approximate. If you need accuracy, measure your specific LDR against a calibrated lux meter and fit your own constants.

For outdoor-only sensing, swap the 10 kΩ pull-up for 100 kΩ. This shifts the voltage transition point from indoor lighting levels to full outdoor brightness.


Limitations and Considerations

The CdS material degrades under UV. Outdoor units will drift over years. If your product needs to hold calibration for five years in direct sunlight, an LDR is not the right choice.

Temperature affects CdS resistance at roughly 0.5–1% per degree Celsius above 25°C. A summer day pushing 40°C introduces a 7–15% error. You can compensate with a temperature sensor, or just accept the drift in cost-sensitive designs.

The fall time (dark adaptation) is 5–10× slower than the rise time. This makes the LDR unsuitable for anything that needs to detect rapid light modulation — remote control receivers, visible light communication, strobe detection, and anything involving pulse-width modulation of light.

Finally, cadmium is an RoHS-controlled substance under EU Directive 2011/65/EU (and is on the REACH SVHC list). If you are shipping commercial electronics in Europe or to companies that enforce REACH compliance, you may need to qualify a cadmium-free alternative.


Conclusion

The LDR — Light Dependent Resistor, also called a photoresistor — is a CdS semiconductor that changes resistance with light. The resistance-to-illuminance relationship follows a power law: R = k × L^(-γ). The GL5528, the most common variant, covers the full human-relevant lux range from darkness to direct sunlight at a cost well under a dime.

It is slow. It is non-linear. It drifts with temperature and degrades with UV exposure. But for ambient light detection in cost-sensitive products, street lights, night lights, and microcontroller experiments, it has been the practical answer since the 1960s.

Frequently Asked Questions

What is LDR full form?

LDR stands for Light Dependent Resistor — also called a photoresistor. It is a passive electronic component whose resistance decreases as the intensity of ambient light increases.

How does an LDR work?

An LDR is made from cadmium sulfide (CdS), a semiconductor. When photons strike the material, they excite electrons into the conduction band, reducing electrical resistance. This is called photoconductivity. The resistance follows the formula R = k × L^(-γ), where L is illuminance in lux.

What is the resistance of an LDR in darkness?

A typical GL5528 LDR exhibits 1 MΩ to 10 MΩ resistance in complete darkness (0 lux). Under bright sunlight (100,000 lux), resistance drops to 100–500 Ω.

What is the difference between LDR and photodiode?

An LDR is a passive component (resistance changes) that is slow (20–200 ms response), non-linear, and inexpensive. A photodiode is an active semiconductor (generates current) with nanosecond response, linear output, wider dynamic range, and higher cost.

How do you test an LDR with a multimeter?

Set your multimeter to resistance (Ω) mode. Place the LDR in darkness — expect 1 MΩ or higher. Shine a light on it — resistance should drop to under 100 kΩ within milliseconds. If resistance does not change, the LDR is likely faulty.

Please enable JavaScript in your browser to complete this form.

Quick Quote

Info
Click or drag a file to this area to upload.
send me gerber or pcb file,format:7z,rar,zip,pdf

Contact

WellCircuits
More than PCB

Upload your GerberFile(7z,rar,zip)