DALI Lighting Control for Makers: Protocol Basics and Driving DALI Fixtures with an ESP32
This site's DMX512 guide covers the protocol behind stage and entertainment lighting, but there's a second, entirely different addressable lighting bus that makers run into whenever they salvage commercial LED drivers, work on a smart-building project, or pick up secondhand architectural fixtures: DALI. Where DMX512 is built for fast, unidirectional control of stage fixtures, DALI (Digital Addressable Lighting Interface) is built for slow, bidirectional, individually-addressable control of building lighting — office panels, LED downlights, and emergency lighting — and it behaves nothing like DMX or a simple PWM dimmer once you look at the electrical layer. If you've picked up a box of DALI-ballasted fixtures and wondered why your ESP32 GPIO won't just dim them, this is why, and how to actually drive them.
What DALI Is and How It Differs from DMX and PWM
DALI (IEC 62386) is a two-wire, polarity-insensitive bus that carries both power for the bus signaling and half-duplex serial data between a controller and up to 64 individually addressable devices per line. Unlike DMX512's fast unidirectional RS-485 stream, DALI runs at a comparatively slow 1200 bps using Manchester encoding, and — critically — it's bidirectional: a DALI ballast or LED driver can report its status, current dim level, and fault conditions back to the controller. That query capability is the entire point of DALI in commercial buildings: a building management system can poll every fixture and know which ones have failed, not just send a "go dark" command and hope.
PropertyDALIDMX512 Wiring2-wire, polarity-insensitiveRS-485 differential pair, polarity matters Bus voltage~9.5–22.5V (bus itself, not mains)~5V logic level over RS-485 Speed1200 bps, Manchester encoded250 kbps DirectionBidirectional (devices report status)Unidirectional (controller to fixture only) AddressingUp to 64 devices, individually addressed and groupable512 channels per universe Typical useOffice/commercial lighting, emergency lighting, building automationStage, theater, architectural show lightingYou cannot drive a DALI ballast from a GPIO pin the way you might toggle a relay, and you cannot wire it up like DMX512's RS-485 pair either — the DALI bus itself sources current to the devices and uses a specific voltage-level, current-limited signaling scheme that a microcontroller's UART was never designed to speak directly.
The Hardware You Actually Need
Because DALI's electrical layer is its own thing — current-limited, bus-powered, and tolerant of a fair amount of noise by design — the practical path for a maker is a dedicated DALI transceiver IC or module rather than trying to bit-bang the analog signaling directly:
- DALI transceiver ICs (such as the ones built around the NXP/onsemi DALI PHY family) sit between your microcontroller's UART and the two-wire DALI bus, handling the current-limited driving and Manchester decode/encode so your firmware just sends and receives bytes.
- Pre-built DALI-to-serial or DALI-to-USB gateway modules are the fastest path if you'd rather not design bus-interface hardware: many expose a simple serial or I2C command interface that an ESP32 can drive directly, at the cost of losing some low-level control over bus timing.
- A DALI power supply is required on every bus — unlike DMX, the DALI bus itself needs a dedicated 16V-ish supply (often built into a DALI gateway module) to power the bus signaling; most DALI ballasts do not supply this themselves.
Talking DALI from an ESP32
Once you have a transceiver module bridging UART to the DALI bus, the protocol itself is straightforward to work with in firmware. DALI commands are simple forward frames: an address byte (short address 0–63, group address, or broadcast) followed by a command or dim-level byte, sent as a 16-bit Manchester-encoded frame with defined timing gaps between frames. Common operations you'll implement:
- DAPC (Direct Arc Power Control) — set a specific fixture or group directly to a dim level from 0–254, the DALI equivalent of a PWM duty cycle command.
- Query commands — ask a device for its current actual level, status byte, or lamp failure flag; the ballast replies on the same two wires within a defined response window, which your UART receive logic needs to watch for.
- Commissioning/addressing — new DALI devices ship unaddressed; assigning short addresses uses a randomized search-and-withdraw addressing sequence defined in the spec, which is more involved than DMX's simple "set a channel number on the fixture" approach, but only needs to run once per installation.
Existing open-source DALI master libraries (originally written for Arduino-class hardware) port reasonably cleanly to the ESP32's Arduino core, since the timing requirements are forgiving at 1200 bps — well within what a software UART or the ESP32's hardware UART peripheral can handle without special real-time tricks.
Where This Actually Gets Used
The realistic maker use case isn't building DALI fixtures from scratch — it's bridging secondhand commercial DALI hardware (recessed downlights, linear office fixtures, or salvaged building-automation panels) into a home Home Assistant setup, giving each fixture individual dimming and fault reporting instead of the all-or-nothing switching most home lighting projects settle for. A single ESP32 with a DALI gateway module can sit on a bus of up to 64 fixtures and expose each one as its own dimmable entity over MQTT, which is a meaningfully more capable result than driving the same fixtures through a simple relay or 0–10V dimming interface.
Safety Notes
DALI ballasts are mains-powered devices even though the DALI control bus itself is low voltage — the ballast's mains input and output to the lamp are galvanically separate from the DALI signaling pair in a properly designed fixture, but you are still working next to line voltage whenever you're wiring into a real ballast. Keep the low-voltage DALI bus wiring physically separated from mains wiring in your enclosure, never assume a "two-wire" bus is safe to treat casually just because it isn't mains, and if you're integrating salvaged commercial fixtures, verify the ballast's DALI compliance and mains wiring before powering anything up.
DALI is a genuinely different animal from the addressable-LED and DMX lighting protocols this site has already covered, and it's worth knowing the difference the moment you're staring at a box of secondhand commercial fixtures wondering why none of your usual tricks are lighting them up.