An LDR (Light Dependent Resistor), commonly called a photoresistor, is a passive, bidirectional component whose electrical resistance drops as incident light intensity increases. Unlike photodiodes or phototransistors, an LDR has no PN junction and no polarity. In total darkness, a standard 5mm Cadmium Sulfide (CdS) cell like the ubiquitous GL5528 exhibits 1MΩ to 10MΩ; under 10 lux (dim twilight), it drops to ~20kΩ, and at 100 lux (a well-lit workbench), it falls to ~5kΩ. While modern ambient light sensors have largely replaced them in commercial consumer electronics, LDRs remain a staple in DIY mains-switching projects, analog synthesizers, and educational kits due to their simplicity and high current-handling capability.

Decoding LDR Markings and Datasheet Specs

If you pull a handful of LDRs from a bin, you will quickly notice that most cheap CdS cells lack alphanumeric codes printed on their epoxy domes. Instead, manufacturers use color-coding on the zigzag cadmium sulfide track or the lead wire sleeves to denote the series. According to standard photoresistor theory and manufacturing practices, the track color and physical diameter are your primary identification tools.

  • GL5516 (5mm, Orange/Red Track): Low resistance profile. Yields 5kΩ–10kΩ at 10 lux. Used in high-sensitivity light barriers.
  • GL5528 (5mm, Greenish Track): The industry standard. Yields 10kΩ–20kΩ at 10 lux. Ideal for general-purpose dusk-to-dawn switching.
  • GL5537 (7mm, Yellow/Clear Track): Larger surface area, higher dark resistance. Yields 20kΩ–30kΩ at 10 lux. Better for low-light astrophotography triggers.

Premium parts, such as the legacy PerkinElmer/Excelitas VT90N2, do print codes. In the VT90N2 nomenclature, VT indicates the visible spectrum, 90 denotes the package size, N stands for a narrow gap (yielding faster response times), and 2 specifies the exact resistance curve. Always check the datasheet for the "Gamma" (γ) value, which defines the slope of the resistance-to-light logarithmic curve. A γ of 0.8 means the resistance drops more aggressively at low light levels compared to a γ of 0.5.

LDR Type Comparison: Materials and Selection Criteria

Not all photoresistors are made of Cadmium Sulfide. The semiconductor material dictates the spectral response, temperature coefficient, and speed. Here is how to select the right material for your specific job.

Material Peak Wavelength Tolerance (@ 10 lux) Tempco (ppm/°C) Typical Use Case
CdS (Cadmium Sulfide) ~540 nm (Green) ±20% to ±50% -2000 to -4000 Streetlights, nightlights, analog synths
CdSe (Cadmium Selenide) ~720 nm (Red/NIR) ±30% -5000 to -8000 Infrared proximity, flame detection
PbS (Lead Sulfide) ~2000 nm (Mid-IR) ±15% Highly variable Thermal imaging, gas analysis (requires cooling)
InSb (Indium Antimonide) ~5000 nm (Far-IR) ±10% Extreme drift Cryogenic astronomy, missile guidance
Selection Rule of Thumb: Choose CdS when you need to mimic the human eye's spectral response (peaking in the green/yellow range). Choose PbS only if you are designing mid-infrared thermal sensors and have the budget for thermoelectric cooling. For 95% of hobbyist and DIY mains-voltage projects, CdS (specifically the GL5528) is the correct and most cost-effective choice.

Bench Scenario: The Dusk-to-Dawn Controller Failure

Theory is clean; the bench is messy. Here is a real-world walkthrough of a failed LDR circuit that highlights the non-obvious limitations of photoresistors.

The Setup: I was prototyping a 12V dusk-to-dawn relay driver to control a courtyard LED array. The circuit used a GL5528 LDR in a voltage divider with a 10kΩ fixed resistor, feeding the base of a 2N2222 NPN transistor through a 4.7kΩ base resistor. The goal was to trip the 50mA relay coil exactly at 15 lux (civil twilight).

The Numbers: At 15 lux, the GL5528 datasheet specifies a resistance of roughly 15kΩ.
Voltage at the divider node: V_out = 12V * (10kΩ / (15kΩ + 10kΩ)) = 4.8V.
Base current: I_B = (4.8V - 0.7V V_BE) / 4700Ω = 0.87mA.
With a 2N2222 hFE of ~150, this provides over 130mA of collector current capability—more than enough to saturate the transistor and drive the 50mA relay coil.

