A photoresistor (LDR, light-dependent resistor) changes its resistance with the light that falls on it. The simulated part follows a real GL5528 cell: about 1 MΩ in the dark and about 8 kΩ in bright light, on the power-law curve real cells have (it is a straight line on a log-log graph, not a straight line in brightness).
Wiring: a voltage divider
A board reads voltages, not resistances, so the photoresistor is used with a fixed resistor (around 10 kΩ):
- One leg of the photoresistor to 3V3 (or 5 V).
- The other leg to an analog input pin and, from the same point, a fixed resistor to GND.
With this arrangement the voltage on the pin rises with brightness, and the blocks treat a higher reading as brighter. Swapping the two parts reverses the direction.
Light level in the simulator
Drag the Light Level property (0 to 1023) to change the light on the part while the simulation runs.

