Skip to the content
4 layers90 × 60 mmBoard a, the printed circuit board in 3D

A HDR LED driver with ESPHome integration focused on driving a 36V 1.4A LED

Size
90 × 60 mm
Copper layers
4
Thickness
1.6 mm
Parts
206
Nets
96
Pads
553
Tracks, vias
1,518, 545
Pours
19
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
30 Sep 2026
Updated
8 Oct 2026

Overview

Board a is an open-source printed circuit board by ruckusmattster, from the ruckusmattster/xtm-led-driver repository on GitHub, published under the MIT licence. It is a 4-layer board of 90 × 60 mm with 206 parts on 96 nets, routed with 1,518 tracks and 545 vias.

It is built around the STM32G431CBU6, OPA4388IPWR(UMW) and LDL1117S33R, with the TPS7A2050PDBVR, 2N7002BK and BAV199 among its other parts. Its parts include 79 resistors, 63 capacitors, 8 transistors, 7 ICs and 4 diodes. It belongs with the STM32 boards of this library.

Main components

9

README

README.md

XTM LED Driver

A flicker-free, four-decade DC LED driver for theatrical fixtures.
1.4 A down to 5 µA as pure DC: no PWM anywhere, nothing for a camera to catch.

3D renders of Board A, the driver, and Board B, the controller

Status: designed, not yet built KiCad 9 STM32G431 ESPHome Home Assistant

Build guide · Design process · Hardware · Firmware · Design record


I'm building four stage fixtures around the Xicato XTM19803050CCA (19 mm LES, 3000 K, about 5000 lm at 1.4 A). Off-the-shelf drivers either dim with PWM, which rolling-shutter cameras turn into bands, or bottom out around 1%, which makes the end of every fade snap to black. This project is a two-board driver that does neither: the LED current is DC at every level from full output down to 5 µA (0.0004%), fades are smooth enough to film in 240 fps slow motion, and each fixture is a normal dimmable light in Home Assistant with a knob on the back and a sync button that makes the others follow it.

Everything is here: the schematics (as code), the design calculations and simulations, scripted KiCad 9 layouts that come out DRC-clean, Gerbers and placement files, BOMs with verified part numbers, firmware for both boards with its tests, and the procedures to bring it up, calibrate it and prove it doesn't flicker.

Highlights

  • Four DC ranges, not PWM. Four linear current sinks with 0.1 Ω, 1 Ω, 10 Ω and 100 Ω shunts sit in parallel under the LED. Each covers a decade at the same 14–140 mV sense voltage, so every range is equally precise, and a calibrated tail carries the last decade and a half to 5 µA.
  • Crossovers you can't see. Where two ranges meet, both channels share the current on a log-domain blend, and the incoming channel idles at a small keep-alive current so it's already regulating when it's needed. Simulated deviation at a crossover: 0.14% on a 10 s fade.
  • A tracking buck that stays out of the picture. A forced-PWM buck at 400 kHz holds the LED anode about 1 V above what the sinks need, set ahead of every current change by the MCU. Its ripple sits far above anything a camera or eye integrates.
  • Precision where it counts. 16-bit DAC, zero-drift op-amps, Kelvin-sensed shunts (a four-terminal 0.1 Ω and 0.1% thin film for the rest), a guarded "precision island" on a 4-layer board. After calibration each range holds about ±0.1% of reading.
  • Real-time control on the driver. An STM32G431 runs fades at 4 kHz, the crossovers, the headroom loop and the protection (a shorted LED clamps every sink within 100 µs). Wi-Fi never touches the light.
  • A friendly controller. Board B is a socketed Waveshare ESP32-S3-Zero running ESPHome: Home Assistant light, rotary encoder with push, status LED, and fixture-to-fixture sync over ESP-NOW with authenticated packets. Every fixture also works completely on its own.
  • Layout by script. Python scripts place every part, draw the critical copper by hand-coded rules, route the rest with Freerouting, pour and stitch ground, run DRC and export JLCPCB files. Both boards come out with 0 errors and 0 unconnected items.

How it works

