Low cost high quality DMX multi-chain interface for RPi

All the topics related to QLC+ on the Raspberry Pi
Post Reply
doughadfield
Posts: 29
Joined: Mon Nov 06, 2017 4:40 pm
Location: Herefordshire, UK
Real Name: Doug Hadfield

Low cost high quality DMX multi-chain interface for RPi

Post by doughadfield » Tue Nov 14, 2017 9:27 am

Hi all, I'm REALLY liking the Raspberry Pi port of QLC+, as it affords so many opportunities to drive portable and static lighting rigs. I have three Pis running QLC+ now; one permanent installation in a church and two mobile, for gigging bands. For all of them I've built a very simple but extremely effective DMX interface, using the MC3487 chip. This is a quad RS485 driver chip, with TTL input. If that doesn't mean anything to you, don't worry, because you can still make the interface really easily, if you have any soldering skills at all. I'll be happy to put together a contructor's guide for anyone interested, but in the meantime here's the basics:
1. Three wires from the Pi - +5v, 0v and UART Out (these three connections are adjacent to eachother on the Pi GPIO header connector, so all you need is a 3-pin socket to plug into the pi.

2. You have four DMX driver outputs from the chip, each with DMX+, DMX- and 0v, so you can run four independent DMX cable chains. This means you can "star" connect out from the controller, to, for example, two front towers, a rear bar and a row of floor fixtures - all with separate cabling. This makes setting up and cabling so much simpler and more reliable, as a break in one chain will only affect that row of lights, with the others unaffected.

3. The driver chip gives a very high quality DMX signal - much better than the commercial USB/DMX interface I was using. With the old commercial interface, I was getting flickering on some of my cheaper fixtures. With the home-made interface, all lights are completely stable.

I attach a picture of the (not very pretty) prototype interface, which I knocked up quickly by simply soldering directly to the pins of the chip (not using a circuit board) and wrapped up in tape to prevent shorts when testing. This prototype only has two DMX connections, as it was a test. Still working fine, though ;-)
RPi DMX interface.jpg
Shout if you want details. :-)


Doug

User avatar
mcallegari
Posts: 1935
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Re: Low cost high quality DMX multi-chain interface for RPi

Post by mcallegari » Tue Nov 14, 2017 11:33 am

Thanks for sharing your experience.

I think schematics of the adapter would be appreciated and helpful to others

doughadfield
Posts: 29
Joined: Mon Nov 06, 2017 4:40 pm
Location: Herefordshire, UK
Real Name: Doug Hadfield

Re: Low cost high quality DMX multi-chain interface for RPi

Post by doughadfield » Tue Nov 14, 2017 9:37 pm

OK, here you go. I didn't have time to play with fancy drawing software, so I just made a rough hand drawing of the circuit, being as pictorial as possible. So it should be fairly easy to follow even if you don't have an electronics background.

As you can see, there's only one additional component besides the MC3487 chip, which is a decoupling capacitor soldered across the power pins of the chip (between V+ - pin 16, and V- - pin 8). This probably isn't necessary if the leads to the Pi are short, but it's always good practice with high speed driver chips like this. The value of this capacitor isn't critical; anything from 10nF to 1uF ceramic should be fine.

The chip runs from 5V, but the inputs are TTL compatible, which means anything above about 2.5V is seen as logic 1. Therefore, you can directly connect the Pi output pin (in our case the UART TX) to the chip inputs, without worrying about any kind of level shifting (doesn't work the other way round, though :-).

So then it's simply a case of making the following connections:
connect all the chip inputs together (pins 1, 7, 9 and 15) and connect those to the Pi UART TX line.
Connect the Pi +5v to the V+ of the chip, Pi GND to chip GND
Connect the two ENABLE lines on the chip (pins 4 and 12) also to V+
Now you have 4 DMX driver output pairs (DMX is a differential signal, so uses two signal lines - + and -).
Connect the + output from the chip to pin 3 of your DMX XLR female connector (the middle one in a 3-pin XLR) and the - output to pin 2.
You also want a GND line to each DMX connector (Pin 1 of each XLR), so take those from the GND from the Pi.

Each of these DMX drives will want a 120ohm terminator at the far end of the cable chain, as usual. Although the signal is so strong that you can run pretty long lines without one (I've tried it). But clearly it's much better to always use a terminator, just to prevent any intermittent wierdness during your show!

Rough drawn circuit diagram and chip data sheet attached. You can get the MC3487 chip pretty easily from many electronic component outlets, including here:
http://cpc.farnell.com/texas-instrument ... w%2Fsearch

Again, please shout if you need more info :-)

Doug
RPi DMX Interface.jpg
Attachments
MC3487P.pdf
(160.22 KiB) Downloaded 13 times

User avatar
mcallegari
Posts: 1935
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Re: Low cost high quality DMX multi-chain interface for RPi

Post by mcallegari » Wed Nov 15, 2017 10:51 am

Thanks.
Just found this tool to draw online schematics: https://easyeda.com/

User avatar
floEdelmann
Posts: 11
Joined: Tue Sep 20, 2016 4:47 pm
Real Name: Flo Edelmann

Re: Low cost high quality DMX multi-chain interface for RPi

Post by floEdelmann » Sat Nov 18, 2017 3:47 pm

Just for the record: On all four DMX ports, the same universe is outputted, right?

I actually write my Bachelor's Thesis about DMX with OLA on the Raspberry Pi and use its UART port for one DMX output. Multiple outputs using Raspberry Pi's native hardware would be awesome though, so your post interested me. However, it looks like all inputs of the driver chip are fed with the same UART signal. I guess there is no multiplexing built into the driver chip?

doughadfield
Posts: 29
Joined: Mon Nov 06, 2017 4:40 pm
Location: Herefordshire, UK
Real Name: Doug Hadfield

Re: Low cost high quality DMX multi-chain interface for RPi

Post by doughadfield » Sun Nov 19, 2017 4:23 am

Hi, yes, one single universe (with output set to UART). The single universe data stream is then split into four separate RS485 signal chains, to make cabling easier and safer.
I'm looking into multiple universes right now. The RPi only has hardware signals for a single UART, and a software uart (bit-banging) is too slow for DMX. There are solutions invloving SPI based external chips (based on PIC or atmega external microcontrollers) but the problem here is the apparent lack of kernel driver. These external microcontrollers can be accessed from user code (eg. python library) but QLC+ (actually the OLA library) needs a kernel device (/dev/ttyXXX), so we need a proper kernel driver. If anyone knows of an external microcontroller based add-on UART solution for RPi with a decent kernel driver, please shout!

The other option would be to use usb-to-serial devices (FTDI etc). These do have a kernel driver and can be accessed from QLC+ as "FTDI" devices (or whatever chipset your particular interface uses). The RPi has 4 built-in USB ports, so you could plug up to four of these USB-serial interfaces plus the UART interface. EBay has a number of bare-board USB-FTDI serial boards with TTL outputs (no rs232 or other interface in front of the serial signals) for just a quid or two. These would be ideal to place the MC3487 circuit in front of, to get up to 4 DMX chains from each universe.

Lots of potential!! :-)

Doug

Post Reply