Using dmx 512 (Hardware) controller for WS2811 pixel leds

Hello guy's I am a light engineer and
I want to control ws2811 pixel led with dmx 512 (Hardware not software) controller
how I can do that using Aurdino nano and MAX485 for controlling colors , strobe and some animation so that
i can control other led fixtures like par light and some moving heads with pixel leds in a same way

Anyone can help me for this ?

Some considerations:

  1. According to https://community.element14.com/technologies/open-source-hardware/b/blog/posts/dmx-explained-dmx512-and-rs-485-protocol-detail-for-lighting-applications, the baud rate is 250000 baud. For that you will need to use a hardware serial port. The classic Nano has one hardware serial port and it's also used for communication with the PC (e.g. uploads, debugging, communication with user if needed). Therefore you might be better off with an other board (e.g. nano every, micro, pro micro, mega).
  2. Take into account the the amount of memory needed for your LED strips; I do not know anything about DMX512 but if you want to store a pattern for 500 leds, it will require 1500 bytes of RAM; this will get you to the limits of the Nano.
  3. There is a DMXserial library: DMXSerial - Arduino Reference
  4. If you do a web search for Arduino dmx512 you might find additional information or people who have worked with it; e.g. Arduino as a DMX controller?

Hello,

i exactly do it with a NANO (ATMEGA328).

i receive some DMX channel (65 channels), extract data from it, and light 4 groups of 100 NEOPIXELS + UV led with PWM.

The first try was not good, NEOPIXEL randomly blink a lot in despite of stable DMX values.
Solution is to insert counter to enter the neopixel sometime. When in neopixel write, DMX receive interruption is stopped, and restarted after pixel.show() instruction.

Mine works fine, my code below:

#include <Adafruit_NeoPixel.h>    // Invoquation de la librairie des rubans de LED
#include <DMXSerial.h>            // Invoquation de la librairie de protocole DMX
Adafruit_NeoPixel pixels(404, 13, NEO_GRB + NEO_KHZ800);  //404 LED = 400 du panneau + les 4 premières en face avant 

// -------------- DEFINE -----------------

int RED1, GREEN1, BLUE1;
int RED2, GREEN2, BLUE2;
int RED3, GREEN3, BLUE3;
int RED4, GREEN4, BLUE4;
int DIMMER1, DIMMER2, DIMMER3, DIMMER4;
int UV;
int i;
word COUNT;
const int startChannel = 1;

void setup() {
  pixels.begin();
  DMXSerial.init(DMXReceiver);
  pinMode(9, OUTPUT);  // Sortie canal UV en PWM
}

void loop() {
  // Lire les données du bus DMX

    DIMMER1 = DMXSerial.read(1);
    RED1 = DMXSerial.read(2);
    GREEN1 = DMXSerial.read(3);
    BLUE1 = DMXSerial.read(4);

    DIMMER2 = DMXSerial.read(17);
    RED2 = DMXSerial.read(18);
    GREEN2 = DMXSerial.read(19);
    BLUE2 = DMXSerial.read(20);
    
    DIMMER3 = DMXSerial.read(33);
    RED3 = DMXSerial.read(34);
    GREEN3 = DMXSerial.read(35);
    BLUE3 = DMXSerial.read(36);    
    
    DIMMER4 = DMXSerial.read(49);
    RED4 = DMXSerial.read(50);
    GREEN4 = DMXSerial.read(51);
    BLUE4 = DMXSerial.read(52);    
    
    UV = DMXSerial.read(65); 
    COUNT++;
    
if(COUNT>=5000)
    {
    COUNT=0; 
    UCSR0B &= ~_BV(RXCIE0);  // Désactive les interruptions de réception pour l'UART0

    // Application de la contrainte de DIMMER  
    RED1 = constrain(RED1, 0, DIMMER1);  
    GREEN1 = constrain(GREEN1, 0, DIMMER1);
    BLUE1 = constrain(BLUE1, 0, DIMMER1);

    RED2 = constrain(RED2, 0, DIMMER2);  
    GREEN2 = constrain(GREEN2, 0, DIMMER2);
    BLUE2 = constrain(BLUE2, 0, DIMMER2);

    RED3 = constrain(RED3, 0, DIMMER3);  
    GREEN3 = constrain(GREEN3, 0, DIMMER3);
    BLUE3 = constrain(BLUE3, 0, DIMMER3);

    RED4 = constrain(RED4, 0, DIMMER4);  
    GREEN4 = constrain(GREEN4, 0, DIMMER4);
    BLUE4 = constrain(BLUE4, 0, DIMMER4);

    analogWrite(9, UV);

for (i = 4; i<=103; i++)               // écriture des barres 1&2
    {
    pixels.setPixelColor(i, pixels.Color(RED1,GREEN1,BLUE1));
    }
    pixels.setPixelColor(0, pixels.Color(RED1/4,GREEN1/4,BLUE1/4));
    
for (i = 104; i<=203; i++)             // écriture des barres 3&4
    {
    pixels.setPixelColor(i, pixels.Color(RED2,GREEN2,BLUE2));
    }
    pixels.setPixelColor(1, pixels.Color(RED2/4,GREEN2/4,BLUE2/4));

for (i = 204; i<=303; i++)            // écriture des barres 5&6
    {
    pixels.setPixelColor(i, pixels.Color(RED3,GREEN3,BLUE3));
    }
    pixels.setPixelColor(2, pixels.Color(RED3/4,GREEN3/4,BLUE3/4));

for (i = 304; i<=403; i++)            // écriture des barres 7&8
    {
    pixels.setPixelColor(i, pixels.Color(RED4,GREEN4,BLUE4));
    }
    pixels.setPixelColor(3, pixels.Color(RED4/4,GREEN4/4,BLUE4/4));

    pixels.show();

    // Réactiver les interruptions de réception UART
    UCSR0B |= _BV(RXCIE0);  // Réactive les interruptions de réception pour l'UART0

    }
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.