LDR (GL5528)
A resistor that changes with light: in the light its resistance drops, in the dark it rises a lot. Use it with a fixed resistor to make a voltage divider and read it with the ADC.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| 1 | 3V3 | no polarity |
| 2 | GPIO with ADC + 10 kΩ resistor to GND | voltage divider |
FastTeacherFor teachers
From the syllabus to a planned semester
- Teaching plan and calendar built automatically
- Class diary ready to paste into SIGA
- Slides and exercise lists with answer keys
Free Community edition · Windows
MicroPython example
from machine import ADC, Pin
import time
luz = ADC(Pin(35)) # 3V3 → LDR → GPIO35 → 10 kΩ → GND
luz.atten(ADC.ATTN_11DB)
while True:
print(luz.read_u16())
time.sleep(0.5)
Specifications
| Item | Value | Source |
|---|---|---|
| Resistance at 10 lux | 10–20 kΩ | Datasheet GL55xx (GL5528 series), Seeed / Senba — Under review: confirm the range in the original PDF |
| Resistance in the dark | ≥ 1 MΩ | Datasheet GL55xx (GL5528 series), Seeed / Senba |
| Gamma (10–100 lux) | 0.7: R ≈ R10 × (lux/10)^(−0.7) | Datasheet GL55xx (GL5528 series), Seeed / Senba |
| Max. voltage / power | 150 V / 100 mW | Datasheet GL55xx (GL5528 series), Seeed / Senba |
Values marked "Under review" will still be checked against the parts in the lab.