Small Arduino DMX controller

Small Arduino DMX controller

In this post we show you how to make a small and useful Arduino DMX512 controller, which can use by example to handle a smoke machine with DMX, or as test equipment, etc…

We can use Arduino Mega, Arduino UNO, and other with small changes.
Only a handful of inexpensive components are used.

In the configuration shown we have 6 channels with variable values, provided by 6 potentiometers connected to the Arduino analog inputs, 10-bit values are reduced to 8 bits (0-255 who are used by DMX), and 12 channels with on-off values with 12 push buttons connected to the digital inputs of the arduino, digital inputs are using the arduino internal pullup resistors, so if the button is pressed the input value is 0, and if it is free the input value is 1.

You need dowload and install our Arduino four universes DMX 512 library

Download project and source code Small Arduino DMX controller

Small Arduino DMX controller

Known issues:
When we compile get the error: ‘ArduinoDmxN’ was not Declared In This scope:
Check if you have configured the correct type of board in the Arduino IDE, menu tools > board
(with Arduino nano can only use one USART = ArduinoDmx0 = USART0)
Errors while programing Arduino:
Will be necessary to remove the DMX shield, and put it back once programmed.

In the following images have the wiring:

Images and drawings made with Fritzing: www.fritzing.org

Sample code to test the operation:

//*********************************************************************************************************
#include <lib_dmx.h> // libreria DMX 4 universos // four universes DMX library – www.deskontrol.net/blog
//*********************************************************************************************************
// New DMX modes *** EXPERIMENTAL ***
//*********************************************************************************************************
#define DMX512 (0) // (250 kbaud – 2 to 512 channels) Standard USITT DMX-512
#define DMX1024 (1) // (500 kbaud – 2 to 1024 channels) Completely non standard – TESTED ok
#define DMX2048 (2) // (1000 kbaud – 2 to 2048 channels) called by manufacturers DMX1000K, DMX 4x or DMX 1M ???
void setup()
{
// configurar pines arduino del 2 al 13 como entradas con pullup, (cuando se pulsa el boton = 0 si no = 1)
// configure arduino pins 2 to 13 as inputs with pullup, (button pressed = 0, button free = 1)
for (int i=2;i<=13;i++)
{
pinMode(i,INPUT); // pines como entradas
// pins as inputs
digitalWrite(i, HIGH); // activar resistencias pullup internas
// turn on pullup internal resistors
}
ArduinoDmx0.set_tx_address(1); // poner aqui la direccion de inicio de DMX
// put here DMX start address
ArduinoDmx0.set_tx_channels(100); // poner aqui el numero de canales a transmitir
// put here the number of DMX channels to transmmit
ArduinoDmx0.init_tx(DMX512); // iniciar transmision universo 0, modo estandar DMX512
// starts universe 0 as TX, standard mode DMX512
} //end setup()
void loop()
{

Leave a Comment

Your email address will not be published. Required fields are marked *