mermaid
flowchart TB
  mains(["Mains"]) --> psu["Mean Well LRS-100-48<br/>isolated 48 V, off-board"]
  subgraph A["Board A · driver · 90 × 60 mm, 4 layers"]
    fuse["Fuse + TVS"] --> buck["Tracking buck<br/>LMR38020, forced PWM"]
    fuse --> aux["Aux buck + LDOs<br/>5.5 V · 5 V · 3.3 V"]
    mcu["STM32G431<br/>4 kHz control loop"] -->|SPI| dac["DAC80504<br/>4 × 16-bit"]
    dac --> sinks["OPA4388 + 4 linear sinks<br/>0.1 Ω · 1 Ω · 10 Ω · 100 Ω"]
    mcu -->|"DAC → feedback"| buck
    sinks -.->|"cathode tap<br/>fast trip"| mcu
  end
  subgraph L["LED"]
    led(["Xicato XTM<br/>up to 1.4 A"])
  end
  subgraph B["Board B · controller · 60 × 45 mm"]
    knob["Encoder · push · sync"] --> esp["ESP32-S3-Zero<br/>ESPHome"]
  end
  ha(["Home Assistant"])
  other(["Other fixtures"])
  psu -->|"48 V DC"| fuse
  buck -->|"LED+"| led
  led -->|"LED−"| sinks
  mcu ---|"10-way ribbon<br/>UART · 5.5 V · reset"| esp
  esp -.-|"Wi-Fi"| ha
  esp -.-|"ESP-NOW"| other

The sinks set the LED current; the buck only supplies the voltage they need. Board A's MCU knows the LED's forward voltage at every current (it learns it as it runs), so on a rising cue it raises the buck first and then the current, and on a falling cue the reverse. Only a level, a fade time and status cross the ribbon to Board B.

Bar chart of the four current ranges on a log scale: ch4 140 µA to 1.6 mA with a tail to 5 µA, ch3 1.4 to 16 mA, ch2 14 to 160 mA, ch1 140 mA to 1.5 A

Brightness is exponential in the setting, so every step looks the same size: 1% of the scale is about 13% more light, from 5 µA at the bottom to 1.4 A at the top.

Line chart of LED current against brightness setting on a log axis: a straight line from 5 µA at 0% to 1.4 A at 100%, coloured by the channel carrying the current

The boards

Board A: driverBoard B: controller
TopBoard A topBoard B top
BottomBoard A bottomBoard B bottom with the ESP32-S3-Zero sockets
Size90 × 60 mm, 4 layers, ENIG60 × 45 mm, 2 layers, ENIG
Parts206 on 96 nets42 on 32 nets
Does48 V in, tracking buck, four sinks, protection, fades, calibrationWi-Fi and Home Assistant, knob, sync, status LED
Key partsSTM32G431CBU6, DAC80504, OPA4388, 2 × LMR38020, NDT3055L, WSK2512Waveshare ESP32-S3-Zero-M on sockets, Bourns PEC11R encoder
Layout result0 DRC errors, 0 unconnected0 DRC errors, 0 unconnected

Renders are bare boards from KiCad (no 3D models for the parts). The ESP32-S3-Zero plugs into two sockets on Board B's back, so it can be pulled out and flashed over its own USB-C.

Specifications

Design values from the calculations and simulations in design/. None of this has been measured on hardware yet.

ParameterDesign value
Output5 µA to 1.4 A DC (1.5 A with tolerance), four ranges plus a calibrated tail
Brightness curveExponential: 0–100% → 5 µA–1.4 A, about 13% more light per 1% step
Flicker targetUnder 1% at any frequency from 100 Hz to 20 kHz, at every level and during fades
Accuracy after calibration±0.09–0.11% RSS in each range; ±0.6% at 14 µA and ±1.6% at 5 µA
Crossover smoothness0.11–0.14% on a 10 s full-range fade, 0.9–1.5% on a 1 s fade (simulated)
ResponseSnaps within 5 ms; fades updated at 4 kHz, from instant to 10 minutes
Input48 V DC (43.2–52.8 V) from a Mean Well LRS-100-48; about 45 W at full output
LED voltage3.5 V floor to 38 V usable, 40.4 V hard ceiling
ProtectionShorted LED (every sink clamped within 50–100 µs), open LED, undervoltage, four temperature sensors with derating, DAC read-back, watchdog, 3 A fuse, TVS on input and output
Link lossBoard A blinks twice and settles at 20% if Board B goes quiet; planned restarts hold the level
ControlHome Assistant (ESPHome native API), encoder with push, sync button and a header for a panel-mount button
Group syncESP-NOW broadcast, fixture to fixture, HMAC-SHA256 authenticated; no router or HA in the path

Status

