ESPHome Rgb controller

This project is strictly related to the d-diot Mood Lamp and is based on the same PCB.

As in the d-diot Mood Lamp, the brain of the system is the popular NodeMCU Lolin V3 board which integrates an ESP8266 IC (in other words, WiFi connectivity); a capacitive touch button, a buzzer and a 3d printable case to host all the components complete the device.

The firmware for the NodeMCU board is generated with ESPHome and this results in a super easy integration in Home Assistant. A lot of RGB effects are supported, see here for more details.

The capacitive touch button in the front of the cose allows you to control your LEDs like a non smart device. With a short press the LED strip is turned on and off, while with a long press of the button the brightness can be increased or decreased.

Visit the topic forum if you need to know more about this device.

The d-diot mood lamp is built with the d-diot ESP8266-LolinV3-Lamp pcb. , read the dedicated wiki page to know more.

Pcb version 2.0

The schematic and the entire Kicad project are available for download in the dedicated d-diot github repository. In the repository you can find the gerber files of the PCB, so you can easily get 10 boards with about 5€ using an online PCB manufacturer like JLCPCB or PCB way. Click the button below to download the complete set (zip) of gerber files necessary for the manufacturing.

Download Gerber ESP8266-LolinV3-Lamp v.2.0

or order the PCB directly from PCBWay.

Order your board v.2.0 with PCBWay

The brain of Mood Lamp is the well known NodeMCU Lolin V3 board, which is based on the ESP8266 IC. The board is available in generic e-commerce platforms for 2 - 3 euros.

The controller is suitable to drive any WS2812B (Neopixel) led strip which requires a 5V DC; of course you can use a strip with the length an led density that you prefer, but remember to change the number of led in the firmware and make sure that your power supply can deliver enough current (60 mA / led).

With a long strip an injection of power in one ore more point could be necessary to keep the voltage constant: the additional power connector (J9) and the fan connector (J8) of the PCB are suitable for this purpose.

A WS2812B (Neopixel) led strip can be easily found in generic e-commerce platforms and the price depends on the length and led density (example here).

To power your LED strip and the controller you need an AC/DC 5V power adapter with a 5.5 mm power jack that can be found in generic e-commerce store (example here).

You can choose the size and the max current of the power supply on the basis of the number of LED in your setup.

This simple component is available on the market in generic e-commerce platforms.

It produces a very annoying sound, adjustable in frequency in the firmware, every time you turn the lamp on or off through the capacitive touch button.

This button is available on the market for few cents.

Respect to a mechanical button, it does not generate spurious open/close transitions when pressed and simplify the design of the external case.

This simple component (GL5537) is available on the market in generic e-commerce platforms or in electronics parts stores for few cents.

With the appropriate circuit, like the one present in the esp8266-lolinv3-lamp board, this component can provide the light level of the ambient.

See the wiki page of the ESP8266-LolinV3-Lamp board for more details.

Board v.2.0

The following components are required:

References Value Footprint Quantity
C1 1000uF Capacitor CP_Radial_D10.0mm_P5.00mm 1
C2 0.1uF Capacitor C_Disc_D6.0mm_W4.4mm_P5.00mm 1
R3 10K Resistor R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal 1
R4 100K Resistor R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal 1
R5 470R Resistor R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal 1
R6 200R Resistor R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal 1
R7 56K Resistor R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal 1
D1 1N4007 Diode (optional) D_DO-41_SOD81_P10.16mm_Horizontal 1
U2 SN74AHCT125DR IC SOIC127P600X175-14N 1
JP1 Jumper_3_Open Connector PinHeader_1x03_P2.54mm_Vertical 1
Q4 FDN338P Mosfet SSOT-3 1
Q6 FDN337N Mosfet SSOT-3 1
Q5 FQP27P06 Mosfet TO-220-3_Vertical 1
J8 FAN Connector (optional) PinHeader_1x02_P2.54mm_Vertical 1
J9 PWR-2 Connector (optional) PinHeader_1x02_P2.54mm_Vertical 1
J4 LED Connector PinHeader_1x03_P2.54mm_Vertical 1
J5 BUTTON Connector PinHeader_1x03_P2.54mm_Vertical 1
J2 PWR Connector PinHeader_1x04_P2.54mm_Vertical 1
J6 MIC Connector (optional) PinHeader_1x04_P2.54mm_Vertical 1
J7 Barrel_Jack BarrelJack_Wuerth_6941xx301002 1

The 3d model files and the print instructions of the case are available in thingiverse.

If you don't have access to a 3d printer, you can consider an online 3d printing service.

To complete the build you need the following parts:

  • M2.5 self tapping screw
M2.5 self tapping screw

A cost estimation of the entire is around 5€, RGB led strip and power supply excluded.

Well, this is the most time consuming part of the building, but once you have started the print job, you don't have too much to do except watching your 3d printer at work, so you can proceed with the other steps.

The model files are here.

Some components are THT, while some other are SMD, but generally with a package that is not so difficult to handle. The tools required for soldering the components of this board are the same of the d-diot board. See this to know what tools you need.

Use the interactive BOM tool to see where to place each component for the board v.1.0 and for the board v.2.0

This is how the board v.2.0 should looks with all the component soldered

See this.

  • Insert the capacitive touch switch in the J5 conector connector
  • Fix the board to the lamp base with the M2.5 screw
  • Connect the LED strip to the J4 connector
  • Close the case with the top part

The configuration file in yaml format, necessary to generate the firmware with ESPHome, are in the dedicated d-diot github repository.

ESPHome has a user-friendly web interface (dashboard) to manage all your firmwares and devices and it is integrated in the d-diot image.

The first time that you have to upload of the generated firmware to the board, connect the NodeMCU to a free USB port in you Raspberry Pi and in the dashboard (top right corner) select the appropriate USB port. For the next uploads you can use the over the air method without any connection.

In the provided configuration file in yaml format, make sure to set the right numbers of LED in the ligh section (num_leds: XX parameter) and in the fire effect function (static byte heat[XX]).

Change the SSID and password of the wifi network according to your needs.

  • Single button press: turn lamp on and off
  • Long button press: increase the brightness. To decrease the brightness release the button, press it again and hold within 2 seconds

If your plan is to control the LED strip through vocal commands with an assistant like Amazon Alexa, read this guide!

  • sensors_and_actuators/esphome/rgb_controller.txt
  • Last modified: 2020/05/01 10:04
  • by franzunix