DMX Controlled LED Light Strip

by ctuinstra in Circuits > LEDs

2370 Views, 7 Favorites, 0 Comments

DMX Controlled LED Light Strip

IMG_7972.JPG

I was looking for a project to use left over RGB LED light strips I have laying around. I have already build some decorative LED poles and thought it might be a good idea to do the same thing only make these controllable using DMX so I can incorporate them in to the next gig my daughter and her bands plays at. Doing research, I found bits and pieces of projects like this, but nothing using an Arduino to read DMX commands and output RGB data for addressable light strips. While nothing fancy, this could be built a upon to make something really great.

This has the ability to DMX addressed all the way up to 511 and uses 3-channels (one for each color). However, modifying the code will allow it to be addressed higher or use more channels. At the moment DIP 10 is left for options.

Supplies

Nano.PNG
Channel.PNG
RGB LED.PNG
Channel1.PNG
Power connector.PNG
Single AC.PNG
XLR.PNG
  • Arduino Nano
  • DMX connectors (male and female)
  • AC cord socket
  • 5V power supply (model: PSK-20D-5)
  • Printed circuit board (files included)
  • 3D printed base (file included)
  • Aluminum LED channel (11mm x 7mm x 1m)
  • RGB LED light strip using the WS2812B controller
  • MAX485 chip
  • DMX controller hardware or software
  • Misc electronics, resistors, etc.

Many of the parts and supplies can be purchased online using your favorite retailer. The 5V power supply module was sourced from Mouser. I purchased pre-built boards that already had the MAX485 chip designed for projects and just removed the chip and installed it on my PCB. I also added a outlet socket (shown in the images) to allow for daisy chaining the power for multiple units, however, that is not necessary for the build. You must make sure to get the LED strip that has the WS2812 controller LEDs built in. This controller receives data that can be addressed to each LED and control them individually (for future or advanced use).

Circuit Design

Schematic_DMX Lights.png

I'm not an electronics engineer, so this may not be perfect, but this is the design that I came up with.

The DMX (RS485) signal has to be converted from a differential pair (+2.5v / -2.5v) to a standard serial (5v) signal. This is done with the help of the MAX485 chip. The DMX signal comes in on the A and B pins and is output on the RO (Receiver Output) line. The RE# (Receiver output Enable - #active low) line is held low to put the chip in the receiver mode. The DE (Driver output Enable, active high) is also held low to disable the Driver Output while the DI (Driver Input is not used and held high to keep from floating.

The serial DMX signal is now fed into the serial RX1 of the Nano. Using the DMXSerial and FastLED libraries in the code, this signal is decoded and then recoded for use by the WS2812B controllers built into the RGB LEDs.

While one could use a stand-alone ATmega328 microcontroller, it was just easier on the build (and probably cheaper in the end) to use the complete Nano board. Buying a clone of the Nano brings the price down to just under $10, but you may have to re-flash the bootloader. Also, the Nano only has provisions for only one use of the serial port, so you cannot have the RX line already taken by the MAX485 while programming the Nano. I added a single DIP switch to help to switch between programming and normal operation. This single DIP switch disconnects the MAX485 chip from the input RX line of the Nano and allows you to use the serial port for programming. During normal operation, the DIP switch is closed.

The R5 (120 Ohm) resistor is used for DMX termination and may not be necessary especially with short DMX cable runs or when using other lights and the last one is terminated using a terminator.

Circuit Board Design

Board Design.PNG

The board is laid out to be used in a 130mm x 130mm box to be 3D printed. It measures 128mm x 128mm. The RGB LED light pole will be mounted in the center of the box and board. The circuit board has a square cut out in the middle for the mounting of the pole. Connections of the three wires (5v, Data, GND) can be found on front and rear to allow for easy wiring depending on the orientation of the LEDs to the DMX cables. In other words, if you want the DMX cables on the same side as the LEDs or on the back. This board also uses a copper ground plane just to make it easier to connect all of the DIP switches to ground and to help reduce any noise. The incoming DMX signal will be connected to the holes 1, 2, and 3 with respect to the labeling on the DMX connector itself. If you have issues with DMX signal not being detected correctly, try swapping pins 2 and 3 of the DMX connector.

***Edit*** Originally I used a 10K ohm resistor (R3) between the MAX486 chip and pin 2 of the Nano. This killed the signal too much and I ended up removing it and just shorted across it. It still in the BOM and PickAndPlace files.


Gerber files can be found here:

https://1drv.ms/u/s!Aumwte9NHeiHgyAk7FiMLzzVIacP?e=70PO3W

Arduino Code

With the help of other's code, I was able to put together simple code to run three channels, one for Red, Blue, and Green.

DIP 10 can be used to modify and expand the code for additional channels and more advanced features. I've included, but commented out, sample code for DIP 10 that limits how many LEDs light up the pole. So basically it limits the height of the light bar. You can use this DIP to turn on or off advanced features that you design in the code.

