Connect With Us


vrijdag 31 maart 2017

DMX Proto Shield

Allright, here's a project that has been underway for quite a while! Two years ago, I made a set of green LED spotlights. Back then, I wanted to make a proper controller, but due to lack of time I had to settle for an improvised one, consisting of some connectors soldered to a prototyping board plugged into an Arduino controller.
Ever since, I've been planning to build a DMX-based controller, so I can use a PC to program them. Although I quickly had a simple circuit up and running, I've been postponing designing a circuit board and building something that can actually be used for way too long. And here it finally is! This post is going to be a bit technical, some basic knowledge about electronics will come in handy.

Arduino and DMX
The controller uses the DMX protocol and the Arduino platform. I'll explain briefly what these things are. DMX is a system designed for controlling stage lighting. A DMX system consists of a transmitter (the "master") and a series of receivers (the "slaves"). Each receiver has an address between 1 and 512, and can receive one or more channels of data. For example, a simple spotlight will use one channel for brightness, while an RGB spotlight will use three channels. The transmitter can be a DMX console, with knobs and sliders, or a computer running DMX software and a hardware interface.
The Arduino is a simple microcontroller board. It has a series of digital and analog in- and outputs and can be programmed using a USB cable, without the need for additional programming hardware. Programming is done in a Java-like programming language. Expansion boards called "shields" can be plugged into an Arduino board, this controller is such a shield.

The DMX transmitter
The transmitter can be a hardware DMX controller, wich looks like a mixing console, or a PC and an adapter. Commercial DMX-adapters for PC's aren't cheap, but there's an alternative. DMX uses the RS485 electrical protocol. I bought a cheap USB-to-RS485 adapter, wich the DMX software recognizes as a generic controller.

The adapter I bought has an RJ45 connector (the type used for Ethernet cables). Most commercial DMX equipment uses XLR connectors, a round connector with 3 or 5 pins. For my system, I decided to use RJ45 connectors because, first of all, the adapter has an RJ45 connector, and second, it works with regular Ethernet cables instead, wich can be bought in any computer store and are much cheaper. This means, of course, this system can't be used for commercial DMX equipment, although it's possible to put an XLR plug on an Ethernet cable. This website does a good job explaining how to do this.
Besides the adapter, you also need software. There are many different programs, some of wich are free. The one I use is QLC Plus. Not only is it free, it's cross platform. It runs on Windows, Mac, Linux and Raspberry Pi. Since my PC runs Ubuntu, this was the best choice.

The DMX receiver
The receiver circuit is quite simple. It consists of only a single chip (a MAX485) and a few resistors. What the chip does is converting the signal voltage used by the RS485 protocol into a voltage the Arduino can process.

I have designed a simple prototyping shield for this. It plugs into the Arduino, and there's plenty of space on the board for creating a simple circuit. If you're interested in this board, it's for sale in my Tindie store.

You'll need the following additional components to assemble the shield
  • Arduino Duemilanove-compatible headers (2x 8-pin, 2x 6-pin). These also work on the Uno.
  • 8-pin DIL-socket
  • MAX485 RS485-decoder chip
  • 2 10k resistors
  • 2-pin header and jumper
  • 2 RJ-45 sockets
For the RJ-45 sockets, make sure they have the following footprint, or they won't fit on the board:

In the past, I have made PCB's myself, and there are lots of excellent tutorials on how to do this. However, there are so many affordable PCB manufacturers today it's hardly worth the effort anymore. Most are based in China and make double sided PCB's complete with soldering masks and silkscreens, something that's almost impossible to do at home without a big investment in equipment.
Now, the circuit may by quite simple, the firmware for the Arduino is a different story. The DMX signal enters the Arduino through its serial interface, and while the hardware is more than capable of handling the data stream, the default software library for serial connections isn't up to the task.
Luckily, I didn't need to reinvent the wheel. The people at Conceptinetics have written a custom library for handling DMX data, wich they released under the GPL license. I have written my own library on top of that, wich you can find on Github. I've also written a few demo projects, wich are demonstrated in the video below. This library is a work in progress, so check often for new versions.
One thing I have to point out is the jumper near the chip. The DMX data is fed to the Arduino through pin 0. When the firmware is running, it keeps this port busy all the time, and this causes problems when uploading programs to the board. The only way to solve this is unplugging pin 0, wich is what the jumper is for. It allows you to disconnect pin 0 without having to unplug the entire board.

A little demonstration
Finally, here's a little demonstration! I had put together a receiver board with a series of red LED's, an RGB LED and some connectors for servos. The board I used in this video was my first version, wich had a few flaws. The screw terminal connectors didn't fit, and the RJ45 connectors weren't wired properly. In the new version (the one in my Tindie store), this problem is fixed.

The main reason I put this board together was for developing my software library. In the demo video, I test controlling individual LED's, RGB LED's and servos.
So, to recap:
I'm working on lots more projects, so stay tuned for updates, and I hope it won't take so long to finish them as this one!