The Outcome: On the bench, under a static desk lamp, the relay clicked on and off perfectly as I covered the LDR with my hand. Deployed outside, it failed catastrophically. At dusk, the relay chattered wildly for ten minutes, the 2N2222 grew hot enough to burn my finger, and the relay contacts eventually welded shut.

What Went Wrong: Two distinct LDR characteristics caused this. First, CdS cells suffer from a memory effect (hysteresis) and a slow recovery time (20–50ms). As thin clouds passed over the setting sun, the light level oscillated rapidly around the 15 lux threshold. Second, the circuit lacked a Schmitt trigger or comparator hysteresis. The LDR's slow response combined with the oscillating light forced the 2N2222 to linger in its linear (active) region rather than switching cleanly between cutoff and saturation. In the linear region, with V_CE at ~6V and I_C at ~25mA, the transistor dissipated 150mW of heat while the relay coil received insufficient voltage, causing the mechanical chatter.
The Fix: I replaced the raw transistor switch with an LM393 comparator, adding a 100kΩ positive feedback resistor to introduce 200mV of hysteresis, ensuring a clean, single transition regardless of cloud cover.

Failure Modes and Visual Diagnostics

Photoresistors are generally robust, but they degrade predictably when pushed past their physical limits. If your circuit is misbehaving, inspect the LDR for these specific visual symptoms:

  1. Moisture Ingress and Delamination:
    • Visual Symptom: The clear or tinted epoxy dome turns cloudy, milky, or yellow. The edge seal where the epoxy meets the ceramic substrate may visibly lift.
    • Electrical Result: Dark resistance plummets from >1MΩ to <100kΩ. The circuit thinks it is always slightly illuminated.
  2. Overcurrent Thermal Runaway:
    • Visual Symptom: The internal CdS track physically blisters, or there are distinct black scorch marks on the white ceramic substrate visible through the dome.
    • Electrical Result: Permanent open circuit or erratic resistance spikes. This happens when designers forget that a standard 5mm LDR has a maximum power dissipation of only 100mW to 150mW. Connecting an LDR directly across a 5V or 12V rail without a series current-limiting resistor will fry it in seconds.
  3. Cadmium Migration (Dendrite Growth):
    • Visual Symptom: Under a 10x loupe, you can see tiny silver or grey metallic whiskers bridging the gaps between the zigzag tracks.
    • Electrical Result: A permanent low-resistance short, even in pitch black. This is caused by prolonged exposure to high humidity combined with a continuous DC bias voltage across the cell, causing cadmium ions to migrate.

Safe Substitution and RoHS-Compliant Alternatives

When you are out of stock on a specific LDR, or when you need to transition a prototype to a commercial product, you must understand how to substitute safely.

Substituting LDR for LDR: If your design calls for a GL5528 (10kΩ–20kΩ @ 10 lux) but you only have GL5537s (20kΩ–30kΩ @ 10 lux), you can drag the resistance curve down by placing a fixed resistor in parallel. Using the parallel resistance formula 1/R_total = 1/R_LDR + 1/R_fixed, placing a 30kΩ resistor in parallel with the GL5537 will yield roughly 12kΩ at 10 lux, closely mimicking the GL5528. Note that this also reduces the maximum dark resistance, which may increase your circuit's standby current draw.

The RoHS Problem and Modern Alternatives: Under the EU RoHS Directive, Cadmium is a strictly restricted hazardous substance. While some legacy exemptions existed for optical sensors, new commercial designs in the UK and EU cannot use CdS LDRs. If you are designing for production, you must substitute the LDR with an active semiconductor.

The most common drop-in replacement in the maker space is the TEMT6000 ambient light phototransistor (costing roughly $0.80 per module, compared to $0.05 for a raw GL5528). However, the substitution is not a simple 1:1 swap. An LDR is a pure resistor; you can pass AC or DC current through it in either direction. The TEMT6000 is an NPN phototransistor. It requires a strict DC polarity (Collector to VCC via a pull-up resistor, Emitter to GND) and outputs a voltage proportional to light, rather than acting as a variable resistor to ground. Furthermore, the TEMT6000 responds in microseconds, completely eliminating the LDR's memory effect and chatter issues, but requiring you to add a low-pass RC filter (e.g., 10kΩ and 100nF) if your environment has 50/60Hz flickering fluorescent lights that would otherwise cause your microcontroller's ADC to read noisy data.

For high-precision or high-speed applications, bypass photoresistors entirely and use a reverse-biased photodiode like the BPW34 paired with a transimpedance op-amp. It costs more and requires a dual-rail or virtual-ground power supply, but it provides linear, temperature-stable, and microsecond-fast light measurement that an LDR simply cannot match.