Friday 1 July 2022

DMX to Neopixel Arduino Shield

In a previous post (nearly a year ago!) I mentioned I was going to design an Arduino shield to allow DMX control to Neopixels.  I actually did design a board but never wrote a blog post about it.  Here is where I rectify that.


I decided to design my own DMX shield for the Arduino R3 as although there are commercial off the shelf versions available they don't have electrical isolation between the RS485 transceiver and the IO (Input Output) ports. This can be quite critical when connecting up DMX lamps as some of them are not well designed and lets just say ground loops and cheap DMX lamps becoming live when they shouldn't and releasing of magic smoke and electric shocks being a very real and present danger...don't ask me how I know... 

The circuit itself is pretty much the same as those already available.  It has opto-coupling present on the IO, the power supply and has DIP switches on board to set the DMX start address.

Here is the circuit diagram:
DMX to SPI Converter Shield

I suppose I had better explain the circuit - This is as much for me as for the casual reader...I'll be honest I haven't looked at this for a year and some decisions taken were odd to me at first...  

12 V dc input to 5 Vdc out circuit (Switch-mode)


The circuit section shows the 12 V dc input coming from the connector J1 going to C1 (100 nF) - this is a filter capacitor.  Then a DC to DC converter module is present.  Three 100 nF capacitors are then present to filter the output of the DC to DC converter.  These switching converters are known to often cause electromagnetic interference.  The capacitors are present to try to mitigate those issues.

The switching converter (PS1) used is a TRACO TEA_1-505 and it's datasheet is here: 

https://uk.farnell.com/traco-power/tea-1-0505/dc-dc-converter-5v-0-2a/dp/3465028

The next section is the opto-coupled RS485 (DMX)section:


The serial and control signals from the Arduino R3 are connected to Jumpers (JP1 to JP4).  This allows the user to isolate the connections from the serial pins of the Arduino R3 to allow for code upload and control of whether the DMX device will be active (in control of the DMX network and sending data packets) or passive (receiving Data packets).

I'm going to discuss each opto-coupler in turn to simplify things:

Resistor R1 (4.7 kΩ) is connected to output of Opto-coupler U1 and is present to current limit the signal presented to the serial input RX of the Arduino R3 (or clone).  Resistor R6 (470 Ω) is present to current limit the signal presented to the input of U1 coming from the RO output of the RS485 transceiver (U4 - MAX 481E).  


Resistor R2 (470Ω) is connected to the input of Opto-coupler U2 and is present to current limit the signal presented to the internal diode of the device.  The output is current limited by resistor R4
(4.7 kΩ) and is connected to the DE and RE (inverted) inputs of the RS485 transceiver (U4 - MAX 481E). 

Resistor R3 (470Ω) is connected to the input of Opto-coupler U2 and is present to current limit the signal presented to the internal diode of the device.  The output is current limited by resistor R5
(4.7 kΩ) and is connected to the DE and RE (inverted) inputs of the RS485 transceiver (U4 - MAX 481E). 

The Opto-Couplers are powered by 5 V dc coming from the regulated Arduino R3 supply and are isolated from the 5 V dc signal coming from the DC to DC converter 

The IO (A and B) signals of the R485 transceiver (U4 - MAX 481E) are connected to three resistors (R7 - 562 Ω, R8 - 133 Ω, and R9 - 562 Ω).  These are present to provide the 120 Ω impedance matching for the RS485 transceiver.  The input and output to the RS485 transceiver are connected to screw terminals with an isolated return (GND2).  These will connect to the signal cable used to connect this circuit to the DMX controller. 


The next section is present to allow the user to pre-set the DMX address:


The 8 way DIP switches (SW1) are connected to the Arduino R3 spare pins and 330 pull up resistors.  It is a standard way of connecting switches to microcontroller input pins.  The current presented to the microcontroller inputs when the switch is closed is 15 mA which is within the specification of the device (ATMEL 328).

The SPI output of the circuit is taken from Pin 12 of the Arduino R3 along with supply voltage and ground to a three terminal screw connector.  This is a nice robust way of connecting to off the shelf Neopixel circuits. 

The final section is the standard layout used for connecting a shield circuit board to an Arduino R3.


It saves time designing PCB layouts as all of the dimensions and connections are present and contain NET labels.

Here is the bill of materials in case it is needed:


I haven't ordered any of these parts yet but I already know that some are not in stock...the fallout from the pandemic is very real.  Some are due in next week so I can get ordering!

Here is the PCB layout: 


The 3D render is probably easier to see and understand:

The DMX to SPI Converter shield - Top Layer 

The DMX to SPI Converter shield - Bottom Layer

There isn't much to say about the PCB layout.  I've tried to make sure that all of the traces carrying high current are nice and thick. The silk screen labels are visible and it is fairly easy to populate by hand if required.  I wish I had labelled in the inputs and outputs so I know where the GND and +12 V input connections are and where the DMX and NeoPixel connections are.  There are always things I would do differently if given a chance to repeat.

I got ten boards made by PCBWay for a reasonable price and they were delivered in very short order!

Here is a picture of the unpopulated board:


My plan is to populate and test this board as soon as possible as I intend to use it in my next project - the DMX controlled patio lamp :)

That is all for now - take care always - Langster!

No comments :

Post a Comment