The Direct Answer: What Is a Photoresistor and How It Works
A photoresistor—also known as a Light Dependent Resistor (LDR) or photocell—is a passive semiconductor component whose electrical resistance decreases as the intensity of incident light increases. In complete darkness, a standard 5mm Cadmium Sulfide (CdS) photoresistor like the ubiquitous GL5528 exhibits 1 MΩ to 10 MΩ of resistance. Under bright room light (10 lux), that resistance drops to 10 kΩ–20 kΩ, and in direct sunlight (10,000+ lux), it can fall as low as 50 Ω to 100 Ω.
The physics relies on the internal photoelectric effect. The semiconductor material (usually CdS) has a specific bandgap. When photons with enough energy strike the surface, they excite electrons from the valence band into the conduction band, creating electron-hole pairs. More light means more charge carriers, which directly lowers the material's resistance. Think of it like a water pipe where light acts as a pressure valve: the brighter the light, the wider the valve opens, allowing current to flow more freely.
Photoresistor Types and Selection Matrix
Not all light sensors are created equal. While CdS photoresistors dominate the hobbyist market due to their low cost (often under $0.10 each in bulk), environmental regulations and specific spectral needs require knowing your alternatives. Here is how the main types compare when selecting a part for your next build.
| Parameter | CdS Photoresistor | PbS Photoresistor | Phototransistor (Alternative) |
|---|---|---|---|
| Construction | Cadmium Sulfide on ceramic substrate | Lead Sulfide thin-film | Silicon NPN bipolar junction |
| Peak Sensitivity | ~520 nm (Visible Green) | ~2000 nm (Infrared) | ~850 nm (Near-IR/Visible) |
| Typical Tolerance | ±30% to ±50% (Very wide binning) | ±20% | ±10% (Highly consistent) |
| Tempco (Temp. Coefficient) | High (Resistance drops as it heats up) | Extreme (Often requires TEC cooling) | Moderate (Predictable mV/°C shift) |
| Response Time | Slow (20ms - 50ms rise/fall) | Moderate (100µs - 1ms) | Fast (10µs - 50µs) |
| Typical Use Case | Streetlights, nightlights, basic Arduino lux meters | Spectroscopy, flame detection, IR gas analysis | Optical encoders, high-speed data links, precision robotics |
| RoHS Compliance | No (Contains heavy metal Cadmium) | No (Contains Lead) | Yes (Standard Silicon) |
Which type for which job? If you are building a simple dusk-to-dawn garden light or an Arduino-based solar tracker where response time doesn't matter, use a CdS photoresistor. If you are designing a commercial product for the EU market in 2026, RoHS compliance strictly forbids CdS; you must choose a phototransistor or a modern digital ambient light sensor (like the Adafruit VCNL4040). If you need to detect heat signatures or specific IR gas absorption bands, you must source a PbS cell.
Decoding Markings and Spec Sheet Parameters
Unlike standard resistors with their colorful 4-band or 5-band codes, photoresistors do not use a universal color code to denote their exact resistance value. Because they are analog, variable devices, reading the physical part requires looking at manufacturer binning marks and datasheets.
Physical Markings
- Part Number Stamping: High-quality cells (like the VT935G from Advanced Photonix) will have the exact alphanumeric part number printed on the back of the ceramic substrate. You can look this up directly in the manufacturer's datasheet.
- Colored Epoxy Dots: Many generic 5mm CdS cells (like the GL55xx series) feature a tiny painted dot on the edge of the substrate or the top of the epoxy dome. A red dot typically indicates a lower dark resistance bin (e.g., 0.5 MΩ), while a blue or green dot indicates a higher dark resistance bin (e.g., 2.0 MΩ). This is factory binning, not a precise value.
- Substrate Size: The physical diameter dictates the power handling and general resistance range. A 3mm cell will generally have higher dark resistance and lower power dissipation (50mW) than a 12mm cell (150mW).
Critical Datasheet Parameters
When reading a spec sheet, ignore the "maximum voltage" as your primary design constraint. Instead, focus on these three parameters:
- Dark Resistance (RD): Measured after 24 hours in complete darkness. This dictates your voltage divider's baseline current draw.
- Illuminance Resistance (at 10 Lux): This is your "working" resistance for indoor applications. 10 lux is roughly equivalent to a dimly lit living room at night.
- Spectral Response Peak: Ensure the peak wavelength matches your light source. A CdS cell peaks in the green/yellow spectrum; it will perform poorly if you try to trigger it with a deep blue or UV LED.
Real-World Failure Modes and Visual Diagnostics
Photoresistors are rugged but not invincible. When a light-sensing circuit stops working, pull the LDR and inspect it for these specific failure modes.
The "Memory Effect" (Light Fatigue): If you expose a CdS photoresistor to intense, direct light for several hours, its dark resistance will temporarily drop. When moved to a dark room, it may take several minutes (or even hours) to recover its full 1 MΩ+ dark resistance. This is a known physical characteristic of Cadmium Sulfide, not a defect. If your application requires instant dark-state recovery, you must switch to a photodiode.
Safe Substitution When the Exact LDR Is Missing
You are repairing a legacy nightlight board, and the original VT935G photoresistor is dead. You only have a generic GL5528 in your parts bin. Can you substitute it? Yes, but you must recalculate your bias network.
Most LDR circuits use a simple voltage divider to feed an analog-to-digital converter (ADC) or a comparator (like an LM393). The formula is:
V_out = V_in * (R_pull / (R_ldr + R_pull))
How to substitute safely:
- Match the Illuminance Resistance: Check the datasheet for the 10-lux resistance of the original part. If the original was 5 kΩ at 10 lux, and your substitute GL5528 is 15 kΩ at 10 lux, your voltage output will be drastically different at the same light level.
- Swap the Pull-Down/Pull-Up Resistor: To restore the original switching threshold, you must change the fixed resistor in the voltage divider to match the new LDR's mid-point resistance. If your new LDR reads 15 kΩ in your target lighting environment, change the fixed pull-down resistor to 15 kΩ. This ensures the voltage divider outputs exactly V_in / 2 at your target trigger point.
- Check Voltage Ratings: If substituting a smaller physical cell (e.g., swapping a 12mm cell for a 5mm cell), verify that the new cell's maximum AC/DC voltage rating (often 150V for 5mm, but up to 250V for larger cells) exceeds the circuit's peak voltage.
Note: You cannot directly substitute a photoresistor with a phototransistor (like the TEPT4400) without redesigning the circuit. A phototransistor requires a bias current and acts as a current source, not a variable resistor. For a deep dive on why, read this excellent guide on LDR vs Phototransistor biasing from All About Circuits.
Photoresistor FAQ
What is a photoresistor used for in Arduino projects?
In Arduino and ESP32 projects, photoresistors are primarily used as analog ambient light sensors. By wiring the LDR in a voltage divider with a 10 kΩ fixed resistor and reading the center point with an analog pin (e.g., analogRead(A0)), makers build automatic nightlights, solar-tracking heliostats, and smart blinds. Because the Arduino ADC reads voltage (0-5V), not resistance directly, the voltage divider is mandatory to convert the LDR's changing resistance into a readable 0-1023 integer value.
What is the difference between a photoresistor and a photodiode?
A photoresistor (LDR) is a passive, bidirectional resistor whose bulk material changes conductivity based on light; it has no polarity and operates on the photoconductive principle. A photodiode is an active, polarized semiconductor PN-junction that generates a tiny current (in the microamp range) when struck by photons, operating on the photovoltaic or photoconductive principle. Photoresistors are slow (milliseconds) and great for simple switching. Photodiodes are extremely fast (nanoseconds), highly linear, and required for fiber optics or high-speed data transmission, but they require complex transimpedance amplifier circuits to be useful.
Can a photoresistor work with AC voltage?
Yes. Because a photoresistor is essentially just a variable resistor made of bulk semiconductor material, it is completely non-polarized and bidirectional. It will pass AC current just as easily as DC current, making it ideal for direct-in-line AC switching circuits (like classic analog streetlamp controllers) where it drives a TRIAC or relay coil. Just ensure the peak AC voltage does not exceed the component's maximum voltage rating (typically 150V AC RMS for standard 5mm cells) and that the power dissipation stays under 100mW.
Why is my photoresistor reading erratic values on my multimeter?
Erratic readings on a DMM usually point to three issues. First, 60Hz/50Hz flicker from fluorescent or cheap LED room lighting can cause the LDR's resistance to oscillate rapidly, which a slow-sampling multimeter interprets as erratic jumping. Shield the sensor with your hand to test this. Second, poor breadboard contact or oxidized leads on the LDR will cause resistance spikes when the wire is wiggled. Third, if the LDR is exposed to a heat source (like a power resistor or voltage regulator nearby), the massive temperature coefficient of the CdS material will cause the resistance to drift unpredictably as the ambient air temperature fluctuates.