This code relies heavily on the functions of the two libraries, DMXSerial and FastLED. DMXSerial can be found at:

 https://github.com/mathertel/DMXSerial by: mathertel

The code is pretty simple and mostly self-explanatory. Comments are added to help. In a nutshell, it reads the serial data coming in on the RX pin of the Nano and decodes the data value for each channel. Then uses these values to command the LED controller light the corresponding LED to its color and brightness.

One thing to note, you may have to change the LED_QTY value from 57 to however many LEDs you have in one strip if not all of them are lighting. If you have quite a bit less than 57, you will see a slight performance gain buy lowering this value to the actual number of LEDs.

In addition, you may have to modify the order of the colors if you are not getting the color you expect. Do this my modifying the COLOR_CODE from GRB to whatever you need.

This code could easily be modified to include white for the RGBW strips.

Building Box and Lid

DMX Box.PNG
DMX Box Lid.PNG
Power connector.PNG
FWND2SLLCNDZCSK.png
XLR.PNG

The box and lid was 3D printed. There are openings for the DIP switches to allow access from the bottom. Two holes for DMX connectors (In and Out). There is also an opening for an IEC320 C14 AC socket and a snap-in single outlet. This allows multiple units to be daisy-chained saving on power strips or extension cords. The mounting screw holes are sized for M3x10 screws with nuts. The small hole on the side is for access to the USB-C port of the Nano for future updates. The lid can be secured using M3x12 plastic screws. The lid also sandwiches the PCB.

Assembly

Assembly.jpg

Cut a strip of the RGB LED light strip to 57 LEDs. Stick them in the channel with the 57th LED close to the top and working down. This should leave a few inches of the channel without LEDs. This part will be pressed down in the center of the base of the box. Solder three wires on the strip to be fed down the center and soldered to the board.

The PCB goes in first. Then install the two XLR jacks and solder a set of wires to connect loop-through from one XLR to the other and another set of wires to go to the PCB. Both PIN1 of the XLR jacks should be connected and also the "1" of the PCB. The same goes for PIN2 and PIN3. The jacks can be secured with M3-10 screws and nuts. I used tapered head screws and they fit very flush.

Next, feed the three wires of the RGB LEDs and channel down through the center and out the square hole. It may be a very tight fit. Mine was just perfect, but the tolerances may vary from printer to printer. Make sure to get the connections correct as they are soldered to the PCB.

Next, install the IEC320 C14 AC socket with three wires connected to the terminals. Again mounting with the same M3-10 screws and nuts. Also mount the single snap-in outlet and connect all the wires. The ground will only go to the outlet. AC Line and Neutral will pass though the snap-in outlet and continue to the PCB to be soldered.

Testing and Completion

Before installing the lid, it's best to upload the code and test. Actually it would have been a good idea to test many times before this point. I tested constantly and usually had some small issue to solve, most being mistakes made during testing. It is very critical to get pins 2 and 3 correct of the DMX differential pair. I got mine turned around once during testing and spent two hours trying to figure out why a previously working circuit no longer works. I just assumed it wouldn't matter since they are a pair. Lesson learned.

Once everything is tested and working. The lid can be slid down over the top. The fit to the center section is very tight to help hold it from flexing and braking. The edges of the center stand-off may need to be filed slightly to get the lid to fit all the way down. Make sure there are no wires interfering with the screw holes.

I also snapped on a smoke cover onto the channel and topped it off with a cap that came with the channel. This cleaned it up quite a bit.

Finished and Final Thoughts

IMG 7963
IMG 7962
IMG_7967.JPG

I built four units at the same time. So having four PWBs and other parts unit bulk helped quite a bit. I've been extremely happy with the results. Originally I wanted to fill the box with clear epoxy and no lit, but I was worried about the components getting hot and not being able to cool in the epoxy. Epoxy, when cured, can be very heavy and this would give it a lot of weight to help it stand up. However, the modular power supply and all of the other components gave it enough weight that it's not a problem.

I connected all of them to my lighting controller and daisy-chained them together. They all worked very well. There is a extremely slight delay as it has to write to each LED, but it's not an issue. The only time you would notice it is during extremely fast changing of colors. I also connected my Chauvet Par 56 RGB LED unit with my built units and they played well together and the colors were spot on.

The addressing can be from 1-511. I chose not to go higher as I only have four other lights. However, a slight change in code to use DIP10 and it could be extended higher. Speaking of DIP10, at the last minute, I left some additional code in if DIP10 is set to ON. It limits the height of the light bar. When receiving the DMX signal from 0-255 (fader) and maps it to 0-57, the number of LEDs. So channel 4 could be used to create a "VU" meter effect or something. If you are good with coding, it could be changed quite a bit and more channels added for different effects. There is a lot for future available.

Now I just need my daughter to have another gig where I can bring the lights out. Enjoy!