Arduino Dmx Fade

Permanent Redirect. Schematics and Arduino sketch download as.zip file: Video Tutorial CodeCheap WS2812 LEDs on Aliexpress:http://s.clic. The fader-per-scene is only a nice-to-have (the basic DMX controller I've designed using an Arduino does exactly that). But fading between scenes on buttons is essential. If I've read the (appalling!) manuals correctly, the QTX DM-X24 and Showtec SC-2412 both seem to offer a scene-per-fader mode so that you can set up 24 scenes and fade as many.

DMX RGB LED Fixture


Brian Neltner found me through this website and contacted me. He was in Boulder for postdoctoral work and was able to show me his cool Light Brick project. He has designed a completely open-sourced hobby high-brightness RGB LED fixture using 4 each Phillips Lumiled Rebel LEDs. His system uses a WiFi shield on an Arduino to IP-enable the fixture. I thought it might be useful to provide an open-source DMX interface for the fixture usingMax Pierson’s Arduino DMX receiverArduino Dmx Fade code (rev15).The fixture is built in a machined aluminum enclosure to match Brian's design. It contains a 24 VDC 2.5A power supply and custom hand-wired Arduino controller board. Features include:
  • 4 digit 7-segment multiplexed LED display of DMX channel or current program.
  • Unique control interface consisting of a button and potentiometer.
  • 5-channel DMX operation: mode, master intensity and 3 color channels.
  • 4 programs in addition to DMX operation: Manual color, strobe, sequential fade, random fade.
  • EEPROM storage of DMX address and program.
Please feel free to take the schematic and code (rev 1.1) for your own personal use. The controller can work with almost any LED driver as the interface is just the three TTL PWM signals. Code compiles under Arduino 0021. I used a preprogrammed Atmel ATMEGA 168 chip from Modern Device.

Operation


The fixture is mode based and may be operated from the DMX interface or through a built-in program. The mode is selected using the button.
  • DMX Operating mode: The fixture is operated using the DMX interface.
  • DMX Address mode: Allows the user to select the starting DMX address (1-506). The potentiometer is used to set the value of each address digit (ones, tens and hundreds).
  • Program 1: Allows the user to manually set the fixture color using the potentiometer.
  • Program 2: Allows the user to select a strobe speed using the potentiometer (and color selected by program 1).
  • Program 3: Allows the user to select the speed using the potentiometer for a continuous sequential fade through the color spectrum: red -> yellow -> green -> cyan -> blue -> magenta -> red.
  • Program 4: Allows the user to select the speed using the potentiometer for a random fade between various colors. The random algorithm is biased to select between moderately and fully saturated colors.

The address and current operating mode are stored in EEPROM. In addition the fixture color set while in Program 1 is stored so that it is properly recalled if the stored program is 2 (strobe).
Push Button: Selects mode.
  • Short press (less than two seconds) moves between operating modes: DMX Operation -> Program 1 -> Program 2 -> Program 3 -> Program 4 -> DMX Operation.
  • Long press (more than two seconds) in DMX Operating mode selects DMX Address mode to change the current address. A short press in DMX Address mode moves between digits to modify. A long press exits back to DMX Operating mode.
Potentiometer: Mode dependent.
  • DMX Operating mode: Unused
  • DMX Addressing mode: Sets the current digit value (ones, tens or hundreds). The digit value depends on the position of the pot. Digit values are not changed until the pot is changed.
  • Program 1: Sets the fixture color: black -> white -> red -> yellow -> green -> cyan -> blue -> magenta -> red.
  • Program 2: Sets the strobe speed: 1 - 33 flashes/second.
  • Program 3: Sets the fade speed: ~10 - 200 changes/second.
  • Program 4: Sets the fade speed: ~10 - 200 changes/second.
LED Display: Mode dependent.
  • DMX Operating mode 'Cnnn': Displays the current starting DMX channel.
  • DMX Addressing mode 'Annn': Displays the new starting DMX channel. The digit being changed blinks. Although any address 1-999 may be set in this mode, the firmware limits the maximum starting address to 506 on exit from the mode.
  • Program 1 'P 1': Indicates program 1.
  • Program 2 'P 2': Indicates program 2.
  • Program 3 'P 3': Indicates program 3.
  • Program 4 'P 4': Indicates program 4.
Channel Assignment:
  1. Mode
  2. Master Intensity
  3. Red Intensity
  4. Green Intensity
  5. Blue Intensity
Mode Values:
  • 0-63: DMX Color Control using Master, Red, Green, Blue channels.
  • 64-127: Strobe using Master, Red, Green, Blue channels. The value sets the strobe speed from 1-33 flashes/second.
  • 128-191: Sequential fade. The value sets the fade speed.
  • 192-255: Random fade. The value sets the fade speed.
