Photocell - VIPnytt/Frekvens GitHub Wiki
π 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 a CdS photoresistor (e.g. this) paired with a 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).
π Schematics
LDR schema
βββ
β ββ +3.3 V DC
β ββ Bridge
βββ
Resistor schema
βββ Bridge
ββ΄β
β β
ββ¬β
βββ 0 V DC
ESP32 schema
ββββββββββββββββ
β 3V3 ββ +3.3 V DC
β GND ββ 0 V DC
β β
β Analog input ββ Bridge
ββββββββββββββββ
π§ Configuration
Sensor reading
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 // Bridge
[!WARNING] Avoid strapping pins as this pin is biased.
π§© Extension
With the Photocell extension enabled, the device automatically adjusts display brightness to match ambient light throughout the day.
π Resources
External links for deeper exploration β provided for reference only and with no formal connection to this project.