StageState
✅ Circuit design, calculations, crossover simulationDone; design/calc.py asserts the limits that matter
✅ Schematics (as code) with connectivity checkDone; 0 ERC errors on both boards
✅ Part numbersEvery numbered part checked against a distributor or manufacturer page (29 Sep 2026)
✅ PCB layoutDone by script; both boards 0 DRC errors, 0 unconnected
✅ Board A firmwareBuilds (50–58 KB of 126 KB, depending on the toolchain); 97,146 host-test checks pass
✅ Board B firmwareESPHome config validates; 89 unit checks and a 43-check end-to-end test on ESPHome's Linux build pass
⏳ ESP32-S3 buildNot yet run; the CI workflow in .github/workflows/ runs it on every push
⏳ Fabrication, assembly, bring-up, flicker measurementsNot started
⚠️ Known firmware issueBoard A detects an open LED only near full output, and learns a bad correction while the LED is disconnected; see known issues

If you build one before I do, I'd love to hear how it went.

Repository map

text
xtm-led-driver/
├── design/                 schematics as code, calculations, simulation
│   ├── board_a.py          every Board A part and pin-to-net connection
│   ├── board_b.py          the same for Board B
│   ├── catalog.py          part data: MPNs, LCSC numbers, footprints, verification notes
│   ├── build.py            regenerates hardware/ and runs the connectivity check (ERC)
│   ├── calc.py             every design number; prints calc_output.txt
│   ├── sim/handover.c      time-domain model of a crossover between two sinks
│   ├── compare_netlists.py checks your own KiCad schematic against the generated netlist
│   └── kicad_pos_to_jlc_cpl.py   KiCad position file → JLCPCB CPL, with rotation fixes
├── hardware/               generated from design/: per board, sheet tables, netlist, BOMs
│   ├── board_a/  board_b/
│   ├── board_a.kicad_dru   custom DRC rules (48 V spacing, precision-island clearance)
│   └── LAYOUT.md           the layout rules the scripts follow and you review against
├── layout/                 scripted KiCad 9 layout + Freerouting
│   ├── run_layout.bat      Windows launcher (double-click)
│   ├── make_board.py       stages: place, route, pour, stitch, DRC, export
│   ├── board_a_layout.py   Board A placement, hand-drawn copper, pours, rules
│   ├── board_b_layout.py   Board B the same
│   ├── lib/XTM.pretty/     this project's ESP32-S3-Zero socket footprint
│   └── out/                the finished boards: KiCad projects, Gerbers, CPL, DRC reports
├── firmware/
│   ├── board-a/            STM32G431 firmware in C (CMake), host tests, calibrate.py, flicker.py
│   └── board-b/            ESPHome configs + the xtm_driver external component, tests

Quick start

Just want the boards? The finished layouts are in layout/out/: upload board_a-gerbers.zip and board_b-gerbers.zip to JLCPCB with the settings in the build guide, and order parts from the hand-assembly BOMs in hardware/. Read section 5 first.

Want to check or change the design?

sh
python3 design/build.py            # regenerate netlists and BOMs, run the connectivity check
python3 design/calc.py             # every design number (needs numpy, and gcc for the simulation)
make -C firmware/board-a/tests     # Board A host tests
make -C firmware/board-b/tests     # Board B unit tests
layout\run_layout.bat              # both layouts, on Windows with KiCad 9 and Java 21

Building the firmware?

sh
cd firmware/board-a
cmake -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/arm-none-eabi.cmake && cmake --build build

cd ../board-b
cp secrets.yaml.example secrets.yaml   # fill in Wi-Fi and keys
esphome run xtm-1.yaml

The build guide walks through all of it, from installing the tools to a calibrated, flicker-tested fixture.

Documentation

DocumentWhat's in it
Build guideEvery step to make one yourself: tools, files, ordering, assembly, flashing, bring-up, calibration, flicker testing, use, troubleshooting, pinouts
Design processFrom a 0–10 V dimmer idea to this: the requirements, the reviews, the decisions and what changed them
Hardware referenceBoth boards block by block, with values and the reasoning behind them
Firmware referenceBoard A's control loop, the link protocol, the ESPHome component
Layout scriptsRunning and changing the automated layout
Layout rulesStackup, floorplan, power and sense routing, clearances
Design recordThe Phase 1 review and the Phase 2 detailed design, complete, as written

The design in one chart

The first plan used PWM for the bottom decade and handed the current between ranges with a simple crossfade. Working through the dynamics showed the crossfade would dip the light by up to 17% on a fast fade, because the incoming channel starts from a wound-down integrator. Priming it with a keep-alive current and blending in the log domain fixed it:

Bar chart: worst crossover deviation is 1.5% as built versus 17% in the Phase 1 plan on a 1 s fade, and 0.14% versus 3.7% on a 10 s fade

That story, and the others like it, are in the design process.

Safety

