A photo resistor LDR (Light Dependent Resistor) is a passive, variable resistor whose resistance drops non-linearly as incident light intensity increases. The most common hobbyist and industrial part is the Cadmium Sulfide (CdS) cell, exemplified by the ubiquitous GL5528. In total darkness, a standard GL5528 exhibits roughly 1 MΩ resistance; under 10 lux (dim room light), it drops to a range between 10 kΩ and 20 kΩ. Unlike photodiodes or phototransistors, LDRs require no bias voltage or active amplification to function, making them ideal for simple analog light-sensing tasks, though their slow response time (typically 20ms to 50ms) limits them to low-frequency applications like dusk-to-dawn lighting or ambient backlight dimming.
LDR Types and Selection Criteria
Not all photoresistors are created equal. The semiconductor material dictates the spectral response (which colors of light it 'sees'), the baseline resistance, and the temperature stability. Choosing the wrong material for your light source will result in a sensor that is effectively blind to your target environment.
| Material / Construction | Spectral Peak | Typical Tolerance | Tempco (Temp. Coefficient) | Typical Use Case |
|---|---|---|---|---|
| CdS (Cadmium Sulfide) 5mm-12mm ceramic substrate |
540 nm (Green/Visible) | ±10% to ±50% at 10 lux | -0.5% / °C | Streetlights, nightlights, camera exposure meters. Matches human eye sensitivity. |
| CdSe (Cadmium Selenide) Thin-film deposition |
720 nm (Red/Near-IR) | ±20% at 100 lux | -0.8% / °C | Intrusion alarms, IR beam breakers, industrial sorting where red lasers are used. |
| PbS (Lead Sulfide) Hermetically sealed metal can |
2000 nm (Mid-IR) | ±15% | Highly temp-dependent (requires TEC cooling for precision) | Flame detection, spectroscopy, thermal imaging. Expensive, niche industrial use. |
Which type for which job? If you are building a circuit that reacts to ambient room lighting, sunlight, or standard white LEDs, you must use a CdS cell. Its spectral peak at 540 nm closely mimics the photopic luminosity function of the human eye. If you attempt to use a CdS cell to detect an 850 nm IR security beam, it will barely register a change in resistance. For IR applications, step up to a CdSe cell or abandon photoresistors entirely in favor of a dedicated IR phototransistor.
Decoding Physical Markings and Specs
Unlike standard resistors, CdS photoresistors rarely feature alphanumeric color bands or printed resistance values on their bodies. Instead, manufacturers use physical dimensions and a standardized two-digit suffix to denote their electrical characteristics. Here is how to read the physical part on your bench:
- The Series Prefix (Diameter): The physical diameter of the sensor dictates the series. A 5mm diameter sensor belongs to the '55' series (e.g., GL55xx). A 7mm sensor is the '57' series, and a 12mm sensor is the '59' series. Larger diameters generally offer lower noise and higher power dissipation ratings (up to 100mW for 12mm vs 50mW for 5mm).
- The Suffix Code (Resistance Profile): The two digits following the series number define the illumination and dark resistance. For example, in a GL5528, the '28' indicates a resistance of 10-20 kΩ at 10 lux, and a dark resistance of 1 MΩ. A GL5516 ('16') indicates 5-10 kΩ at 10 lux, and a dark resistance of 0.5 MΩ. A GL5539 ('39') indicates 30-90 kΩ at 10 lux, and a massive 5 MΩ dark resistance.
- The Substrate Color: The ceramic base is typically white or pale yellow. The top surface features a zig-zag or interdigitated pattern of the cadmium sulfide compound, usually appearing dark red or brown, sealed under a clear epoxy dome.
Safe Substitution When the Exact Part is Missing
Photoresistors have notoriously loose manufacturing tolerances—often ±30% or worse from the factory. Because of this, 'exact' substitution is a myth; you are always substituting within a range. However, swapping a GL5516 for a GL5528 without adjusting your circuit will shift your trigger thresholds dramatically.
If your LDR circuit directly triggers a relay, TRIAC, or contactor switching mains AC voltage (>50V AC), ensure your low-voltage DC sensor circuit is galvanically isolated from the mains side. Never wire an LDR directly into a mains-voltage voltage divider.
The Substitution Framework:
To maximize the voltage swing ($\Delta V$) in a standard voltage divider circuit, the fixed series resistor ($R_s$) should be the geometric mean of the LDR's dark and light resistances: $R_s = \sqrt{R_{dark} \times R_{light}}$.
If your schematic calls for a GL5528 ($R_{dark} = 1M\Omega$, $R_{10lux} = 15k\Omega$), the optimal $R_s$ is $\approx 122 k\Omega$. If you only have a GL5516 ($R_{dark} = 0.5M\Omega$, $R_{10lux} = 5k\Omega$), the optimal $R_s$ drops to $\approx 50 k\Omega$. If you substitute the part but keep the 122 kΩ resistor, your ADC resolution at the critical dusk threshold will collapse, resulting in erratic switching. Always recalculate $R_s$ when changing LDR suffixes.
Bench Scenario: The Streetlight Simulator That Failed at Dusk
Theory only gets you so far. Here is a real-world failure analysis from a recent bench prototype involving an ESP32-based dusk-to-dawn LED driver.
The Setup:
A voltage divider was constructed using a 3.3V Vcc, a GL5528 LDR connected to ground, and a 10 kΩ fixed resistor connected to Vcc. The midpoint was wired to GPIO 34 (ADC1_CH6) on an ESP32 DevKit v1. The firmware was programmed to turn on a MOSFET-driven LED array when the ADC reading dropped below 1.5V (indicating falling light levels). The entire assembly was mounted inside a 3D-printed PETG enclosure with a 2mm thick translucent white wall covering the sensor.
The Numbers:
At an ambient 10 lux (dusk), the bare GL5528 should read ~15 kΩ.
$V_{out} = 3.3V \times \left( \frac{15k\Omega}{10k\Omega + 15k\Omega} \right) = 1.98V$.
As light falls to 2 lux, LDR resistance rises to ~40 kΩ.
$V_{out} = 3.3V \times \left( \frac{40k\Omega}{10k\Omega + 40k\Omega} \right) = 2.64V$.
The 1.5V threshold should theoretically trigger well before pitch black.
The Outcome:
The LEDs refused to turn on at dusk. They only activated when the room was in near-total darkness (under 0.5 lux), causing the ESP32 ADC to read above 3.0V.
What Went Wrong:
The 2mm PETG enclosure wall acted as an unintended optical filter and physical baffle. PETG attenuates specific visible wavelengths, and the physical lip of the 3D-printed housing cast a shadow over the 5mm sensor face. The effective lux hitting the CdS track was only ~1.5 lux when the ambient room was at 10 lux. Furthermore, the ESP32's ADC is notoriously non-linear at the extremes of its 0-3.3V range (Espressif ADC Documentation).
The Fix: The sensor was relocated to a small PCB-mounted light pipe extending outside the enclosure. The fixed resistor was swapped to 20 kΩ to better center the voltage swing within the ESP32's linear ADC range (0.1V to 3.1V), and the software threshold was recalibrated to 2.1V.
Failure Modes and Visual Symptoms
While passive, LDRs are not immortal. They degrade based on environmental and electrical stress. When troubleshooting a faulty light-sensing circuit, inspect the component for these specific failure modes:
- Moisture Ingress (Delamination):
- Visual Symptom: A milky white haze or micro-cracking under the clear epoxy dome. The epoxy has separated from the ceramic substrate.
- Electrical Result: Dark resistance plummets from 1 MΩ to 20 kΩ - 50 kΩ due to surface leakage currents across the damp ceramic. The circuit will 'think' it is always slightly illuminated, causing dark-activated relays to chatter or fail to engage.
- Overcurrent / Thermal Runaway:
- Visual Symptom: Scorch marks, blistering, or a melted appearance on the zig-zag cadmium sulfide track. In severe cases, the ceramic substrate is cracked down the middle.
- Electrical Result: Open circuit (infinite resistance in both light and dark) if the track vaporizes, or a permanent low-resistance short if the melted semiconductor material bridges the interdigitated gaps. This happens when designers forget to calculate power dissipation ($P = V^2 / R$) during the bright-daylight low-resistance state.
- Light Fatigue (Memory Effect):
- Visual Symptom: None. The part looks perfectly pristine.
- Electrical Result: CdS cells suffer from 'light memory.' If left exposed to high-intensity sunlight (100,000 lux) for days, the crystalline structure shifts. When moved to a dark room, the resistance may only climb to 200 kΩ instead of the specified 1 MΩ, taking hours or days to recover its baseline. For precision applications, you must periodically 'rest' the sensor in total darkness or use a mechanical shutter.
For deeper theoretical background on the photoconductive effect and bandgap physics governing these cells, refer to the Electronics Tutorials LDR Guide or Adafruit's Photocell Overview. Understanding the physical limitations of the CdS material is the only way to design reliable, long-lasting optical circuits without resorting to expensive digital light sensors.






