USB to MIDI,RS-232 or DMX512 Interface with Arduino Micro

USB to MIDI,RS-232 or DMX512 Interface with Arduino Micro

This is a DIY construction manual for an USB to MIDI (or RS-232) interface. Primarily a simple hardware expansion for Arduino Micro (ATmega32U4) with additional hardware on Veroboard is described.
Additionally a similar hardware based on ATmega32U2 is presented.
Optionally, both versions may be completed with an USB to DMX512 transmitter.

assembly photo
Assembly of the Arduino Micro version with MIDI, RS-232 and DMX OUT in "Eurobox" enclosure.

The most essential features:

  • The USB port can be operated as a virtual MIDI interface defined by the USB MIDIStreaming class - or as a virtual RS-232 interface defined by the USB Communication Device class (CDC/ACM). The interface type and the baud rate are selected by a set of dip switches (or by jumpers).

  • MIDI IN and RS-232 RxD as well as MIDI OUT and RS-232 TxD are arranged in parallel by hardware design. Following baud rates are selectable: MIDI, 38400, 19200 and 9600, independent of the presently active USB class. Data transfer is bidirectionally "transparent". MIDI byte clusters are handled automatically as demanded by the USB MIDIStream protocol.

  • Optionally, selected by dip switch or jumper, the device may be operated as a simple USB-to-DMX512 interface. Depending on the active USB class, a DMX command set based on MIDI channel messages is available respectively an alternative ASCII text based DMX command set. Due to the limited SRAM size of the microcontrollers, the number of accessible DMX channels is max.256 (ATmega32U4) respectively 128 (ATmega32U2).

  • For DMX some special features are implemented:
      --- for all DMX channels a timed fade between DMX levels is possible
      --- up to 90 presets (lighting scenes) may be stored permanently and reloaded by a single command
      --- the chaser feature loads series of stored lighting scenes in a permanent loop
      --- hue, saturation and luminance for RGB lamp fixtures can be set by simple commands
    Because this firmware makes use of the ATmega Boot Section, it can only be programmed with an external ISP programmer, not with a bootloader.

  • For the Arduino Micro version with ATmega32U4 an easily reproducible Veroboard design is presented.
    For ATmega32U2 a more complex single layer PCB design is available for download.

  • The devices are "full speed" grade and USB bus powered with less than 100mA supply current.
A detailled construction- and operation manual is provided here (PDF file).

Pure Data demonstration and test patcher

pd test patcher
The most essential ASCII commands for DMX control of the USB to MIDI/RS-232 Interface may be sent from this Pure Data patcher (download see below). For smooth execution, input of short numeric parameters is terminated by a semicolon character (ASCII code 59), which works as a dummy command with no effect else.
By the way, input of any ASCII command with PC keyboard is possible. Because "carriage return" is not supported by Pure Data in this case, short numbers have to be terminated by a semicolon for immediate execution too.
For some commands, direct command transfer - while the slider is moved - would cause unpleasant side effects. In these cases, command execution has to be triggered explicitly after the parameter value is adjusted by slider.

The subsequently downloadable material is copyrighted (c)2015-16 by Wolfgang Schemmert.
Assembly and use of the devices 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.

Veroboard and PCB layout for Arduino Micro (1:1 TIF format)

Firmware hex code "USB-MidiRsDmx" incl. DMX OUT for ArduinoMicro (Version 1.8 , 27 February 2016)
(recommended Fuses configuration: extended 0xF9, high 0xCF, low 0xFF)

PCB layout for ATmega32U2 (1:1 TIF format)

Firmware hex code "USB-MidiRsDMX" incl. DMX OUT for ATmega32U2 (Version 1.8 , 27 February 2016)
(recommended Fuses configuration: extended 0xF9, high 0xCF, low 0xFF)

PD (Pure Data) demonstration and test patcher (ZIP file)

Source code "USB-MidiCom" for ATmega32U4 and ATmega32U2 (status 26 February 2016)
Simple USB/serial interface for USB-MIDIStreaming class and USB-CDC/ACM class. Sorry, completely written in assembler language
The ATmega32U4 (Arduino Micro) version has been completed with a MiniDMX option.

* State of information December 2016.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.