Automatic night light
Read the LDR divider and switch an LED or relay on when ambient light drops below a set threshold, turning it off again at dawn.
A 5mm CdS photoresistor whose resistance drops from about 1 MΩ in darkness to roughly 8-20 kΩ under 10 lux of light.

The GL5528 is a cadmium sulfide (CdS) photoconductive cell: a passive, two-terminal light sensor in a 5mm epoxy-coated through-hole package. Its resistance falls as incident light rises, from a dark resistance of about 1 MΩ (minimum, at 0 lux) down to roughly 8-20 kΩ at 10 lux. It is non-polarized, so either lead can face either way in a circuit.
Its spectral response peaks near 540 nm (green light), close to the sensitivity of the human eye, which makes it a good match for sensing ambient visible light. The response is nonlinear, following a log-log resistance-versus-illuminance curve with a gamma of about 0.7 between 100 and 10 lux, and it is relatively slow compared to a photodiode, with a rise time around 20 ms and a decay time around 30 ms.
The cell is rated for up to 100 mW dissipation, a maximum of 150 V, and an operating range of roughly -30 to +70 degrees C. In practice it is wired as one arm of a voltage divider feeding an analog input, giving a cheap and simple way to detect light thresholds rather than perform precise photometry. Note that CdS cells contain cadmium and may be restricted under RoHS in some regions.
Verified from the Tinkered component library · Generic.
The GL5528 LDR connects to any of the microcontrollers supported in Tinkered.
The GL5528 outputs a varying resistance, not a logic level. Connecting it directly to a digital input gives an unreliable reading. Build a voltage divider with a fixed resistor and read the midpoint on an analog (ADC) input.
Placing the LDR alone between VCC and an ADC pin leaves the input floating with no defined voltage. You need the series fixed resistor so that changing LDR resistance produces a measurable change in voltage.
A CdS cell is non-polarized. There is no anode or cathode and no correct orientation, so time spent identifying a positive lead is wasted. Either terminal can connect to supply or to the divider node.
Resistance follows a nonlinear log-log curve (gamma about 0.7) and varies significantly part to part and with temperature. Use it for relative light thresholds; absolute lux requires per-unit calibration and a known reference.
With a decay time near 30 ms and pronounced light-history behavior, the cell lags fast changes. It is unsuitable for high-speed optical signaling or precise timing; sample after it has settled.
Read the LDR divider and switch an LED or relay on when ambient light drops below a set threshold, turning it off again at dawn.
Use the resistance swing between daylight and darkness to control outdoor or garden lighting without a manual switch.
Compare two GL5528 dividers on left and right and steer a small robot toward the brighter side.
Sense room light and adjust an LED or screen backlight, dimming it in the dark and boosting it in bright conditions.
Point a light source at the cell and trigger an alert when the beam is interrupted and the resistance jumps.
Drop the GL5528 LDR into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.