A Photoresistor, or Light Dependent Resistor (LDR), is a passive analog sensor whose electrical resistance decreases as the intensity of ambient light incident on its surface increases (photoconductivity). In Open Maker Studio, it's used for automatic night lights, solar tracking, and general light-level measurements.
1. Schematic Symbol
Standard photoresistor symbol — a resistor with two inward-pointing arrows representing incoming light:
2. What OMS Actually Simulates
OMS's Photoresistor component is a bare 2-pin LDR only (pins simply named 1/2) — there's no
simulated 3-pin LDR module (VCC/GND/AO/DO with an onboard comparator) as a separate part in the
Circuit Canvas. Its resistance model is calibrated against a real part, the GL5528 CdS
photoresistor (Handson Technology GL55 series datasheet):
- Dark resistance: 1MΩ (the datasheet's own minimum spec).
- Bright resistance: 8kΩ (the low end of the datasheet's 8–20kΩ @10lux range).
- The resistance curve between those two points is a real power-law ("gamma") interpolation,
not a straight linear ramp — matching the real datasheet's documented log-log relationship
between illuminance and resistance. A linear model would have compressed the "interesting"
1kΩ–100kΩ range most
analogRead()-based light-sensing code actually lives in into the last ~20% of the control's travel; the real power-law curve spreads it out realistically instead.
[!NOTE] The digital-output Blockly blocks target real hardware, not the simulator.
sensor_ldr_ read_digital/sensor_ldr_on_digitalgenerate code for a real 3-pin LDR module's comparator output pin — that code is genuine and will run correctly on real hardware, but there's no component in OMS's Circuit Canvas with a DO pin to wire up and test it against in simulation. Only the analog voltage-divider behavior (Section 3) is actually simulated.
3. How it Works & Wiring
A bare photoresistor requires a series resistor (typically ) to form a voltage divider circuit so that the change in resistance can be measured as a change in voltage by the microcontroller's ADC:
- VCC-Side Wiring (Active Bright):
- Connect one pin of the LDR to VCC.
- Connect the other pin of the LDR to the ADC pin (e.g., A0) and to GND through a resistor.
- Result: Voltage increases as light level increases.
- GND-Side Wiring (Active Dark):
- Connect one pin of the LDR to GND.
- Connect the other pin of the LDR to the ADC pin and to VCC through a resistor.
- Result: Voltage decreases as light level increases (useful for night-activation triggers).
4. Component Properties (Property Inspector)
When you select the Photoresistor on the canvas, you can modify the following parameter in the Property Inspector panel:
- Light Level (
lightLevel): Sets the raw simulated light level driving the real power-law resistance curve from Section 2.- Default:
512(mid-scale) - Range:
0(darkness, 1MΩ) to1023(bright, 8kΩ)
- Default:
There's no separate dark/bright resistance override — those two endpoints (1MΩ/8kΩ) are fixed constants matching the real GL5528 datasheet, not user-adjustable props.


