A photoresistor, commonly called a Light Dependent Resistor (LDR) or photocell, is a passive, variable resistor whose electrical resistance decreases as the intensity of incident light increases. In total darkness, a standard cadmium sulfide (CdS) cell exhibits a resistance of >1 MΩ, which can plummet to 1 kΩ - 5 kΩ under bright room lighting (100 lux). This inverse relationship between photons and resistance makes the LDR a foundational component for analog light-sensing circuits, from automatic streetlights to camera exposure meters.

However, treating an LDR like a simple switch is a fast track to a jittery, unreliable design. Photoresistors suffer from latency, temperature drift, and historical hysteresis. This guide breaks down the physical construction, decoding markings, and real-world bench behavior of LDRs so you can select the right part and avoid common integration traps.

The Physics and Markings: Decoding Your LDR

At the semiconductor level, an LDR relies on photoconductivity. When photons with sufficient energy strike the semiconductor material (usually CdS), they excite electrons from the valence band into the conduction band. More free electrons mean higher conductivity, which translates to lower resistance.

If you look closely at the face of a standard 5mm LDR, you will see a zigzag or serpentine trace. This geometry is deliberate: it maximizes the length of the semiconductor path while minimizing its width. A longer, narrower path yields a higher dark resistance and a more dramatic ratio between dark and light states.

How to Read the Markings

Unlike standard carbon-film resistors that use color bands, LDRs rely on alphanumeric codes printed directly on the epoxy coating. Understanding these codes tells you the physical size and the specific resistance curve bin.

  • GL55xx Series (Generic/Asian Market): 'GL' denotes a generic CdS photocell. '55' indicates a 5mm diameter package. The last two digits (e.g., '16', '28', '39') define the specific light/dark resistance bin. A GL5516 has a lower light resistance (approx. 5-10 kΩ at 10 lux) than a GL5539 (approx. 30-90 kΩ at 10 lux).
  • VT90N2 (Advanced Photonix/Excelitas): 'VT' indicates the proprietary series. '90' refers to the package style. 'N' denotes a narrow resistance tolerance (±10% instead of standard ±30%), and '2' specifies the exact resistance bin at 1 foot-candle (10.76 lux).
RoHS Compliance Warning: Cadmium Sulfide (CdS) contains heavy metals and is strictly restricted under EU RoHS directives. If you are designing a commercial product for the European market in 2026, you cannot use standard CdS LDRs. You must substitute them with RoHS-compliant Ambient Light Sensors (ALS) like the Vishay TEMT6000 or phototransistors.

Photoresistor Types and Selection Matrix

Choosing the right LDR depends entirely on the wavelength of light you need to detect and the environmental constraints of your enclosure. Below is a spec-sheet-style comparison of the three primary photoresistor chemistries used in electronics.

Material Construction & Spectral Peak Tolerance & Tempco Response Time Typical Use Case
CdS (Cadmium Sulfide) Serpentine trace on ceramic substrate, epoxy sealed. Peaks at ~520nm (visible green/yellow). ±20% to ±50%. High tempco; resistance drops as temperature rises in the dark. Slow (20ms - 50ms rise/fall). Streetlights, nightlights, basic camera lux meters, solar garden lights.
PbS (Lead Sulfide) Thin-film deposition on glass, often hermetically sealed in metal TO-18 cans with IR-pass windows. Peaks at ~2.0µm (Near-IR). ±10%. Requires temperature stabilization for precision; highly sensitive to ambient heat. Fast (100µs - 500µs). Flame detection, IR spectroscopy, missile plume tracking, gas analysis.
InSb (Indium Antimonide) Epitaxial crystal growth, requires cryogenic cooling (liquid nitrogen or thermoelectric). Peaks at ~5.5µm (Mid-IR). Extremely tight when cooled. Uncalibrated at room temp due to massive thermal noise. Ultra-fast (< 1µs). Thermal imaging arrays, astronomical telescopes, military target acquisition.

For 95% of hobbyist and commercial DIY projects involving visible light, the CdS cell (like the GL5528) is the default choice due to its low cost (under $0.15 in bulk) and ease of interfacing with standard op-amps and microcontrollers.

Real-World Scenario: The Automated Greenhouse Shade Controller

To understand where LDRs fail in practice, let us look at a bench-tested scenario involving an automated greenhouse shade system that misbehaved during deployment.

The Setup

The goal was to trigger a 12V DC motor to roll down a shade cloth when direct sunlight exceeded 5,000 lux, preventing tomato seedlings from scorching. The circuit used a GL5516 LDR in a voltage divider feeding the non-inverting input of an LM393 comparator.
Topology: LDR connected to 5V Vcc; a 10 kΩ fixed bias resistor connected to GND. The midpoint fed the comparator, which was referenced to a 2.5V threshold.

The Numbers

According to the GL5516 datasheet, resistance at 10 lux is ~8 kΩ, and at 100 lux it is ~1.5 kΩ. Extrapolating for 5,000 lux (bright direct sun), the LDR resistance drops to roughly 350 Ω.
Voltage at the midpoint ($V_{out}$) is calculated as: $V_{out} = 5V \times \frac{10,000}{R_{LDR} + 10,000}$.
At 5,000 lux (350 Ω): $V_{out} = 5V \times \frac{10,000}{10,350} = 4.83V$. This easily exceeds the 2.5V trip point.

