DMX Lighting Control - DitroniX/ESPuno-Pi-Zero_WiFi-BT-Zigbee-Thread-60V GitHub Wiki
The ESPuno Pi Zero features a RS485 Interface which allows it to be used as a DMX, or DMX512, Lighting Controller or Analyser/monitor.
What is DMX?
DMX is an acronym for Digital Multiplex. This is a communications protocol used in the lighting industry, ranging from small home lighting, through to large lighting rigs as used for concerts and stages.
DMX is a client/server data communications protocol in the application layer. One device must initiate a request and then wait for a response. The initiating device (the master) is responsible for initiating every interaction.
DMX512
The DMX technology is able to control up to 512 devices, or distinct parameters, hence DMX512. This large device number allows the control complex and very large lighting systems and rigs.
The lighting industry adopted the DMX512 protocol due to its simplicity and ability to unify a single lighting standard.
Data
DMX512 data is transmitted sequentially in asynchronous serial format, starting with slot 0 and ending with slot 512. Prior to the first data slot being sent, a reset sequence is sent.
Interfacing the ESPuno Pi Zero to a DMX light, or rig, is simply connecting an XLR cable (DMX not Audio), to the RS-485 interface. A,B and Ground.
XLR
XLR is an acronym for eXternal Line Return.
The connector used on most DMX lighting is based on the 3-pin XLR plug and socket.
- DMX XLR Female (socket) - outputs the data This is the DMX output on the rear of controllers.
- DMX XLR Male (plug/pins) - inputs the data. This is the DMX input on the rear of lighting.
XLR Cables
XLR cables essentially come in two flavours.
XLR Analogue
XLR analogue cables are designed for balanced and un-balanced AUDIO use. The cables are high capacitance and low impedance, often double screened in order to provide protection from external noise, thus keeping low level analogue signals clean and away from interference.
The XLR analogue cables have a typical low impedance of around 40 to 100 Ohms.
Do not mix your XLR cables
XLR analogue cables should not be used as XLR digital cables. For single lights, or very short runs, it may work but using the high capacitance XLR analogue cables will end up with corrupted digital signals. This is where the lights may not respond to commands or act intermittently.
XLR Digital
XLR digital cables are designed to eliminate data corruption through low capacitance and higher impedance. They may be electrically similar but have a very different cable specification.
- The XLR digital cables have a impedance of around 120 Ohms.
- The lighting is typically daisy chained, so each light would have a XLR male and female connector.
- The connections are paralleled up and NOT crossed over.
- The connections are Hot-Pluggable.
- Two types of XLR connectors are used. 3 Pin and 5 Pin.
- Most lighting uses the standard 3 pin XLR and is the de-facto standard.
- The 5 pin XLR was designed to provide an additional data pair but not many manufacturers use this system.
The connections pins are:
- Signal Common or Ground
- Data - (A)
- Data + (B)
Terminators
Every DMX install should be properly terminated with a 120 Ohm Terminating Resistor. This is ONLY at the end of the line (far end).
If the terminating resistor is not added, the DMX signal can bounce, or reflect, the signal back and cause interference or data corruption.
Some lights have a termination, or end of line, switch. This effectively switches in a 120 Ohm resistor across the A B data pair.
Important: Do not switch this termination on, on every light, as this will cause lighting system instability and data corruption. This is because you are effectively paralleling the 120 Ohm resistors and causing a very low impedance. Basic ohms law.
If you have a long run or large lighting rig, DMX Terminators are available, which are effectively a 3-Pin XLR Plug with 120 Ohm Resistor inside.
Fitting, or switching in a DMX terminator at the end of the line will improve the signal transmission quality and reliability of the system and ensure the normal operation of the lighting setup.
Baud Rate
DMX uses an unusual Baud rate of 250,000 (250 kbit/s), with no parity and two stop bits. This means each bit is 4uS (micro seconds), long.
Each frame is 11 bits in length. The start bit, and then eight bits in the byte, and the two stop bits.
In order to begin a transmission, the master must send a break (line low), and then a mark (line high).
The default state of the DMX bus is high on A (-), and low on B (+).