Simple DMX Power Strip with Relays and an Arduino

Finished 2-Channel DMX Switch With Relays, Breadboard & Arduino

The thing I honestly miss most about my time studying and working abroad in Berlin is the nightlife. The clubs there are amazing and feature incredible music with equally amazing light shows.

I’ve always thought club lighting is cool and have wanted an excuse to play with DMX for some time. We love dancing too so a few weeks ago we decided to turn an empty room into our little private nightclub.

The colorful animated LED sign I made out of Hue bulbs was already in that room so the space already had a bit of a neon dance floor/nightclub feel.

We bought two small DMX fixtures and two fixtures that did not have DMX: a small mirror ball light and a UV (Blacklight) flood light.

I needed a way to bring DMX control to 1) the mirror ball light and 2) the UV light so that they could remotely be switched on and off from the same software that controls the DMX fixtures.

Update: Read about the Art-Net to DMX Node I created to control my DMX lights wirelessly

🎯 Design Goals

  • Two switched (DMX-controlled) outlets for controlling basic on/off lighting fixtures that don’t support DMX
  • A simple design (no custom PCB)
  • DMX In & Out
  • Using an old Arduino Uno Rev3

Illustration

I want to be able to use DMX to turn on/off a UV Wash and a white pinspot pointed at a mirror ball. The design I settled on resembles a 2-outlet power strip:

Illustration Showing a White Ceiling Pinspot Aimed at a Mirror Ball and a UV Wash That Will Both Be Controlled By DMX/Arduino

🛒 Materials

All Parts for this Project Laid Out on the Workbench

🛠️ Tools

  • Multimeter
  • Soldering Iron (If using a perf board)
  • Saw to cut wood
  • Something to strip wires (Scissors, Wire Stripper Tool, etc!)
  • Drill or Impact Driver

Circuit Design

Tinkercad Circuit Schematic - 2x N-Channel Mosfets, Relays, Wiring, Diodes, Resistors and Blue LED

The circuit is very simple and is easy to solder on a protoboard or put together on a breadboard. It has two mosfets that turn on/off two 12V relays. The relays switch the power to the two outlets.

The DMX Shield is then installed on top of the Arduino.

Soldering The Circuit Board

Build the Enclosure

I designed an enclosure using some scrap wood I had around. Feel free to be creative!

Wiring the 12V Power Supply

Working with mains voltage (120V) is dangerous. Be careful.

Connect the hot (black/dark gray) wire from the wall to each socket’s hot terminal.

The neutral wire coming in from the wall will be connected to both relays before being connected (through the relay) to the socket. When the relay is switched on the current will be able to flow through whatever light is plugged into the socket.

120V Sockets with Wall Plates Mounted Together
The wall plates have been added. It is now looking like a power strip. In the middle is where the relays will go. The gray 12V power supply on the right will be covered up so that the Arduino and PCB can be mounted there.

Wiring the Relays

Two 12V Relays with DIN Rail
Relay Pinout

Connect the neutral leads (from socket and mains power) to relay pins #5 and #3. This way no current will flow unless the relay is energized.

Next, we need to connect the relay coils to the mosfet circuits on the PCB. We’ll also run the 12V power output up to where the PCB and Arduino will be located (Above the power supply)

I added a piece of wood above the power supply for mounting the Arduino on top of. It should now look like the following:

Relay and 12V Power Wiring

Finally, mount the PCB and Arduino securely and connect the power supply and relays to the screw terminals.

Arduino With DMX Shield Connected to Breadboard and Relays

The Finished Hardware

Finished 2-Channel DMX Switch With Relays, Breadboard & Arduino

Now we just need to program the Arduino and we’re done!

Arduino Code

Below is the code that listens for DMX messages on two channels (one for each relay). DMX channels can be set to a value from 0 to 255. I choose to have the relays turn on if the value for the associated channel is greater than 0. You can choose a different threshold if you’d like.

/*

 DMX 2-Channel Relay Board
 DmxRelayBoard.ino

 Note: Requires library DMXSerial by Matthias Hertel. 
       Tested using version 1.5.3.

 - Starting Channel (Configured below): 255
 - Relays turn on if data value is larger than 0 (1-255)
 - Blue status LED indicates that DMX frames are being received

 Created 08/11/2023 by Taylor Mingos

*/

#include <DMXSerial.h>

const int START_CHANNEL = 255;
const int RELAY_1_PIN   = 7;
const int RELAY_2_PIN   = 6;
const int STATUS_LED    = 5;

void setup() {
  pinMode(RELAY_1_PIN, OUTPUT);
  pinMode(RELAY_2_PIN, OUTPUT);
  pinMode(STATUS_LED, OUTPUT);

  DMXSerial.init(DMXReceiver);
}

void loop() {
  unsigned long lastPacket = DMXSerial.noDataSince();

  if (lastPacket < 1000) {
    digitalWrite(STATUS_LED, HIGH);
    digitalWrite(RELAY_1_PIN, DMXSerial.read(START_CHANNEL) > 0);
    digitalWrite(RELAY_2_PIN, DMXSerial.read(START_CHANNEL + 1) > 0);      
  } else {    
    digitalWrite(STATUS_LED, LOW);
  }
  
  delay(10);
}

Note: The DMXSerial library requires that you configure the DMX shield to use the UART pins, like so:

Jumper Configuration for Arduino DMX Shield

If you have trouble flashing the Arduino you may need to remove the DMX shield or at least remove the top jumper (en) to temporarily disable the DMX shield. This is because the Arduino is flashed over the UART Tx & Rx pins, the same pins the DMX shield listens to.

🪩 All Done!

Enjoy! 🕺

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like