Simple USB to DMX512 Interface for Arduino Micro or Leonardo
This is a do-it-yourself construction manual for a simple USB interface to control a DMX512 lighting bus.
The basic part is an Arduino Micro module, completed with a minimum number of additional components. The PCB layout is optimized for straightforward reproduction on a Veroboard.
An Arduino Leonardo can be completed with a DMX transmitter even more simply (see below). The firmware is the same for both models.
Due to the limited SRAM size of the ATmega32U4 microcontroller (the soft fade feature needs a lot), the number of accessible DMX channels is max.256. Because this firmware makes use of the ATmega Boot Section, it can only be programmed with an external ISP programmer, not with a bootloader.
Three different command sets are selectable by a jumper or switch:
- RS-232 compatible ASCII commands. The microcontroller is configured as USB Communication Device (CDC/ACM class) and is seen as a virtual COM port by the host.
- The widely known and implemented MiniDMX protocol developed by Mathias Dzionsko.
Formally this is implemented here as ASCII command 'Z' (hex 5A). This letter is the header byte of each MiniDMX data packet. So when it gets received, the microcontroller jumps into the corresponding decoder routine and returns back to the ASCII command mode after the MiniDMX packet is processed. Fade processes, prestored lighting scenes and the chaser are not supported by the MiniDMX protocol. But it is compatible with the free software DMXControl3 (used for test here) and Freestyler.
Unfortunately the original website with the MiniDMX specification is not online anymore.
- or by MIDI channel messages. The microcontroller is configured for USB MIDI Streaming class and is seen as a virtual MIDI port by the host. This way DMX is controlled easily by a MIDI sequencer or other musicians tools.
- up to 90 lighting scenes may be stored permanently and reloaded by command or by the chaser
- soft fade transition between lighting scenes and single channel operations up to 32 seconds
- special commands for RGB lamps (hue, saturation, luminance)
- the chaser loads series of lighting scenes in a cyclic manner
- global masterfader
- compatible with "DMXControl" software version 3.0
- no proprietary drivers needed
- USB Bus powered, <100mA
An alternative firmware is available for download, which supports the MiniDMX protocol for 512 DMX channels with no special features else. It is implemented instead of the MIDI command set. The ASCII command set (more features but 256 channels) is the same as described above and selectable by a jumper or switch. In both positions, the microcontroller is configured as USB Communication Device (CDC/ACM class) and is seen as a virtual COM port by the host.
Assembly of the Arduino Leonardo version (schematic see manual):
When the orange jumper (connects IO9 with Ground) is set, USB is configured as a virtual serial port and the ASCII/MiniDMX command set is active. When it is removed, USB starts as virtual MIDI interface with the MIDI command set (or 512 channels MiniDMX, depending on the installed firmware version).
The black wire is Ground, the white wire is +5V. The grey wire sends DMX from Arduino TX (D1), the violet wire (D2) disables the DMX transmitter during USB enumeration. Connections are made with 2.54mm pinheads, nothing is soldered at the Arduino.
The subsequently downloadable material is copyrighted (c)2015-17 by Wolfgang Schemmert.
Assembly and use of the interface is permitted for free by everybody for any purpose ("freeware")
The MiniDMX firmware is provided under "Creative Commons 3.0 DE License"
All information is based on best knowledge, but without any warranty. Any responsibility is excluded.
A detailled construction- and operation manual (PDF file) is available
Veroboard and PCB layout for Arduino Micro (1:1 TIF format)
Detailled solder side view for Arduino Micro (JPEG, not scaled)
Detailled solder side view for Arduino Leonardo (JPEG, not scaled)
Standard Firmware: MIDI or ASCII text command set (256 DMX channels) selectable.
Hex code for Arduino Micro and Leonardo (version 1.11 , 08 January 2017)
recommended Fuses configuration: extended 0xF9, high 0xCF, low 0xFF)
Alternative Firmware: MiniDMX (512 DMX channels) or ASCII command set (256 DMX channels) selectable.
Hex code for Arduino Micro and Leonardo. (version 1.11 , 08 January 2017)
(recommended Fuses configuration: extended 0xF9, high 0xCF, low 0xFF)
Both firmware versions work unmodified with Arduino Leonardo, but in default state get recognized as Arduino Micro. The USB Vid/Pid can be changed by the user. The LED of the Micro version is doubled at the Leonardo onboard TX led with the difference that is off during idle state and goes on when data are transferred.
* State of information May 2018.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only, without any warranty. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.