The ArduinoDMX library, originally written to work with the MKR series Arduinos and the MKR485 shield, will also enable you to send DMX-512 out from any Arduino to control DMX fixtures. This library uses the ArduinoRS485 library and an RS485 transceiver chip like Maxim’s MAX485 chip to send DMX data.
If you’re using a MKR series Arduino and a MKR485 shield, you can simply plug the shield into the MKR board, connect an XLR connector to the shield, and you’re ready to go. For other models, you’ll need to connect your Arduino to a MSX485 chip, which will output the RS485 serial protocol on which DMX-512 depends.
Connect your Arduino to a MAX485 chip as shown in Figure 1. The ArduinoRS485 library uses the following pins:
Serial1. On the Uno and the Nano Every, there is only one hardware serial port, so you need to use that port, which is connected to pins 0 (Rx) and 1 (TX). The Arduino’s Serial TX will connect to the MAX485’s Driver Input (DI) pin. On the Uno, Serial TX is digital pin 1. On the Nano, it’s physical pin 16.
Serial1port if there is one, otherwise use the only serial RX pin. Serial RX will connect to the MAX485’s Receiver Out (RO) pin. On the Uno, Serial RX is digital pin 0. On the Nano, it’s physical pin 17.
Figure 1. Arduino Nano 33 IoT connected to a MAX485 chip. The MAX485 is a DIP package. Its pins, reading in a U-pattern from top left, are RO, RE, DE, DI, GND, A, B, Vcc. The pins are connected as described above.
Note: on the Uno, you will not be able to use the Serial Monitor for debugging messages because the ArduinoRS485 library takes over the hardware serial port. Check this on the Every too
Connect a 120-ohm resistor between the MAX485’s A and B output pins, and then connect the pins to the D+ and D- pins of a 3-pin or 5-pin female XLR connector, depending on the type of connector your DMX fixtures need. Connect them following the DMX-512 standard layout. The pins in an XLR connector are arranged in a half circle. When facing the rear of a female XLR connector with the half circle of pins on the bottom, the pin numbers are arranged as follows, from left to right, counterclockwise:
The wiring from the MAX485 to the XLR connector is as follows:
If you’re using a MKR485 shield, connect the DMX connector as follows:
Once the circuit is ready, you can use any of the following examples or the library’s examples to get started.