How to Use DMX512 / RDM With Raspberry Pi
by Zihatec in Circuits > Raspberry Pi
20877 Views, 24 Favorites, 0 Comments
How to Use DMX512 / RDM With Raspberry Pi
DMX is a digital-network communication standard that offers flexible control options for a wide variety of lighting, including LEDs. Originally developed in the 1980s, DMX has become the go-to choice for stage lighting, upscale venues and complex lighting effects. In DMX512 bus systems RS-485 is used as the physical layer. Our RS422 / RS485 Serial HAT is a fully galvanic isolated serial communication HAT designed for use with the Raspberry Pi and the perfect choice for such kind of applications.
The following instructable will show how to configure the HAT for DMX and what steps are necessary for the software installation under Raspberry Pi OS Bookworm.
Supplies
- Raspberry Pi 3, 4, or 5
- RS422/RS485 serial HAT (available in our webstore)
- 5pole XLR connectors (male & female) for professional use
- 3pole XLR connectors (male & female) for semi professional use
- hook-up wires
Wiring of 5pole XLR
The official XLR plug for DMX/RDM is 5-pins, that is always used in professional systems.You have to connect a male and a female connector as in the picture above.
Wiring of 3pole XLR
For semi-professional and hobby equipment there is the 3-pins XLR.
DIP Switch Setting
Our RS422/RS485 HAT comes with 3 DIP switch banks. You have to set these DIP switches for DMX as shown in the picture above.
- Switch 1: OFF-OFF-ON-OFF
- Switch 2: OFF-OFF-ON-ON
- Switch 3: ON * - OFF-ON-ON
*Depending of the position of the RS422/RS485 HAT in the DMX512 bus line you have to switch the terminating resistor ON or OFF. Please switch the resistor to ON position only if the HAT is on one end of the bus line. In all other cases switch the terminating resistor OFF:
Configuration of Raspbian Operating System
The easiest way is to use the raspi-config tool to enable the UART to the GPIO14/15 pins.
take a fresh Raspberry Pi OS „Bookworm“ image and open the console window (via SSH or in the shell)
sudo raspi-config
goto '3 Interface Options'
goto 'I5 Serial Port'
'Would you like a login shell to be accessible over serial?' --> NO
'Would you like the serial port hardware to be enabled?' --> YES
Finish raspi-config
reboot the Raspberry Pi
sudo nano /boot/firmware/config.txt
Add the following lines to the end of this file:
dtoverlay=disable-bt
init_uart_clock=16000000
The value for init_uart_clock may need to be increased for fast systems such as the Pi5.
Now, we activate all other services that may use the UART:
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl disable hciuart
Installation of OLA
sudo apt-get install ola
Now we have to activate and configure the UART-DMX plugin for OLA:
sudo nano /etc/ola/ola-uartdmx.conf
Please copy the following lines into the file. Delete old contents!
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Finally, the users olad and pi must be assigned the necessary rights.
sudo adduser olad tty
sudo adduser pi olad
Reboot the system!
Create a "Universe" in OLA
OLA is now running as a DMX server on the Raspberry Pi. You can access the OLA web interface via the browser of another computer in your network. To do this, enter the following IP address in the browser:
YourIP:9090/ola.htm
First we have to create a so-called Universe under OLA. To do this, click on the "Add Universe" button.
You can now enter a Universe id e.g. 0 and a name for the Universe e.g. "Test". Then activate the "UART native DMX" port at the bottom.
Use of OLA
You can access the new Universe via Universes --> Test.
Click on the "DMX Console" tab. You can now use the sliders to control your DMX device.