Board A runs from 48 V and can put 38 V on the LED connector. Neither board carries mains: the 48 V comes from a separate, certified, isolated supply (Mean Well LRS-100-48) with its own fused inlet. Wire and enclose the mains side of that supply properly, or have someone qualified do it. Never plug or unplug the LED while the output is on.

Acknowledgements

  • KiCad, Freerouting, ESPHome and Home Assistant do the heavy lifting.
  • firmware/board-a/third_party/ carries Arm's CMSIS (Apache-2.0) and ST's STM32G4 device files (Apache-2.0) and LL drivers (BSD-3-Clause), under their own licences.
  • The ESP32-S3-Zero footprint's pin order was cross-checked against jtomka/kicad-esp32-s3-zero.

License

Not chosen yet. Until a LICENSE file is added, the default applies: all rights reserved, except the third-party files under their own licences.

Parts

206
QtyValueFootprintReferences
19TPTestPoint:TestPoint_Pad_D1.0mmTP1, TP2, TP3, TP4, TP5, TP6, TP10, TP11, TP12, TP13, TP14, TP15, TP16, TP17, TP18, TP19 +3
17100kResistor_SMD:R_0603_1608MetricR1, R6, R10, R16, R72, R73, R74, R75, R76, R77, R78, R79, R80, R81, R82, R123 +1
15100nFCapacitor_SMD:C_0603_1608MetricC3, C11, C14, C16, C23, C41, C43, C50, C70, C71, C72, C73, C76, C77, C78
1110R 0.1%Resistor_SMD:R_0805_2012MetricR90, R91, R92, R93, R94, R95, R96, R97, R98, R99, R100
810kResistor_SMD:R_0603_1608MetricR4, R44, R53, R120, R126, R127, R128, R129
74.7uF 100VCapacitor_SMD:C_1210_3225MetricC4, C20, C21, C24, C25, C26, C27
610nFCapacitor_SMD:C_0603_1608MetricC2, C31, C80, C81, C82, C83
61kResistor_SMD:R_0603_1608MetricR54, R60, R61, R62, R63, R125
61uFCapacitor_SMD:C_0603_1608MetricC9, C15, C42, C48, C51, C75
6NetTieNetTie:NetTie-2_SMD_Pad0.5mmNT1, NT2, NT3, NT4, NT5, NT6
51nF C0GCapacitor_SMD:C_0603_1608MetricC56, C57, C58, C59, C61
52N7002BKPackage_TO_SOT_SMD:SOT-23Q2, Q5, Q6, Q7, Q8
41.00k 0.1%Resistor_SMD:R_0805_2012MetricR46, R48, R50, R52
41.82MResistor_SMD:R_0603_1608MetricR64, R65, R66, R67
410k NTCResistor_SMD:R_0603_1608MetricRT1, RT2, RT3, RT4
410nF C0GCapacitor_SMD:C_0805_2012MetricC44, C45, C46, C47
412.0k 0.1%Resistor_SMD:R_0805_2012MetricR45, R47, R49, R51
42.2nF C0GCapacitor_SMD:C_0603_1608MetricC52, C53, C54, C55
4220RResistor_SMD:R_0603_1608MetricR68, R69, R70, R71
422RResistor_SMD:R_0603_1608MetricR40, R41, R42, R43
4M3MountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
3100RResistor_SMD:R_0603_1608MetricR121, R122, R124
3100nF 100VCapacitor_SMD:C_0603_1608MetricC5, C22, C28
322uFCapacitor_SMD:C_1206_3216MetricC6, C7, C8
34.7uFCapacitor_SMD:C_0805_2012MetricC10, C12, C74
3FIDFiducial:Fiducial_1mm_Mask2mmFID1, FID2, FID3
210uFCapacitor_SMD:C_0805_2012MetricC13, C79
21MResistor_SMD:R_0603_1608MetricR17, R110
22N7002Package_TO_SOT_SMD:SOT-23Q3, Q4
28.25kResistor_SMD:R_0603_1608MetricR14, R15
2LMR38020FDDARPackage_SO:HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.1mm_ThermalViasU2, U3
2MSTBA 2,5/2-G-5,08Connector_Phoenix_MSTB:PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_HorizontalJ1, J2
10.1R 4TResistor_SMD:R_Shunt_Vishay_WSK2512_6332Metric_T1.19mmR102
1100R 0.1%Resistor_SMD:R_0805_2012MetricR101
115uHInductor_SMD:L_Bourns_SRR1260L3
1200kResistor_SMD:R_0603_1608MetricR12
122.1kResistor_SMD:R_0603_1608MetricR7
1220nFCapacitor_SMD:C_0603_1608MetricC40
122nF 100VCapacitor_SMD:C_1206_3216MetricC60
122pF C0GCapacitor_SMD:C_0603_1608MetricC29
1280kResistor_SMD:R_0603_1608MetricR3
12x5 box headerConnector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ3
133uHInductor_SMD:L_Bourns_SRR1260L2
13A TFuse:Fuse_Littelfuse-NANO2-451_453F1
147nFCapacitor_SMD:C_0603_1608MetricC30
147uF 100VCapacitor_SMD:CP_Elec_10x10C1
152.3kResistor_SMD:R_0603_1608MetricR5
16.2kResistor_SMD:R_0603_1608MetricR2
1600R@100MHzInductor_SMD:L_0805_2012MetricFB1
1600R@100MHz 2AInductor_SMD:L_0805_2012MetricFB2
164.9kResistor_SMD:R_0603_1608MetricR11
17.32kResistor_SMD:R_0603_1608MetricR13
182kResistor_SMD:R_0603_1608MetricR18
1BAV199Package_TO_SOT_SMD:SOT-23D3
1DAC80504RTETPackage_DFN_QFN:Texas_RTE0016D_WQFN-16-1EP_3x3mm_P0.5mm_EP0.8x0.8mmU6
1LDL1117S33RPackage_TO_SOT_SMD:SOT-223-3_TabPin2U5
1NDT3055LPackage_TO_SOT_SMD:SOT-223-3_TabPin2Q1
1OPA4388IPWRPackage_SO:TSSOP-14_4.4x5mm_P0.65mmU7
1SMBJ43ADiode_SMD:D_SMBD2
1SMBJ58ADiode_SMD:D_SMBD1
1STDC14Connector_PinHeader_1.27mm:PinHeader_2x07_P1.27mm_Vertical_SMDJ4
1STM32G431CBU6Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mmU1
1TPS7A2050PDBVRPackage_TO_SOT_SMD:SOT-23-5U4
1greenLED_SMD:LED_0603_1608MetricD4

