Arduino Dmx Fade

Posted on  by 

DMX software arduino there is some code for DMX output to a digital pin, timing by assembler code, i want to test first. Setup as a new project, inside my latest menu structure, -1- select DMX slave add-2- select 4 color values and write to slave-3- fade up down DMX software processing.

Hi Guys,

  1. So the Arduino once again swaps the indication of the value, setting up the fade value back to five. This occurs more than and over again while the Directed fades in and out. When I upload and verify this program code you can find that the Directed gets brighter and dimmer over period.
  2. To do this, do the following steps: 1. Click on Add Led Strip after entering the website. Click on the added NeoPixel Strip and specify the number of LEDs and Arduino pins. Click on the Add Effect in the loop part and choose an effect. Apply your preferences in the Animation and Color sections.

i’m quite new in Arduino but getting along with it pretty well.

Currently i’m working on a simple project.

If the trigger (dry contact input) is high the lights should fade in and stay on.
if the input goes low the lights should fade out and stay out.

I’ve worked with DmxSimple to create the project. However, DmxSimple is always fading on and off.
I’m search for a solution to make one single fade(instead of on/off/on/off/on/off) after the fade the light should stay until the situation changes.

Here is my code so far, please notice this is for 2 lamps (if input is high one light should fade in and the other should fade out. If input is low then the other way around.)

/* Doloris door-fade(3x horizontal doors)
*
*

  • Function of showfile
  • input in door detects situation (open or closed)
  • When door opens full a sensor (buttonPin2) is triggered.
  • When triggered; one light will fade off and the other will turn on.
  • end *
    */

#include <DmxSimple.h>
const int buttonPin = 2;
int buttonState = 0;

void setup() {
DmxSimple.usePin(3);
DmxSimple.maxChannel(3);
Serial.begin(9600);
pinMode(buttonPin, INPUT);

}

void loop() {
buttonState = digitalRead(buttonPin);
int brightness;

if (buttonState HIGH) {
for(brightness = 0; brightness <= 255; brightness++){
DmxSimple.write(1, 50);
delay (10);
}
for(brightness = 255; brightness >= 0; brightness–) {
DmxSimple.write(2, 0);
delay(10);
}
}
else {
for(brightness = 0; brightness <= 255; brightness++){
DmxSimple.write(2, 50);
delay (10);
}
for(brightness = 255; brightness >= 0; brightness–) {
DmxSimple.write(1, 0);
delay(10);
}
}
}

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:

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. 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:

Faded

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)

  • 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)

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.

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.

Arduino Dmx Faded

  • 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?

Arduino Dmx Code

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.

Coments are closed