Low cost high quality DMX multi-chain interface for RPi

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

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: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Thanks for sharing your experience.

I think schematics of the adapter would be appreciated and helpful to others
doughadfield
Posts: 30
Joined: Mon Nov 06, 2017 4:40 pm
Location: Herefordshire, UK
Real Name: Doug Hadfield

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 389 times
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Thanks.
Just found this tool to draw online schematics: https://easyeda.com/
User avatar
floEdelmann
Posts: 45
Joined: Tue Sep 20, 2016 4:47 pm
Real Name: Flo Edelmann

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?
Have a look at the Open Fixture Library! It's a project to collect fixture definitions in a unified format and make them downloadable for different lighting programs, including QLC+ 4 and QLC+ 5.
doughadfield
Posts: 30
Joined: Mon Nov 06, 2017 4:40 pm
Location: Herefordshire, UK
Real Name: Doug Hadfield

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
Kuno
Posts: 3
Joined: Wed Jan 10, 2018 5:10 am
Real Name: Hai Le

I've been observing this and wanting to try this out. Finally got place an order for the MC3487 IC.
Which Cap are you using in the diagram? - Never mind. I am blind :lol:

Thanks,
Hai
Kuno
Posts: 3
Joined: Wed Jan 10, 2018 5:10 am
Real Name: Hai Le

It's alive :D

Oh this is great. Thanks Doug and Massimo!
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi,

Thanks for this post Doug, I find it really interesting and would love to have a go at making my own version. I have very little knowledge about electrical circuits and wondered if you could help a little?

So far I have a raspberry pi 2 with QLC on it working with a cheap usb to DMX cable from amazon that emulates the anyma udmx, this is all working fine. I would love to have 4 outputs as you describe so I have ordered the mc3487ne4 chip and am waiting for it to come sometime this week. I have also ordered little kit which has a breadboard, some jumper cables and a 104pf ceramic capacitor (is this ok to use? There is also a 22pf one) amongst other things. I've never used a breadboard before but I think I have an idea how it works. My plan is to experiment with that first before soldering.

One thing I am confused about from your diagram is the 4 triangles you have used in the centre of the mc 3487 chip itself. What does the triangle symbol mean and do I have to wire anything across those pins other than the wires leading to my DMX XLR outputs? My guess from reading your post is that I dont have to and you are just illustrating the 4 different DMX outputs and where they lie on the chip.

Second question, how would you recommend I attach the capacitor? Solder it directly to the V+ and GND legs of the mc3487 chip?

Thanks for your time, also thanks to Massimo for a great program.

Phil
janosvitok
Posts: 1266
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

The triangles are symbols for operational amplifiers. The chip contains 4 of them, and each has one input, one direct output (+) and one inverted output (-). The (+) and (-) lines make differential/symmetric pair of the RS485 serial line (DMX is data protocol over RS485 line). The drawing shows how the chip is wired internally.

The bottom line is: you don't have to wire the "triangles", they are wired inside the IC.
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi. Thanks for the reply, that makes sense to me.
Toma
Posts: 2
Joined: Thu Apr 05, 2018 10:00 pm
Real Name: Thomas

Hi Dough,
Thank you very much for sharing your circuit diagram. Can you please point me to the right direction on the software, because I'm kind of new on the RPI stuff.

Are you running RASPBIAN STRETCH on your Raspberry Pi, then install QLC+ on it? Or are you using the image download after donation?

Thanks much in advance.
Thomas
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi, just wanted to say thanks, it appears to be working so far. I bought a little kit with a breadboard, jumper wires and a capacitor in it from Amazon. I'm hoping to make use of a micro switch to shutdown the pi and some leds to show power.

https://www.amazon.co.uk/gp/product/B01 ... UTF8&psc=1

This worked almost straight away, thanks for the instructions.

I then bought a prototyping board and have soldered the chip in place. Adafruit permo proto hat.

https://www.amazon.co.uk/gp/product/B01 ... UTF8&psc=1

Here is a picture so far, I now just need to design and print a little case for the project and solder on the xlrs.

Image
https://imgur.com/a/9dnTo
Toma
Posts: 2
Joined: Thu Apr 05, 2018 10:00 pm
Real Name: Thomas

Hi Phil,

So I made the decision a couple weeks ago to send a donation to download the image for Raspberry Pi, after reading Dough post about how easy it is to get this going. However, I still can't get DMX out from UART on a Raspberry Pi 3 Model B.

I got the Raspberry Pi image to boot up in the RPI successfully because I can see QLC+ is running on the screen I connect to the RPI. I can also control the Virtual Console in the QLC+ that's running on the RPI from a laptop, through ArtNet. However, no DMX through UART by using Dough's MC3487 IC circuit.

So far this project already costed me around $70 and many hours, but it's not working. Not that easy like Dough said it. :(

Do you have any tips for me to get this working?
User avatar
GGGss
Posts: 2665
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

If you can get hold of an oscilloscope then you could check the outputs ... maybe timing is drastically off beat?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi, it's hard to know where to start troubleshooting. There could be many places where there are faults. Check all your cables are good, the wiring/soldering, the chip itself could be faulty, you may have miswired something to the wrong place, is the output of qlc set to UART? These are things that spring to mind. I would try and check step by step every connection is correct.
Good luck.
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi, Ive bought a new raspberry pi 3b+ and although the image boots with qlc, I cant get the UART to output. The same sd card works fine on raspberry pi 2 with UART output. Does anyone have any ideas? I tried this:
http://www.qlcplus.org/forum/viewtopic. ... 090#p51609
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

It's probably the bluetooth interface stealing the UART port.
Can you please try this:

Code: Select all

Add the following lines to the /boot/config.txt
# UART DMX Output
dtoverlay=pi3-disable-bt
init_uart_clock=16000000
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Many thanks Massimo, that worked.
Phil Smith
Posts: 15
Joined: Wed Nov 04, 2015 10:29 pm
Real Name: Phil Smith

Hi, Ive tried to attach two pictures to shpow my completed project, thanks so much to Doug and Massimo.
IMG_20180831_221713.jpg
Attachments
IMG_20180831_221706.jpg
Post Reply