Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver

ESP32 RGB LED Controller MK2

A small but significant update. I ordered a few photo resitors, aka LDR (Light Dependant Resistor) right after I finished writing MK1. It’s quite common for me to get ideas pop into my head as soon as I write things down.

Adding the LDR to the controller is a super easy task. I just modified the enclosure lid to have 2 tiny holes towards the edge, so it’ll pick up on the room light. The energy saving with this tiny sensor is significant. MK1 will automatically turn itself from 5pm to 11am, this will cut that on time by at least 50%.

Wire it to the ESP32 is also simple, just remember that we can’t use ADC1 when we need the WiFi. Any pins on ADC2 will work. On the code I also added more colours, so it’ll also lit up if I darken the room for nap time.

Sidebar: if you notice in the sketch, I also tried to use the mounting screw as capacitor button to turn all the LEDs into bright white (all 255s) to quickly brighten the room for a bit. But I'm having issues that it won't turn off consistently. I left the code in, I just don't wire the pins to the mounting screws.

Updated code and enclosure are at the same links: GitHub & Thingiverse.