03 September 2017

Arduino based DMX device for controlling NeoPixel and WS2811

In the DMXSerial library examples folder you now can find a sketch for receiving DMX with an Arduino and send the received data to a series of NeoPixel or WS2811 LEDs. Just load the DMXSerial library version 1.4 using the library manager of the Arduino environment of download DMXLibrary from Github.

The challenge for this sketch was the fact the both protocols, DMX and WS2811, are time critical and that the standard Arduino Uno processor doesn’t have the power to do both protocols at the same time.

The solution for this is another DMX mode in the DMXSerial implementation that allows to stop the DMX protocol while sending out the data to the NeoPixels.

DMXProbe mode

This mode is starting the Arduino in DMX receiving state, but doesn’t actively listen for incoming data. No interrupts are enabled and any incoming data packet will stick in the serial receiver.

To receive data the receive() function must be called. This function clears all hardware buffers and waits for an incoming data package by using the same mechanism as the DMXReceiver mode. After receiving a package this function returns with true and data can be found in the internal buffer.

When no DMX data was received in the specified time the receive function will return false.

The DmxSerialNeoPixels example

This example contains a sketch for receiving DMX data with an Arduino and send the received values to a series of NeoPixel or WS2811 LEDs.

The NeoPixel sending routine is based on the work of bigjosh2 from his positing on his web site:

The DMXSerial library is not yet published as a new version to the Arduino community. I just like to push it out to all of you working with time critical implementations as an added value and check for problems during the next days.