A photocell resistor (commonly called a Light Dependent Resistor or LDR) is a passive optoelectronic component whose electrical resistance drops inversely with incident light intensity. A standard 5mm Cadmium Sulfide (CdS) cell like the ubiquitous GL5528 measures roughly 1 MΩ in total darkness and drops to 10–20 kΩ under 10 lux (dim room light), falling as low as 1 kΩ in direct sunlight. Unlike active semiconductor sensors, it requires no bias voltage to operate, making it a staple in dusk-to-dawn switches and solar trackers. However, its slow response time (tens of milliseconds), severe temperature coefficients, and heavy-metal construction demand careful circuit design and an understanding of its physical limits.
Decoding Photocell Resistor Markings and Specs
Unlike resistors with their standardized color bands, photocell resistors rely on alphanumeric codes printed on the back of the substrate or stamped on the packaging. The most common series you will encounter on the bench is the GL55xx line. Here is how to read the physical part:
- Prefix (GL): Originally denoted the manufacturer (often General Sensor or similar), but has become a genericized industry standard prefix for epoxy-drip CdS cells.
- Diameter Code (55): Indicates the physical face diameter of the sensor. "55" translates to approximately 5mm. You will also see "75" for 7mm cells and "125" for 12mm cells, which offer higher power dissipation and lower dark resistance.
- Profile Code (16, 28, 39): The final two digits define the specific resistance curve.
- GL5516: High sensitivity. Drops to 5 kΩ at 10 lux. Best for bright-light triggers.
- GL5528: The general-purpose workhorse. Drops to 10–20 kΩ at 10 lux. Ideal for standard dusk/dawn switching.
- GL5539: Low sensitivity / high dark resistance. Drops to 30–90 kΩ at 10 lux. Used when you need the circuit to stay off until light levels are quite high.
Material Types and Safe Substitution Matrix
Choosing the right photosensitive component depends entirely on your required response time, spectral sensitivity, and circuit topology. If you cannot source an exact CdS photocell resistor, or if your application requires faster switching, you must understand how to substitute safely.
| Sensor Type | Construction | Tolerance | Tempco (Temp. Coefficient) | Typical Use Case |
|---|---|---|---|---|
| CdS Photoresistor (e.g., GL5528) | Epoxy drip on ceramic substrate, zig-zag trace | ±20% to ±50% | ~ -0.5%/°C (Highly variable) | Dusk-to-dawn streetlights, slow solar trackers |
| PbS Photoresistor (e.g., P224) | TO-18 metal can with glass window | ±20% | Highly variable, requires temp compensation | Infrared flame detection, spectrometry |
| Phototransistor (e.g., TEPT4400) | Epoxy TO-92 or 3mm/5mm LED-style clear package | ±10% (binned) | ~ -0.2%/°C | Optical encoders, fast light-beam breaks |
| Photodiode (e.g., BPW34) | SMD or flat through-hole epoxy | ±5% | Minimal (Linear over wide range) | Precision lux meters, medical pulse oximetry |
How to Substitute Safely
If you need to replace a slow CdS photocell resistor with a phototransistor (like the TEPT4400) for faster response, you cannot simply drop it into the same footprint. A photocell resistor acts as a variable resistor, while a phototransistor acts as a current source.
To substitute safely: remove the LDR. Place the phototransistor with its collector to VCC and emitter to your analog input or logic gate. You must add a pull-down resistor (typically 100 kΩ to 1 MΩ) from the emitter to ground. Without this pull-down, the phototransistor's infinite dark resistance will leave the input node floating, causing erratic ghost-triggering from ambient electrical noise.
Bench Scenario: The Melted Dusk-to-Dawn Driver
Understanding the power limits of a photocell resistor is where most hobbyists fail. Let us walk through a real-world bench disaster to illustrate why.
The Setup
A maker was building a 12V dusk-to-dawn driver for a 2A exterior LED strip. The design used a TIP122 Darlington transistor to switch the LED load. To save components, the maker wired the GL5528 photocell resistor directly between the 12V source and the base of the TIP122, omitting a current-limiting base resistor, assuming the LDR's inherent resistance would limit the current naturally.
The Numbers
During bench testing under a bright work lamp (simulating midday sun to test the "off" state), the LDR's resistance dropped to 500 Ω. The TIP122 base-emitter junction clamped the voltage at roughly 1.4V, leaving 10.6V across the LDR.
- Current through LDR: I = V / R = 10.6V / 500 Ω = 21.2 mA
- Power dissipated by LDR: P = V × I = 10.6V × 0.0212A = 224 mW
The Outcome
Within 45 seconds, the maker smelled burning plastic. The epoxy dome of the GL5528 cracked audibly, and the component went open-circuit, leaving the TIP122 permanently off.
What Went Wrong
The absolute maximum continuous power dissipation for a standard 5mm CdS photocell resistor is 100 mW at 25°C ambient. By omitting a fixed series resistor, the maker allowed the LDR to dissipate over twice its rated power when exposed to bright light. The fix is trivial: always place a fixed resistor (e.g., 10 kΩ) in series with the LDR to cap the maximum current, ensuring the LDR only acts as a voltage divider tap rather than a primary current limiter.
Failure Modes and Visual Diagnostics
When a light-sensing circuit acts erratically, the photocell resistor is often the culprit. Here is how to diagnose failures using visual and multimeter inspections.
- Thermal Runaway (Epoxy Cracking):
- Visual Symptom: Micro-fractures radiating from the center of the clear epoxy dome, sometimes with a brown scorch mark over the cadmium sulfide trace.
- Cause: Exceeding the 100mW power limit, as detailed in the scenario above. The internal heat expands the ceramic substrate faster than the epoxy can tolerate.
- Moisture Ingress (Corrosion):
- Visual Symptom: A chalky white or green crust forming where the tinned copper leads enter the epoxy, or a cloudy, opaque appearance inside the normally clear dome.
- Cause: Used in outdoor environments without conformal coating or a weatherproof enclosure. Moisture creates parallel leakage paths across the high-impedance zig-zag trace, artificially lowering the dark resistance and causing the circuit to think it is always daytime.
- Cadmium Degradation (UV Bleaching):
- Visual Symptom: The bright orange/yellow CdS trace fades to a pale, washed-out yellow. The sensor exhibits a massive "light history" lag.
- Cause: Prolonged exposure to intense, unfiltered ultraviolet light. The crystalline structure of the CdS degrades. The sensor will respond to light but will take several minutes to return to its baseline dark resistance, ruining timing circuits.
- Mechanical Lead Fatigue:
- Visual Symptom: No visible damage to the dome, but the multimeter reads infinite resistance (open) or wildly fluctuating values when the leads are gently wiggled.
- Cause: Bending the leads too close to the epoxy body during PCB insertion. The internal crimp connecting the wire to the fragile ceramic substrate breaks.
Design Rules for Reliable Light Sensing
To ensure your photocell resistor circuit survives the jobsite and operates predictably, follow these three bench-tested design rules:
1. Match the Fixed Resistor to the Target Lux
In a standard voltage divider configuration (VCC → LDR → Vout → Fixed Resistor → GND), the output voltage is most sensitive when the LDR's resistance equals the fixed resistor's value. If you want your streetlamp to turn on exactly at twilight (approx. 50 lux), measure your specific LDR's resistance at 50 lux in a darkroom. If it reads 33 kΩ, use a 33 kΩ fixed resistor. Do not blindly use a 10 kΩ resistor just because it is in your kit.
2. Implement Hysteresis to Prevent Relay Chatter
A photocell resistor outputs an analog curve. If you feed this directly into a standard comparator or a microcontroller GPIO without hysteresis, passing clouds at twilight will cause your relay to rapidly click on and off, destroying the relay contacts. Use a Schmitt trigger IC (like the 74HC14) or an op-amp with a positive feedback resistor network to create a dead-band (e.g., turn ON at 10 lux, turn OFF at 30 lux).
3. Account for the "Light History" Effect
CdS photocell resistors suffer from a memory effect. If exposed to 10,000 lux (direct sun) and then plunged into darkness, the resistance will not instantly snap to 1 MΩ. It will decay logarithmically, taking up to 5 minutes to reach its true dark resistance. If you are building a darkroom timer or an astrophotography trigger, you must shield the sensor from bright light for several minutes prior to use, or switch to a photodiode which has zero light-history lag.
For further reading on integrating analog light sensors with microcontrollers, the Adafruit Photocell Tutorial provides excellent baseline code for ADC scaling. Additionally, Electronics Tutorials offers a deep mathematical breakdown of LDR voltage divider curves and op-amp interfacing.