More from ruckusmattster/xtm-led-driver

1
  • 2 layers60 × 45 mmBoard b, the printed circuit board in 3D

    Board b

    ruckusmattster/xtm-led-driver

    A HDR LED driver with ESPHome integration focused on driving a 36V 1.4A LED

    42 partsMIT

Similar boards

  • 4 layers202.5 × 307.5 mmElement foxtrot, the printed circuit board in 3D

    Element foxtrot

    visionspacetec/VST104-Foxtrot

    VST104 Flat-Sat board - referred as element_foxtrot

    147 parts5
  • 4 layers122.1 × 95.5 mmBoat PCB V3, the printed circuit board in 3D

    Boat PCB V3

    ka1e27/dreams

    Autonomous survey catamaran: CV-based obstacle avoidance, environmental sensing, and cellular telemetry to a web dashboard.

    140 parts
  • 4 layers106 × 63.5 mmBrineomatic, the printed circuit board in 3D

    Brineomatic

    hoeken/brineomatic

    Open Source Watermaker Controller.

    323 parts47LGPL-2.1
  • 4 layers144 × 127 mmFrothfet, the printed circuit board in 3D

    Frothfet

    hoeken/frothfet

    Yarrboard load controller board with current sense, volt sense, fuses, and sender support.

    394 parts14GPL-3.0
  • 2 layers40 × 50 mmWired sculpt, the printed circuit board in 3D

    Wired sculpt

    chadaustin/wired-sculpt-pcb

    KiCad design files for the Wired Sculpt conversion mod

    39 parts35
  • 4 layers55 × 25 mmADF4158 PCB, the printed circuit board in 3D

    ADF4158 PCB

    daniestevez/ADF4158_PCB

    ADF4158 + HMC391 PCB for 10 GHz FMCW radar LO

    83 parts30CERN-OHL-P-2.0
  • 2 layers106.2 × 40 mmProjectTamiya TX, the printed circuit board in 3D

    ProjectTamiya TX

    lunakiller/project_tamiya

    Custom open-source RC car system based on STM32 MCUs

    45 parts8GPL-3.0

Questions

How big is the Board a PCB?

It measures 90 × 60 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Board a use?

206 parts, built around the STM32G431CBU6, OPA4388IPWR(UMW), LDL1117S33R and TPS7A2050PDBVR. 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 Board a KiCad files?

From the ruckusmattster/xtm-led-driver repository on GitHub, at the commit this page was made from: the board is layout/out/board_a/board_a.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Board a design in my own project?

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