Skip to the content
4 layers38 × 59 mmLedcontroller, the printed circuit board in 3D

Homeassistant compatible MQTT Light implementation for RGB+CCT LEDs

Size
38 × 59 mm
Copper layers
4
Thickness
1.69 mm
Parts
90
Nets
83
Pads
229
Tracks, vias
579, 98
Pours
4
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
12 Mar 2023
Updated
21 Jun 2026

Overview

Ledcontroller is an open-source printed circuit board by markusbart82, from the markusbart82/Homeassistant_MQTT_Light repository on GitHub, published under the LGPL-2.1 licence. It is a 4-layer board of 38 × 59 mm with 90 parts on 83 nets, routed with 579 tracks and 98 vias.

It is built around the ESP-12E, PCA9685PW and BLM3400, with the MMS9013-H-TP among its other parts. Its parts include 30 connectors, 25 resistors, 17 transistors, 7 capacitors and 2 ICs. It belongs with the home automation and IoT and lEDs and displays boards and the ESP8266 boards of this library.

Main components

4

README

README.md

Homeassistant MQTT Light

Homeassistant compatible MQTT Light implementation for RGB+CCT LEDs. Uses ESP8266 and PCA9685.

The idea started because I wanted "white with a color tint" smart lights. But apparently, this is not supported by smart home tech yet. It's either RGB, or white, never a mix of these. So this lamp here identifies as RGB, but mixes white with it.

How Color Mixing Works

This lamp can display both colored light and tunable white (from warm 2300K to cool 7000K), and uniquely, it can mix white with color — producing effects like "pink-tinted white" or "blue-tinted daylight" that most smart lights can't do.

The Color Pipeline

Here's what happens internally when you send a color command:

  1. Input from Home Assistant: You send RGB values (0-255) and a color temperature in mireds (142–435 mireds = 7000K–2300K)
  2. White extraction: The algorithm finds the achromatic (gray/white) component by taking min(R, G, B) — this is the amount of white already present in the color
  3. Color separation: The white component is subtracted from R, G, B, leaving only the pure chromatic (saturated) colors
  4. White distribution: The extracted white is split between warm white (WW) and cold white (CW) LEDs based on the requested color temperature
  5. PWM output: All 5 channels (R, G, B, WW, CW) are scaled to 12-bit resolution (0-4095) and sent to the PCA9685 PWM driver

Examples

Pure white with temperature

InputOutput (R,G,B,WW,CW)
Warm white (2300K)(0, 0, 0, 4095, 0)
Neutral white(0, 0, 0, 2048, 2048)
Cool white (7000K)(0, 0, 0, 0, 4095)

White with a color tint

InputWhat you see
RGB(255,200,200) + 4000KA soft pink-tinted white
RGB(200,220,255) + 5000KA cool blue-tinted white
RGB(255,255,255) + 3500KPure warm white (no color tint)

Full color

InputWhat you see
RGB(255,0,0) + any tempPure red (white channels off, min(255,0,0)=0)
RGB(128,64,32) + 3000KOrange with warm white boost (min(128,64,32)=32 → WW adds white)

Why This Matters

Traditional smart lights force you to choose: RGB or white. With this lamp, you get both simultaneously — perfect for ambient lighting where you want a colored accent light that still feels natural and bright.

Invisible color temperature updates

Most smart lamps only let you update the color temperature while they are on. So they turn on with the previous color temperature and then dim to the right one. To combat this behavior, send a message with brightness=1 and the desired color temperature to do an invisible update. The lamp will remain in its previous state (OFF, that is). Such low brightness values usually are not shown in most lamps, either.

Homeassistant integration

The lamp supports autodiscovery and identifies as "ESP-dimmer-NUMBER", where the number is derived from the MAC address. Supported features:

  • JSON schema
  • ON/OFF
  • Brightness
  • Color temperature
  • RGB
  • Transitions
  • Flashing

Effects

The lamp supports the following effects:

  • Colorwheel — slowly changes through the RGB spectrum
  • Undulation — slowly undulates randomly near the previously selected color

Stand-alone mode

As a fallback when Home Assistant is unavailable:

  • On powerup, the lamp turns on with neutral white
  • WiFi/MQTT reconnection is handled automatically in the main loop

Hardware

The lamp uses the PCA9685 PWM driver IC (16 channels, 12 bits, up to 1.5kHz PWM, I2C at 400kHz) to interface with the LEDs. Currently, channels 0–4 are assigned R, G, B, WW, CW.

Ledcontroller_3x

This PCB includes the ESP8266, PCA9685 and BLM3400 MOSFETs, for controlling 24V LED strips with a common +24V.

Parts

