A custom desk-mounted device with buttons that control the LIFX smart lights in my home office. Powered by an ESP32 development board.
I'm using mpremote to upload firmware to the ESP32 board. I created a helper script to make it super easy to upload all code changes to the device:
- Plug the ESP32 into my computer
- Execute the helper script to upload all code:
./upload.sh - After upload, the script connects to the board so I can see serial output in the console
The buttons are low-profile mechanical keyboard switches from Gateron.
- Button 1
- Press once to toggle all lights on or off.
- Button 2
- Press once to set the lighting scene to my usual default.
- Button 3
- Press a set number times quickly to set a particular scene.
- One press will activate Scene 1, two quick presses will activate Scene 2, etc.
When the board is powered on it will try to connect to my Wi-Fi network. While it's connecting it will blink slowly. Once connected it will flash quickly three times to indicate success.
When idle, the LED remains on at 5% brightness. This helps me navigate to the device in my office at night. It's the little things, y'know? That's the beauty of solving your own problems with custom-built solutions.
Whenever a button is pressed, the LED lights up to 100% brightness until a successful response is received. This gives you confidence that pressing the button did something and that it's working on the request.
The ESP32-powered device is mounted on the edge of my desk in a custom 3D-printed enclosure with an angled face for ergonomic button access.
If you want to create something like this, you can download the 3D-printable STL file for the enclosure here: device-enclosure.stl
The interior is a blank slate so you can fit any type of microcontroller you want in there. There are two slots in the bottom which allow you to secure a board using a zip tie.
The angled enclosure face has one circular hole for a standard 5mm LED and three square openings (14x14mm) for mechanical keyboard switches. Print it with the angled face on the build plate.

