Skip to content

LukePeters/esp32-smart-lights-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Smart Lights Controller (MicroPython)

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:

  1. Plug the ESP32 into my computer
  2. Execute the helper script to upload all code: ./upload.sh
  3. After upload, the script connects to the board so I can see serial output in the console

Button Functionality

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.

LED Functionality

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 Completed Device

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.

ESP32-powered buttons device

The 3D-Printed Enclosure

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.

3D-printed device enclosure

About

A custom ESP32 smart lights controller with mechanical keyboard switches and a 3D-printed enclosure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published