We asked Soldr for firmware to wire an LDR sensor module to an ESP32. Soldr drafted an ESP32 sketch on GPIO34 (analog) and GPIO35 (digital), 12-bit ADC (0–4095), 115200 baud, 500 ms samples. At the time Soldr warned the parts weren't carded in the build yet, so the draft hadn't been pin-checked against a parts list inside Soldr. We ran it on a real ESP32 + LDR module on the bench anyway. In the session clip the live plot is moving while the powered module is held next to the laptop; Serial streams [DATA] ldr_raw=… digital=….
This is a learning meter, not a calibrated lux meter. The raw number depends on the module's divider, the pot on the digital output, and how you aim the LDR. Use it to see relative light, not to quote lux.
Compoden and Soldr are one company: Compoden is the India parts store, Soldr is the agent that drafts the firmware and wiring. Disclosure: Compoden is our store. We ship inside India.
Things you'll need:
- ESP32 30-pin Dev Board (CP2102): https://compoden.com/products/esp32-30-pin-development-board-cp2102-wifi-bluetooth
- LDR Light Sensor Module: https://compoden.com/products/ldr-light-sensor-module-for-arduino-microcontroller-projects
- Jumper wires: https://compoden.com/products/jumper-wire-combo-male-to-male-male-to-female-and-female-to-female
- USB cable for the ESP32 (Micro-USB on this board)
Wiring:
LDR VCC → ESP32 3V3
LDR GND → ESP32 GND
LDR AO → ESP32 GPIO34
LDR DO → ESP32 GPIO35
GPIO34/35 are input-only. Turn the module pot until DO flips cleanly when you shade the LDR.
Firmware:






Comments