
Open media
This article describes how to create a DIY smart light with HomeGenie Mini color-light firmware using ESP32-C3/S3 Mini/Zero development board and addressable RGB LED pixels.
The DIY smart light consist of three parts:
Beyond the Mood lamp add-on demonstrated here, feel free to select any enclosure that fits your specific needs and works with this LED controller kit and this color-light firmware in general. RGB LEDs are incredibly versatile for various lighting applications. Whether you envision a personalized sign, a simple bedside lamp, a dynamic mood light, or a subtle backlight, the 3D printing community offers an abundance of design options.
To spark your creativity, explore Maker World, Printables, Thingiverse, or search other 3D printing platforms.
The video below showcases the assembled mood lamp and its controller, providing a clear visual representation of the final product. It also highlights the integrated buttons' functionality and offers a concise overview of key features within the color-light firmware.
Product features:
Example schedules include Dusk and Dawn scenes, that trigger in proximity of sunrise or sunset, and Auto off timeout that turns the light off after a certain period of inactivity.
Using an external motion and light sensor is possible to implement further automated scenarios since the device can "talk" directly to other devices using HomeGenie API or generic HTTP calls.
The LED controller kit consists of a PCB shield for ESP32-C3/S3 Zero development board, and a 3D printed enclosure. This device can control WS2812x and compatible RGB LED types for a maximum power of 10-15W.
The 3D printed translucent enclosure let the onboard RGB LED be visible and create a nice color/status feedback even if no LED strip is connected yet.
On the upper side of the PCB there are two buttons, while on the lower side there are the two 9-pin header connectors on which the ESP32 board is connected, and the JST connector cable to which the LED strip is connected.
Depending on the number of pixels of the LED strip, the "Max power" setting must be configured correctly so as not to exceed the capacity of the power supply used..
This setting can be tweaked using the HomeGenie Panel app or using the API. By default, the maximum power limit is set to 25%, capable of driving up to 200 LED pixels considering a maximum requirement of 40mA for each pixel.
Max LED power % formula:
<power_supply_ampere> / (<number_of_pixels> * <ampere_per_pixel>) * 100 = <max_ampere_perc>
So, with a 2A power supply and a LED strip of 144 pixels with a consumptions of 40mA (0.04A) each pixel, the max power is 35% :
2 / (144 * 0.04) * 100 = 34.72222
Consult the specifications of the connected LED strip to determine the actual maximum mA consumption of each pixel.
The LED controller has been successfully tested with LED strips up to 3 meters long and up to 488 pixels.
Printed using translucent PETG material, the enclosure takes about 45 minutes to print with a 0.4mm nozzle and 0.16mm layer height on an A1-mini 3D printer.
Once assembled, to become a fully functional LED controller, HomeGenie Mini color-light firmware must be uploaded to the device.
The firmware can be uploaded directly from this page using the firmware upload form at the end of this article: select the target SoC model (ESP32-C3 or ESP32-S3 in this case) and click the "Create device" button.
Now, the LED controller is ready to be configured and connected to Wi-Fi following the instructions in the Device Setup page.
NOTE: color-light firmware also works on any other LED controller embedding an ESP32 or ESP8266 SoC, this might just require to set different GPIO parameters in the firmware upload form.
The options selected by default in the upload form are meant to be used with this LED Controller Kit.
Archie is a 3D printed 1m LED strip casing in the shape of an Archimedean spiral. The spiral has always been an important symbol in ancient cultures, it is believed to represent cycles, growth and transformation. Also present in nature in various forms, it is a sort of magical symbol.
For this reason and for the mesmerizing colors and animations implemented with color-light firmware, Archie is perfect as a mood lamp for meditation and as a portal to explore inner worlds. Some studies and initiatives already suggest that there might be some kind of healing properties in light and colors especially when combined with sounds as a method to reduce stress and anxiety.
So, despite the name, it might be worth trying the Panel app's "Party Mode" in combination with listening to some good relaxing music.
Archie Mood Lamp is an original concept and design by G-Labs licensed under CC BY-NC 4.0
Every HomeGenie Mini device can implement on its own even complex automated tasks thanks to the integrated Scheduler, that beside preset actions, can run JavaScript code to implement user-definable actions.
In the video below you can see how to link multiple devices so that they can be controlled all together by simply acting on one of them. This is achieved by adding two schedules that are triggered when the device is turned on or off and which consequently turn on or off all the devices associated to the schedule itself, which in the example below are the other two lights.
For simplicity, the solution in this video is a "zero-code" solution and is implemented by creating two different schedules with preset actions. One for the "turn on" action, and the other for the "turn off" action.
An optimized solution can be implemented using a single schedule with custom action script instead of preset actions. The script code is the following:
$$.boundModules.level = event.value
The script is executed every time the "Status.Level" event occurs, therefore, every time the light level ("event.value") changes, the levels of the modules associated to the schedule ("boundModules") are also set to the same value.
The following image shows an example "Linked.Lights" schedule configuration.
In this example, the "Linked.Lights" schedule is implemented by the "Main Light" device. So, every time the level of the "Main Light" changes, the "Floor Lamp" and the "Ceiling Light" levels are also automatically set to the same value.
Smart Light project files by G-Labs licensed under CC BY-NC 4.0
Connect your ESP32/ESP8266 microcontroller to your computer via USB, select your firmware version, and click "Create device" to upload the HomeGenie Mini firmware.
Installing firmware directly from this page works only in browsers with Web Serial API enabled.
See the Device setup page for further information about configuring a HomeGenie Mini device.
This firmware pre-compiled binaries and source code are available on GitHub:
In addition to the common Device API, the following modules and API are implemented by this device.
C1
moduleThis is the master module that controls all LEDs simultaneously.
HomeAutomation.HomeGenie/C1
Status.Level
Status.ColorHsb
Control.On
Control.Off
Control.Toggle
Control.Level/<level>/<tansition_ms>
Control.ColorHsb/<h>,<s>,<b>,<tansition_ms>
L1
... L<num>
modulesThese modules control the LED corresponding to the number <num>
.
HomeAutomation.HomeGenie/L<num>
Status.Level
Status.ColorHsb
Control.On
Control.Off
Control.Toggle
Control.Level/<level>/<tansition_ms>
Control.ColorHsb/<h>,<s>,<b>,<tansition_ms>