This shield allows to connect an Arduino with DMX equipment (Figure 1). It implements the RS485 interface to adapt the electrical levels needed for DMX connection.
This shield has been designed with flexibility in mind and allows the user to choose between several Arduino pins for digital input and output of DMX data, it supports a microSD slot and also has the serial connection to support a serial LCD display.
|Figure 1.||Arduino DMX shield for Illumination Projects|
This design allows basic operation of DMX through simple pre programmed messages stored in the Arduino Sketch or, with the proper libraries and programming, it could well become a standalone system with playback capabilities of sequences stored on the microSD. When needed, this solution is also a suitable interface for a PC sending through a serial port the DMX commands.
|Figure 2.||DMX512 timing diagram.
This interfacing and communication standard has been developed to allow easier management of complex lighting systems. On stages and discos, many spots, pars, moving heads and other equipment need to be managed and controlled, but bringing power from a centralized panel rises many issues for safety and cabling complexity.
With DMX, each device has an integrated or external controller. A control system sends a specific message to each controller with a byte that the controller itself interprets according to its address and capabilities. Power supply becomes “local” and the communication is with a daisy chained cable that carries low voltage signals.
DMX data is sent in parallel to every controller connected and the address given to each controller allows each device to grab and interpret only the relevant information.
The transmission scheme has been designed for efficiency as DMX may drive up to 512 devices at the same time, with 40 complete transmission sets per second. To achieve this, with 8 bits, 1 start and 1 stop bit, speed has to be 250 kbps. The serial data starts with a header and then bytes are sent in sequence, starting from the first one (Figure 2).
If we have to send a new command to the controller with address 10, we need to send also the data relevant to the controllers from 1 to 9. The addressing system is based on position of the byte and each controller counts the incoming bytes, discarding the ones preceding and following its own byte.
It is also important to remember that each command received is always relevant, therefore to alter the state of a single controller, it is necessary to send valid commands to all the controllers that have a lower address. The sequence, however, may end when the address of the relevant controller has been reached (no need to send the sequence with data exceeding the relevant controller address).
The values from 0 to 255 initially represented the level of the light (0 = off, 255 = full brightness), but the adoption of DMX by other devices turned the meaning of the byte into other commands, eg. position, program selection, specific preset, activate feature and so on. Each manufacturer specifies the mapping between values and functions and sometimes a single byte is not enough to manage all the capabilities, therefore the device occupies an interval of addresses on the DMX bus and reads more than one byte, in sequence.
This shield uses a MAX485 by Maxim to convert the signal levels from the Arduino digital pin to the RS485 differential simplex two wire plus ground connection (Figure 3). The MAX485 contains a receiver and a transmitter, with enabling signals. The /RE (pin 2) and OE (pin 3) – that enable reception and transmission – are with inverted levels, so that it is possible to use a single line and the two pins connected together to manage transmission direction. Pin 1 is Receive Output, pin 4 is Data Input, pin 6 and 7 are the differential outputs.
DMX Shield schematics
It is possible to choose between different Arduino D pins for each of the three signals needed: RO may be mapped onto D0 or D4, DI onto D1 or D3 and /RE+OE onto D2 or D5.
The other chip on the shield is an 74HC4050D that contains six buffers to match TTL levels from Arduino ICSP with the 3,3V required by the microSD. This is required just by microSD input lines because Arduino input correctly reads the 3,3V level supplied by microSD as a logic “1”.
The last bits of the schematics include a couple of LEDs connected to D7 and D8, a pushbutton on A1 and the serial connection for the LCD on A0/A2 (jumper selectable).
|Figure 4.||Location of the components on the circuit board|
Before you proceed with this shield, you should decide the various jumpers positions; if no other shield is used with Arduino, you are free to choose any of the two positions available; when used with other shields, use the jumpers to avoid any conflict. Please note that ICSP is used with Ethernet shields as well, therefore the microSD slot might create conflicts if used with an Ethernet equipped solution.
This shield needs a specific library named DmxSimple.h available in downloading section; with it you will find some examples. We also have two other sketches to let you experiment with this shield.
We also suggest to use Vixen to create sequences on a PC, synced with music, that are sent to Arduino over the serial port. The communication between Arduino and Vixen is managed by our sketch DMX_LightSequencing.
DMX library and examples - download