-
Notifications
You must be signed in to change notification settings - Fork 5
Photocell
Automatic ambient brightness adjustment can be achieved by installing a Light Dependent Resistor (LDR). This simple sensor changes resistance with light levels, allowing the ESP32 to measure surrounding brightness and adapt the display accordingly.
Most common LDRs work well when paired with a reasonably sized resistor. A good starting point is an CdS photoresistor (e.g. this) paired with an 10 kΩ through-hole resistor (e.g. this). For a clean installation, the LDR can be placed inside a standard LED cap (e.g. this).
┌─┐
│ ├─ +3.3 V DC
│ ├─ Bridge
└─┘
┌── Bridge
┌┴┐
│ │
└┬┘
└── 0 V DC
┌──────────────┐
│ 3V3 ├─ +3.3 V DC
│ GND ├─ 0 V DC
│ │
│ Analog input ├─ Bridge
└──────────────┘
Analog input from the resistor bridge.
Any analog input pin can be used, but those on the ADC1 channel are preferred.
Configure in secrets.h:
#define PIN_LDR 1 // BridgeWarning
Avoid strapping pins as this pin is biased.
With the Photocell extension enabled, the device automatically adjusts display brightness to match ambient light throughout the day.
External links for deeper exploration — provided for reference only and with no formal connection to this project.