If you need a circuit to react to ambient illumination without writing complex firmware, you need a photoresistor. The strict light dependent resistor definition is a passive, two-terminal semiconductor device whose electrical resistance decreases as the intensity of incident light increases. Unlike photodiodes or phototransistors, an LDR requires no bias voltage or active amplification to function; it simply acts as a variable resistor governed by photons. Inside the component, a semiconductor film (usually cadmium sulfide) absorbs light energy, exciting electrons into the conduction band and lowering the opposition to current flow.
While the theory is simple, selecting the right LDR for a specific jobsite or bench project requires navigating vague datasheets, understanding material limitations, and knowing how to adapt when your preferred part is out of stock. Here is the practical, bench-level guide to specifying, reading, and deploying LDRs.
Core Specifications and Real-World LDR Data
Before you drop an LDR into a voltage divider, you must understand its four governing parameters: Dark Resistance (measured after 5 seconds in total darkness), Illuminated Resistance (typically measured at 10 lux, roughly equivalent to twilight), Spectral Peak (the wavelength where it is most sensitive), and Response Time (the latency between a light change and the resistance shift). LDRs are notoriously slow compared to silicon photodiodes, making them useless for high-speed optical data transfer but perfect for slow-moving environmental controls.
| Model Number | Diameter | Dark Resistance (MΩ) | 10 Lux Resistance (kΩ) | Spectral Peak | Rise/Fall Time |
|---|---|---|---|---|---|
| GL5528 | 5 mm | 1.0 MΩ | 10 - 20 kΩ | 540 nm (Green) | 20-30ms / 30-50ms |
| GL5516 | 5 mm | 0.5 MΩ | 5 - 10 kΩ | 540 nm (Green) | 20-30ms / 30-50ms |
| VT90N2 (Excelitas) | 9 mm | 20.0 MΩ | 1 - 3 kΩ | 515 nm (Green) | 10-20ms / 20-40ms |
| PDV-P9203 (Advanced Photonix) | 12.7 mm | 50.0 MΩ | 0.8 - 2 kΩ | 520 nm (Green) | 5-15ms / 15-30ms |
The GL5528 remains the undisputed king of hobbyist breadboards due to its low cost and 5mm footprint, but for precision analog metering or outdoor street-light controllers, the larger VT90N2 provides a much wider dynamic range and higher dark resistance, yielding better signal-to-noise ratios in high-impedance ADC circuits.
Material Types: Which Sensor for Which Job?
Not all photoresistors are made of the same semiconductor compound. The material dictates the spectral response, temperature stability, and ultimate use case. Here is how the three primary LDR chemistries stack up against each other.
| Material | Construction | Tolerance | Tempco (Temp Coefficient) | Typical Use Case |
|---|---|---|---|---|
| Cadmium Sulfide (CdS) | Sintered film on ceramic substrate | ±30% to ±50% | -0.5%/°C | Visible light streetlights, camera exposure meters, night-lights |
| Lead Sulfide (PbS) | Evaporated thin film in hermetic can | ±20% | +0.2%/°C | Near-IR flame detection, industrial spectrometry, missile tracking |
| Indium Antimonide (InSb) | Cryogenic crystal lattice | ±10% | +0.1%/°C | Mid-IR thermal imaging, astronomy, military targeting systems |
Which type for which job? If you are building a 12V DC solar garden light or an Arduino-based sun tracker, stick to CdS. It peaks in the visible spectrum (matching human eye sensitivity) and operates at room temperature. If you are designing an industrial boiler flame-safeguard system that needs to detect the specific infrared flicker of a burning gas flame, you must step up to a PbS cell. InSb is strictly for high-end, cooled scientific equipment and will not appear in standard commercial electronics.
Decoding Physical Markings and Substitution Logic
Unlike resistors with their precise color bands, LDRs are notoriously cryptic. What do the markings mean? Most commercial CdS cells print a 4-digit code on the back or side. The first two digits (e.g., '55' in GL5528) generally indicate the physical diameter of the active area in millimeters (5mm). A '54' series means 4mm; a '75' series means 7mm. The last two digits (e.g., '28', '16', '39') are manufacturer-specific batch and curve identifiers that dictate the exact dark and illuminated resistance thresholds. Sometimes, you will see a small colored dot (green or red) painted on the epoxy dome; this indicates the specific spectral filter applied to the cell.
How to substitute safely when the exact part is missing? Never substitute an LDR based purely on physical size. If your schematic calls for a GL5528 but you only have a GL5516, the circuit will malfunction because the base resistance curve is different. To safely substitute, you must recalculate the fixed series resistor in your voltage divider.
The optimal fixed resistor ($R_{fixed}$) to maximize the voltage swing across the ADC is the geometric mean of the LDR's dark and light resistances:
$R_{fixed} = \sqrt{R_{dark} \times R_{light}}$
- Original Design (GL5528): $\sqrt{1,000,000 \Omega \times 15,000 \Omega} = \sqrt{15,000,000,000} \approx 122,474 \Omega$. You would use a 120kΩ standard resistor.
- Substitution (GL5516): $\sqrt{500,000 \Omega \times 8,000 \Omega} = \sqrt{4,000,000,000} \approx 63,245 \Omega$. You must swap the 120kΩ resistor for a 62kΩ or 68kΩ standard resistor to maintain the same analog voltage swing.
By adjusting the companion resistor, you can safely substitute almost any visible-light CdS cell for another, provided the physical footprint fits your PCB pads.
Failure Modes and Visual Diagnostics
LDRs are passive and rugged, but they are not invincible. When a light-sensing circuit fails, grab a magnifying glass and inspect the component for these specific visual symptoms.
1. Micro-Cracking in the Semiconductor Film
Visual Symptom: Under 10x magnification, the zig-zag or interdigitated conductive traces on the face of the cell show jagged, dark micro-fractures.
Cause: Mechanical stress. This happens when a technician bends the wire leads too close to the epoxy body, or when a through-hole board flexes during chassis mounting. The ceramic substrate is brittle and snaps the sintered film.
Result: Intermittent open circuit. The sensor works in the dark but drops out completely when exposed to bright light (as the substrate expands slightly from thermal heat).
2. Thermal Scorching and Delamination
Visual Symptom: A distinct brown or black halo around the clear epoxy dome, or the epoxy physically lifting away from the ceramic base.
Cause: Exceeding the maximum power dissipation rating. A standard 5mm GL5528 is rated for roughly 100mW at 25°C. If you wire it directly across a 12V source without a sufficient current-limiting resistor, the internal power dissipation ($I^2R$) cooks the component.
Result: Permanent parameter drift. The dark resistance drops significantly and will never recover, causing false 'daylight' triggers at night.
3. Moisture Ingress (The 'Cloudy Dome' Effect)
Visual Symptom: The normally crystal-clear epoxy dome turns cloudy, milky, or develops a white haze inside.
Cause: Operating in high-humidity environments (like outdoor weather stations or greenhouse controllers) without a conformal coating or protective housing. Moisture penetrates the porous epoxy seal.
Result: The water creates parallel leakage paths across the high-impedance semiconductor film, artificially lowering the dark resistance and ruining the sensor's dynamic range.
Practical Implementation: The Voltage Divider Math
An LDR cannot be read directly by a microcontroller's ADC pin; it only changes resistance, not voltage. You must pair it with a fixed resistor to create a voltage divider. For an ESP32 or Arduino Uno operating on a 3.3V or 5V logic level, the physical wiring is simple: connect one leg of the LDR to VCC, one leg of the fixed resistor to GND, and tie their shared junction to the ADC pin.
However, the math requires attention to the ADC's input impedance. If you use a massive 1MΩ fixed resistor to match a high-dark-resistance LDR, the internal sampling capacitor of the ESP32's ADC may not have enough time to charge during the sampling window, resulting in erratic, noisy readings. If your calculated $R_{fixed}$ exceeds 100kΩ, you should either buffer the signal with an op-amp voltage follower (like an LM358) or intentionally add a small 100nF ceramic capacitor between the ADC pin and GND to stabilize the voltage during the sampling phase.
Finally, remember that LDRs suffer from 'memory' or hysteresis. If an LDR is kept in total darkness for 24 hours, its resistance upon first exposure to light will be higher than if it had been exposed to ambient room light just 5 minutes prior. Always design your firmware thresholds with a 10% to 15% deadband (hysteresis loop) to prevent your relays from rapidly chattering when the sun sets or rises.