The Outcome and What Went Wrong

On the bench under a controlled desk lamp, the circuit tripped perfectly. In the greenhouse, the shades jittered violently on partly cloudy days and eventually failed to deploy by noon. Two physical realities of the CdS LDR ruined the design:

  1. The Memory Effect (Hysteresis): CdS cells do not react instantaneously to light changes. If an LDR is kept in the dark for hours and then suddenly exposed to bright light, its resistance drops rapidly at first, then continues to drift downward for several minutes. The comparator was tripping, then un-tripping as the LDR 'settled' into its true 5,000 lux resistance state.
  2. Temperature Coefficient Drift: The greenhouse ambient temperature hit 45°C (113°F). CdS cells exhibit a negative temperature coefficient in low light, but in high-illumination states, thermal noise increases the baseline carrier concentration, skewing the expected 350 Ω reading and altering the voltage divider output by up to 15%.

The Fix: The LDR was replaced with a BPW34 silicon PIN photodiode paired with a transimpedance amplifier (TIA) using an LM358 op-amp. Photodiodes have microsecond response times and zero memory effect, providing a rock-solid, instantaneous voltage proportional to lux.

Failure Modes and Visual Diagnostics

Photoresistors are generally robust, but they degrade under specific environmental stresses. When debugging a faulty light-sensing circuit, pull the LDR and inspect it under a magnifying loupe for these visual symptoms.

Failure Mode Visual Symptom Electrical Symptom Root Cause
Moisture Ingress (Silver Migration) Dark, blackish spiderweb tracks visible under the clear epoxy coating. Permanently low resistance (acts as a short circuit, e.g., 50 Ω in the dark). Humidity breaches the epoxy seal, causing the silver interdigitated electrodes to migrate and bridge the gaps.
Thermal Runaway / Overvoltage Blistered, melted, or cracked epoxy face; distinct burnt plastic odor. Open circuit (infinite resistance) or wildly erratic, jumping readings. Exceeding the maximum power dissipation rating (typically 100mW for 5mm parts). $I^2R$ heating destroys the semiconductor lattice.
Photodegradation (Wear-out) The bright orange/yellow serpentine pattern looks bleached, chalky, or faded white. Dark resistance drops significantly (e.g., reads 100 kΩ instead of >1 MΩ in total darkness). Years of continuous UV exposure permanently alters the crystal structure, reducing the dark-state bandgap barrier.

Safe Substitution When the Exact Part is Missing

If your local supplier is out of GL5528s and you only have GL5516s, or if you need to swap an LDR for a phototransistor to meet RoHS compliance, you cannot simply drop the new part into the existing PCB footprint without recalculating the bias network. Follow these steps to substitute safely.

Substituting One LDR for Another (e.g., GL5528 to GL5516)

  1. Identify the Target Lux Threshold: Determine the exact light level (in lux) where your circuit must trigger.
  2. Lookup the New LDR's Resistance: Check the datasheet for the substitute part's resistance at that specific lux level. (e.g., GL5516 at 100 lux is ~1.5 kΩ; GL5528 at 100 lux is ~4 kΩ).
  3. Recalculate the Bias Resistor: For maximum voltage swing in a divider, the optimal fixed bias resistor ($R_{bias}$) is the geometric mean of the LDR's dark and light resistances at your operating extremes.
    Formula: $R_{bias} = \sqrt{R_{dark} \times R_{light}}$
    If your new LDR has a lower light resistance, you must decrease the value of your fixed bias resistor to keep the midpoint voltage in the readable range of your microcontroller's ADC (typically 0-3.3V or 0-5V).

Substituting an LDR with a Phototransistor (e.g., TEPT4400)

If you are forced to abandon CdS LDRs for environmental compliance, an ambient light phototransistor like the Vishay TEPT4400 is the closest drop-in functional equivalent, but the physics differ fundamentally.

  • The Difference: An LDR is a variable resistor; a phototransistor is a light-controlled current source.
  • The Wiring Change: You must wire the phototransistor's emitter to GND and the collector to Vcc through a pull-up resistor. As light hits the base junction, it allows current to flow, pulling the collector voltage down.
  • The Math: Calculate the pull-up resistor using Ohm's law based on the phototransistor's light current ($I_L$). If the TEPT4400 sources 1.2 mA at 100 lux, and you want a 2.5V drop across the resistor at 5V Vcc: $R = \frac{5V - 2.5V}{0.0012A} = 2,083 Ω$. Use a standard 2 kΩ or 2.2 kΩ resistor.

By treating the photoresistor not as a magic light-switch, but as a semiconductor device with specific latency, thermal drift, and geometric constraints, you can design light-sensing circuits that survive the transition from the controlled workbench to the harsh realities of outdoor deployment. For further reading on sensor interfacing, consult the Electronics Club sensor guide or review application notes on LDR voltage divider topologies to refine your ADC scaling.