The Direct Answer: Selecting and Sizing Light Detecting Resistors
If you need a visible-light sensor for a low-speed, low-cost analog circuit (like an automatic nightlight or streetlamp trigger), use a Cadmium Sulfide (CdS) light detecting resistor (LDR). The industry-standard hobbyist part is the GL5528, which offers a dark resistance of ~1 MΩ and an illuminated resistance of 10–20 kΩ at 10 lux. They cost roughly $0.10 in bulk and interface directly with microcontroller ADCs via a simple voltage divider.
However, if your application requires detecting infrared light, or if you need a response time faster than 20 milliseconds, abandon LDRs entirely. For high-speed or IR applications, you must use a photodiode or phototransistor. Furthermore, because cadmium is a heavy metal, CdS LDRs are not RoHS-compliant; if you are designing a commercial product for the EU market, you must specify alternative RoHS-compliant photoresistors (like the Advanced Photonix VT935G series) or switch to active silicon sensors.
LDR Material and Type Comparison Matrix
Not all photoresistors react to the same light spectrum. The semiconductor material used in the manufacturing process dictates the spectral peak, baseline resistance, and thermal drift. Use this matrix to select the right chemistry for your job.
| Material | Spectral Peak | Dark Resistance | Response Time | Tempco (Drift) | Typical Use Case |
|---|---|---|---|---|---|
| Cadmium Sulfide (CdS) | 540 nm (Visible Green) | 1 MΩ - 10 MΩ | 20 - 50 ms | Moderate (-0.5%/°C) | Streetlights, camera light meters, nightlights |
| Lead Sulfide (PbS) | 2000 nm (Near-IR) | 100 kΩ - 1 MΩ | 100 - 300 µs | High (Requires TEC cooling) | Flame detection, IR spectroscopy, missile tracking |
| Indium Antimonide (InSb) | 5000 nm (Mid-IR) | Variable | < 1 µs | Extreme (Cryogenic only) | Thermal imaging, astronomy, gas analysis |
| Gallium Nitride (GaN) | 365 nm (UV) | 10 MΩ+ | 1 - 5 ms | Low | UV index monitoring, flame/arc detection |
Bench Note: For 95% of maker and DIY electrical projects, CdS is the only material you will encounter. PbS and InSb sensors cost upwards of $50 to $500+ and require specialized transimpedance amplifiers and thermal cooling.
Decoding LDR Markings and Physical Identification
Unlike standard 1/4W carbon film resistors, light detecting resistors do not use color bands to indicate their resistance values. Because their resistance is entirely dependent on ambient photons, a static color code would be meaningless. Instead, manufacturers use physical dimensions and alphanumeric codes printed on the rear substrate.
Reading the GL55xx Series Codes
The most common LDRs on the market are the GL55 series. Here is how to decode the physical markings and dimensions:
- The '55' Prefix: Indicates a cadmium sulfide photoresistor with a standard 5.5mm face diameter.
- The '16' Suffix (GL5516): Illuminated resistance (at 10 lux) is 5–10 kΩ. Dark resistance is ~0.5 MΩ.
- The '28' Suffix (GL5528): Illuminated resistance (at 10 lux) is 10–20 kΩ. Dark resistance is ~1 MΩ. (This is the default choice for Arduino/ESP32 voltage dividers).
- The '37' Suffix (GL5537): Illuminated resistance is 20–30 kΩ. Dark resistance is ~2 MΩ.
- The '39' Suffix (GL5539): Illuminated resistance is 50–100 kΩ. Dark resistance is ~5 MΩ.
Face and Epoxy Markings
Look at the front serpentine trace. The epoxy coating over the cadmium sulfide might be tinted. A clear epoxy passes the full visible spectrum. A dark red or amber tint acts as an optical filter, blocking blue/green light and making the sensor more sensitive to incandescent bulbs or sunset conditions while rejecting fluorescent flicker.
Failure Modes and Visual Diagnostics
Photoresistors are passive, but they are not invincible. When an LDR fails in the field, it usually presents one of three distinct visual and electrical symptoms.
- Moisture Ingress and Delamination:
- Visual Symptom: The top epoxy dome looks cloudy, swollen, or is physically peeling away from the ceramic substrate.
- Electrical Symptom: The dark resistance plummets to a few kilo-ohms, and the sensor acts as if it is always in bright light.
- Fix: Discard. Moisture has permanently contaminated the cadmium sulfide layer. For outdoor enclosures, you must pot the LDR in a transparent, UV-stable silicone conformal coating.
- Thermal Runaway and Overvoltage:
- Visual Symptom: The ceramic back is scorched brown or black, and the serpentine trace shows a physical break or melt divot. You may smell burning ozone or sulfur.
- Electrical Symptom: Infinite resistance (open circuit) in all lighting conditions.
- Fix: Check your bias voltage. Standard 5.5mm LDRs have a maximum power dissipation of roughly 100mW. If you place a GL5528 in a 12V circuit with a 1kΩ pull-down resistor in direct sunlight (LDR drops to 2kΩ), the current will exceed the LDR's thermal limits. Always calculate worst-case bright-light current.
- The 'Memory Effect' (Hysteresis Fatigue):
- Visual Symptom: None. The part looks pristine.
- Electrical Symptom: After exposure to intense light (like direct sunlight), the LDR takes several minutes to return to its rated 1 MΩ dark resistance, lingering around 100 kΩ and causing false triggers in dusk-to-dawn circuits.
- Fix: This is an inherent chemical property of CdS. If your circuit requires rapid, precise dark-state recovery, you must shield the LDR from extreme lux spikes using a physical hood or baffle, or switch to a phototransistor.
Safe Substitution When the Exact Photoresistor is Missing
You are at the bench, and you only have a GL5516, but the schematic calls for a GL5528. Can you swap them? Yes, but you must recalculate your voltage divider to maintain the correct switching threshold.
Microcontrollers and comparators read LDRs using a voltage divider. The formula is:
V_out = V_in * (R_fixed / (R_fixed + R_LDR))
The Golden Rule of Substitution: Your fixed resistor (R_fixed) should ideally match the geometric mean of the LDR's dark and light resistances to maximize the analog swing.
- For a GL5528 (1 MΩ dark, 15 kΩ light), the geometric mean is ~122 kΩ. A 100 kΩ fixed resistor is the standard bench choice.
- For a GL5516 (500 kΩ dark, 8 kΩ light), the geometric mean is ~63 kΩ. A 47 kΩ or 68 kΩ fixed resistor will yield a much better ADC spread than a 100 kΩ resistor.
What if you only have a phototransistor (e.g., TEPT5600)? You cannot drop it directly into an LDR footprint. A phototransistor requires a pull-down resistor to ground on the emitter, and the base is left floating (or tied to a bias voltage). Furthermore, phototransistors output microamps of current, not a passive resistance change. You will need to adjust your microcontroller code, as the voltage curve will be linear to light intensity, whereas an LDR's resistance curve is logarithmic.
Light Detecting Resistors FAQ
Why is my light detecting resistor reacting slowly to shadows?
CdS photoresistors have an inherent physical latency known as 'response time,' which is typically 20 to 50 milliseconds for a drop in light, but can be up to 1000 milliseconds for a return to darkness. If you are trying to use an LDR to count objects passing on a conveyor belt or decode optical pulses, the chemical lattice cannot recombine electrons fast enough. For high-speed shadow detection, you must use a photodiode or an optical interrupter module (like the LM393-based IR obstacle sensors).
Can I use a light detecting resistor directly on a 120V AC mains circuit?
Technically, some heavy-duty LDRs are rated for 150VDC/AC peak, and old-school incandescent nightlights wired them in series with a low-wattage bulb. However, doing this in modern DIY projects is highly discouraged and violates NEC-style guidance for low-voltage control isolation. If the LDR substrate cracks, 120V AC will travel through your control wiring. Always use the LDR on a 3.3V or 5V DC circuit to trigger an opto-isolator (like a PC817) or a solid-state relay, keeping the mains voltage completely isolated from your sensor.
Are cadmium sulfide light detecting resistors RoHS compliant?
No. Cadmium is a restricted heavy metal under the EU's Restriction of Hazardous Substances (RoHS) directive. While you can still buy GL55xx LDRs for hobbyist and prototyping use, you cannot legally manufacture and sell a CdS-based product in the EU or California without specific exemptions. For commercial, RoHS-compliant designs, engineers substitute CdS LDRs with RoHS-compliant ambient light sensor ICs (like the Vishay VEML7700) or discrete silicon phototransistors paired with a visible-light filter.
How do I waterproof an LDR for an outdoor garden light?
Do not use heat-shrink tubing over the face of the LDR, as the glue will melt and cloud the sensor, and the plastic will block UV/IR spectra unevenly. Instead, mount the LDR into a 3D-printed or machined bezel that features a physical 'hood' to block direct rain. Coat the exposed face and the lead wire junctions with a clear, optical-grade silicone conformal coating (such as MG Chemicals 422C). Avoid standard epoxy resins, as many cure with a yellow tint that will artificially shift the LDR's spectral peak toward the red end of the spectrum.
References & Further Reading:
For detailed hook-up guides and voltage divider math, refer to the Adafruit Photocell Tutorial. For deep-dive semiconductor theory on photoconductivity, see the All About Circuits Photoresistor Chapter.






