Skip to content

Photocell

github-actions[bot] edited this page Dec 3, 2025 · 3 revisions

🔆 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).

📌 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.

Clone this wiki locally