Note: The DMX Channels are only used in DMX Operating Mode. Channels 1 - 4 are only used for mode values 0-127.
  1. DMX Timing seems to get a bit wonky at high addresses (close to the limit of 506). Could just be the cheap DMX console I have.
  2. Strobe timing seems to get a bit wonky at some strobe rates. I selected the strobe 'on' time to correspond with a full PWM period but not all channels (red, green and blue) seem to operate together at some strobe rates.
  3. The circuit uses a FTDI USB cable to program the processor in-circuit. The 1 kohm pull-up resistor on the nRE line disables the SN75176 driver from driving the RX line during programming.
  4. The circuit allows for bidirectional communication on DMX (e.g. RDM) although that feature is not currently supported by the software.
  5. Use common-anode LED displays. The series limiting resistors on each segment must be chosen so that the maximum current through any anode is less than 40 mA (Min resistor value is 510 ohms).
  6. Make sure to use a linear potentiometer.
  7. The Light Brick fixture can get very warm. I added some thermally conductive grease between the fixture base and the tubular enclosure to improve heat-sinking of the LEDs.

Yesterday night I hacked together a quick and dirty Arduino MIDI-to-DMX control . It’s really simple! And here’s how I did it.

Goal:

Arduino Dmx Code

I have two really cheap LED Par56 from Stairville (DMX controlled), a simple DMX-Dimmer pack and use Ableton Live for our sound setup. So all I want is to control the different colors and dimmer channels (DMX channels) with each one Midi-Note. Create el capitan usb installer. The pitch (note) shall represent the channel, the midi velocity shall represent the actual DMX-value (brightness).

DMX-protocol

Some words about the DMX protocol: This is a really simple serial protocol, the connectors are 3-pole XLR and yep – you can use normal audio XLR-cables. The devices (my LED-Par for example) are connected in a chain. Each device can have one or more channels, there are up to 255 channels per chain possible. Let’s have a look at a standard LED PAR56 channel setup:

So all we have to do is to send something from “0 to 63” to “channel 1” to set the device to RGB Mode and then the brightness value (0.255) to channel “1.3“ for the brightness of the different colors. Really easy. When you set another start address for the DMX Device, the 5 channels are shifted, e.g. to 7,8,9,10,11.

Circuit

I combined a MIDI-In Circuit with the “DMX.Simple” library. Here are the resources:
Simple DMX Code
Simple DMX Circuit

One Note: this circuit does not provide isolation. Be sure to connect all devices and the control to the same electrical loop (Phase).

Parts list: (~10€ w/o Arduino)

Arduino Dmx Decoder

  • R 100 Ohm
  • R 3,3K Ohm
  • R 220 Ohm
  • Diode 1N4148
  • Opto copler 4N28
  • Serial transmitter 75176AP
  • XLR Jack female
  • 5-Pin DIN Jack female (Midi Jack)
  • Arduino Uno (Nano, Duemilanove and all the others will probably work as well) (~30€)

You have two sections: opto copler 4N28 for handling the MIDI-In. You can probably use other types like the 4N38 as well. Secondly the DMX output section that consists of a serial converter 75176, here you could also use the standard chip MAX481 (see this tutorial)

Arduino Dmx Faded

Code

Preparation: You have to install the Simple.DMX library (howto install a Arduino library) get the library here
The code is not too nice written, but works as supposed and can be easily adapted.

MIDI-Programming

So what we have here is, that we control each of the DMX channels with one note and its velocity. We can for example set red from LED PAR1 to 255 (100%) and blue and green from LEDPAR2 to each 128 (50%). The light will cease when the Midi note-off command is sent.

Arduino Dmx Fades

In Ableton I opened up a new Midi track where I can control the lights with notes. What I did to have a hardware master fader: I added a Midi device to control the velocity of all the notes, and midi mapped it to my APC40 midi controller. Like that I additionally have a hardware master fader!

Troubleshooting & FAQ

It doesn’t work!

When you build the circuit be sure to debug one thing after the other.

  • First you can check if the MIDI-In circuit works with this little program I have written. It simply lights the status LED 13 when Midi data is coming in. When it doesn’t, you better check your input circuit or your midi device.
  • Next you can check the DMX output stage with the “Fade” sketch that came with your DMX Library. Play around with the DMX.write() commands until you see something.
  • Did you check the DMX settings of your device? Normally they can be set to “manual”, “DMX” or “Auto” Mode with little switches. The DMX starting address is also set here. Be sure to consult the manual to do it right.

What about Isolation?

This circuit doesn’t provide isolation, so be sure to connect all devices, and the control to ONLY ONE ELECTRIC LOOP (Phase). If you don’t, you can possible blow your equipment.