90
QtyValueFootprintReferences
171kResistor_SMD:R_0805_2012MetricR1, R2, R8, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22 +1
15BLM3400Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15
810kResistor_SMD:R_0805_2012MetricR3, R4, R5, R6, R7, R23, R24, R25
510uF 35VCapacitor_SMD:CP_Elec_5x5.4C3, C4, C5, C6, C7
324VTestPoint:TestPoint_Pad_3.0x3.0mmJ22, J28, J34
3BLUETestPoint:TestPoint_Pad_3.0x3.0mmJ25, J31, J37
3C_WHITETestPoint:TestPoint_Pad_3.0x3.0mmJ27, J33, J39
3GREENTestPoint:TestPoint_Pad_3.0x3.0mmJ24, J30, J36
3OEJumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mmJP6, JP8, JP9
3REDTestPoint:TestPoint_Pad_3.0x3.0mmJ23, J29, J35
3W_WHITETestPoint:TestPoint_Pad_3.0x3.0mmJ26, J32, J38
2100nFCapacitor_SMD:C_0805_2012MetricC1, C2
2MMS9013-H-TPPackage_TO_SOT_SMD:SOT-23Q16, Q17
1A0Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP1
1A1Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP2
1A2Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP3
1A3Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP4
1A4Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP5
1A5Jumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP7
1ESP-12EESP8266:ESP-12E_SMDU1
1FLASHTestPoint:TestPoint_Pad_2.0x2.0mmJ15
1Flash AdapterConnector_Card_Edge:WingTAT_ED08BGFBKJ41
1GNDTestPoint:TestPoint_Pad_4.0x4.0mmJ21
1GPIO16TestPoint:TestPoint_Pad_2.0x2.0mmJ2
1OETestPoint:TestPoint_Pad_2.0x2.0mmJ18
1PCA9685PWPackage_SO:TSSOP-28_4.4x9.7mm_P0.65mmU2
1Pololu D24V5F3Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ19
1RESETTestPoint:TestPoint_Pad_2.0x2.0mmJ6
1RXTestPoint:TestPoint_Pad_2.0x2.0mmJ14
1SCLTestPoint:TestPoint_Pad_2.0x2.0mmJ16
1SDATestPoint:TestPoint_Pad_2.0x2.0mmJ17
1TXTestPoint:TestPoint_Pad_2.0x2.0mmJ13
1VINTestPoint:TestPoint_Pad_4.0x4.0mmJ20

Similar boards

  • 4 layers45 × 25 mmAidonToRS485, the printed circuit board in 3D

    AidonToRS485

    yyberi/han-to-RS485

    KiCAD project of PCB that reads data from the Aidon electricity meter's HAN port and converts it to an RS485 bus, enabling integration with home automation systems, data loggers, and industrial equipment.

    20 partsCERN-OHL-P-2.0
  • 2 layers29 × 0.4 mmIlumi, the printed circuit board in 3D

    Ilumi

    crespum/ilumi

    Ring of LEDs for Home Assistant

    45 parts2GPL-3.0
  • 2 layers102.9 × 105.4 mmLeder, the printed circuit board in 3D

    Leder

    Enweave/remolight

    136 parts1
  • 2 layers220 × 329.2 mmControl Boards, the printed circuit board in 3D

    Control Boards

    nasa-jpl/open-source-rover

    A build-it-yourself, 6-wheel rover based on the rovers on Mars!

    148 parts9.8kApache-2.0
  • 4 layers100.1 × 60.2 mmHades, the printed circuit board in 3D

    Hades

    pms67/HadesFCS

    Complete flight control system designed from scratch. Hardware designed with KiCad.

    215 parts1kBSD-3-Clause
  • 2 layers94 × 79 mm5 - Lizard Car, the printed circuit board in 3D

    5 - Lizard Car

    TRD-B/Lizard

    3D printed RC race car with custom electronics

    54 parts129CC-BY-4.0
  • 2 layers54.2 × 75.2 mmKiCAD Design, the printed circuit board in 3D

    KiCAD Design

    Brobiwann/ESP-spider

    The ESP-Spider is a quadruped robot inspired by the miniKame (https://github.com/JavierIH/miniKame) . Like the miniKame, it uses sinusoidal functions to control servo positions, but the design and code were developed…

    70 parts44

Questions

How big is the Ledcontroller PCB?

It measures 38 × 59 mm and has 4 copper layers, 1.69 mm thick.

What parts does the Ledcontroller use?

90 parts, built around the ESP-12E, PCA9685PW, BLM3400 and MMS9013-H-TP. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Ledcontroller KiCad files?

From the markusbart82/Homeassistant_MQTT_Light repository on GitHub, at the commit this page was made from: the board is hardware/ledcontroller_3x/ledcontroller.kicad_pcb and its schematic hardware/ledcontroller_3x/ledcontroller.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Ledcontroller design in my own project?

Its repository publishes it under the LGPL-2.1 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).