Blog Toni
Merino – deskontrol

Go to shop online

English

Español

Home

Arduino
projects
Small Arduino DMX controller

Small
Arduino DMX controller

Published on 10
August, 2012 by Toni Merino in Arduino projects

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

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:

Schematic Small Arduino DMX controller

Small Arduino DMX controller

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()
{
// seis entradas con potenciometros que envian valores DMX entre 0 y 255 a los canales 1 al 6
// six analog inputs with potentiometers, sending values from 0 to 255, to dmx output channels 1 to 6

ArduinoDmx0.TxBuffer[0] = scale(analogRead(0)); // copiar valor de la entrada analogica 0 al canal DMX 1
// copy value from analog input 0 to DMX channel 1
ArduinoDmx0.TxBuffer[1] = scale(analogRead(1)); // copiar valor de la entrada analogica 1 al canal DMX 2
// copy value from analog input 1 to DMX channel 2
ArduinoDmx0.TxBuffer[2] = scale(analogRead(2)); // copiar valor de la entrada analogica 2 al canal DMX 3
// copy value from analog input 2 to DMX channel 3
ArduinoDmx0.TxBuffer[3] = scale(analogRead(3)); // copiar valor de la entrada analogica 3 al canal DMX 4
// copy value from analog input 3 to DMX channel 4
ArduinoDmx0.TxBuffer[4] = scale(analogRead(4)); // copiar valor de la entrada analogica 4 al canal DMX 5
// copy value from analog input 4 to DMX channel 5
ArduinoDmx0.TxBuffer[5] = scale(analogRead(5)); // copiar valor de la entrada analogica 5 al canal DMX 6
// copy value from analog input 5 to DMX channel 6

if (digitalRead(2) == LOW) // pulsador en pin 2 apretado // push-button on pin 2, is pressed
ArduinoDmx0.TxBuffer[6] = 255; // enviar 255 al canal DMX 7 // send value 255 to DMX channel 7
else
ArduinoDmx0.TxBuffer[6] = 0; // si no enviar 0 // push-button free, send 0

if (digitalRead(3) == LOW) // pulsador en pin 3 apretado
ArduinoDmx0.TxBuffer[7] = 255; // enviar 255 al canal DMX 8
else
ArduinoDmx0.TxBuffer[7] = 0; // si no enviar 0

if (digitalRead(4) == LOW) // pulsador en pin 4 apretado
ArduinoDmx0.TxBuffer[8] = 255; // enviar 255 al canal DMX 9
else
ArduinoDmx0.TxBuffer[8] = 0; // si no enviar 0

// añadir aqui hasta el pin 13
// add here the others inputs

} //end loop()

uint8_t scale(uint16_t value) // scale values from 10 bits to 8 bits
{
if(value > 1023) // test for 10 bits limit
value = 1023;

return (value >> 2); // scale
} //end scale()

//*************************************************************************************************************

Sample code 2:

/*************************************************************************************************************
*
* Title : Controlador DMX con Arduino
* Version : v 0.1
* Last updated : 28.08.2012
* Target : Arduino mega 2560, Arduino mega 1280, Arduino UNO, Arduino nano
* Author : Toni Merino - merino.toni at gmail.com
* Web : www.deskontrol.net/blog
*
*
* Ejemplo de codigo para el mini-controlador DMX con Arduino:
* Este codigo lee los valores de 6 potenciometros conectados a 6 entradas analogicas y escribe cada valor en la salida DMX
* solo cuando se presiona el pulsador correspondiente. (canales de salida 1 al 6)
*
**************************************************************************************************************/
#include <lib_dmx.h> // libreria DMX 4 universos // deskontrol 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 ???

uint8_t buffer[6]; // buffer DMX data

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()
{
// seis entradas con potenciometros que envian valores DMX entre 0 y 255 a los canales 1 al 6, cuando se presiona el pulsador
// six analog inputs with potentiometers, sending values from 0 to 255, to dmx output channels 1 to 6, when switch is pressed

buffer[0] = scale(analogRead(0)); // copiar valor de la entrada analogica 0 al canal DMX 1
// copy value from analog input 0 to DMX channel 1
buffer[1] = scale(analogRead(1)); // copiar valor de la entrada analogica 1 al canal DMX 2
// copy value from analog input 1 to DMX channel 2
buffer[2] = scale(analogRead(2)); // copiar valor de la entrada analogica 2 al canal DMX 3
// copy value from analog input 2 to DMX channel 3
buffer[3] = scale(analogRead(3)); // copiar valor de la entrada analogica 3 al canal DMX 4
// copy value from analog input 3 to DMX channel 4
buffer[4] = scale(analogRead(4)); // copiar valor de la entrada analogica 4 al canal DMX 5
// copy value from analog input 4 to DMX channel 5
buffer[5] = scale(analogRead(5)); // copiar valor de la entrada analogica 5 al canal DMX 6
// copy value from analog input 5 to DMX channel 6

if (digitalRead(2) == LOW) // pulsador en pin 2 apretado // push-button on pin 2, is pressed
ArduinoDmx0.TxBuffer[0] = buffer[0]; // enviar valor potenciometro al canal DMX 1 // send analog value to DMX channel 1
else
ArduinoDmx0.TxBuffer[0] = 0; // si no enviar 0 // push-button free, send 0

if (digitalRead(3) == LOW) // pulsador en pin 3 apretado // push-button on pin 3, is pressed
ArduinoDmx0.TxBuffer[1] = buffer[1]; // enviar valor potenciometro al canal DMX 2 // send analog value to DMX channel 2
else
ArduinoDmx0.TxBuffer[1] = 0; // si no enviar 0 // push-button free, send 0

if (digitalRead(4) == LOW)
ArduinoDmx0.TxBuffer[2] = buffer[2];
else
ArduinoDmx0.TxBuffer[2] = 0;

if (digitalRead(5) == LOW)
ArduinoDmx0.TxBuffer[3] = buffer[3];
else
ArduinoDmx0.TxBuffer[3] = 0;

if (digitalRead(6) == LOW)
ArduinoDmx0.TxBuffer[4] = buffer[4];
else
ArduinoDmx0.TxBuffer[4] = 0;

if (digitalRead(7) == LOW)
ArduinoDmx0.TxBuffer[5] = buffer[5];
else
ArduinoDmx0.TxBuffer[5] = 0;

} //end loop()

uint8_t scale(uint16_t value) // scale values from 10 bits to 8 bits
{
if(value > 1023) // test for 10 bits limit
value = 1023;

return (value >> 2); // scale
} //end scale()

//************************************************************************************************************************

We could for example use half of buttons as flash of DMX channels, and the
other 6 as scene memories, for it we need store the DMX values in the eeprom and
recall when pressing a memory …

No doubt there are many useful options to experience each, and adapt the
software to our needs.

I hope to share your experiences.

Regards.

Tags: arduino dmx, arduino dmx controller, arduino dmx transmit, dmx controller, dmx tester, small dmx controller

« Arduino based ArtNet-Node for ...

Using Tinkerkit DMX shield wit... »

8
Comments

8 Responses

rui

18
February, 2013 at 10:56

Hi, there! I am actually trying to do what you did in this very helpful
tutorial, except that i want to be able to control the brightness of a stage
light with a pressure sensor instead of potentiometer and i will also require
it to be wireless. Was thinking of using the Xbee for the wireless portion but
i’m not so sure as i am not very good with such technology. Any tips will be
greatly appreciated. Thank you!

Reply

Ian

7
April, 2013 at 5:00

Is there a way were you have a lcd and to rotary encoders one for the
Channel and the other for the Brightness/ DMX value. It would be great for a
controller for rigging lights in the theatre.

Reply

Rodigo Pereira

14
May, 2013 at 1:20

‘”arduinoDmx0″ was not declared in this scope’
Help me

Reply

Toni Merino

16
May, 2013 at 11:13

Hi Rodrigo.

- First copy DMX_Lib to your Arduino library folder (usually
Arduino-XXXX/libraries)
- ADD include in your file:

#include <lib_dmx.h>

- Have you selected right board type?

regards

Reply

Rodrigo Pereira

21
May, 2013 at 1:35

thank you a lot! codes are working!
I now have another problem
when I open freestyler dmx, it did not find the interface …
I selected ENTTEC DMX Open…
what I should I do?

Reply

Toni Merino

28
May, 2013 at 22:36

Hi Rodrigo.
This is not an USB-DMX converter, this is a controller for
test purposes, or a base for implement your own project.

Regards.

Reply

Soren Oht

16
June, 2013 at 9:54

Hi Toni, Thanks for this interesting project,, I’m am a teacher, looking
for a student project within electronics, for the education: “event
technician” (four years education for setting up huge stages for concerts and
theater). I would like to use arduino one and a DMX shield to test lights
e.g.(http://www.martin.com/productgroup/productgroup.asp?psg=movingheads&selgroup=0).
I’m thinking of being able to control the pan/tilt functions and also the
light (dimming, colours, etc.)Could I use the “Small Arduino DMX controller
for this? Thanks – BR Soren

Reply

Toni Merino

16
June, 2013 at 16:55

Hi Soren.
Yes, is possible to use this project for this purpose, but
is best you use Arduino MEGA due to high number of inputs (16 analog inputs
for DMX faders and lots of digital inputs for push buttons). This avoid the
need of multiplexing for get more inputs. And you have extra USARTs for
other uses.

Regards.

Reply

Click
here to cancel reply.

Leave a Reply Cancel reply

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

Name *

Email *

Website

Comment

You may use these HTML
tags and attributes: <a href="" title=""> <abbr title="">
<acronym title=""> <b> <blockquote cite=""> <cite>
<code> <del datetime=""> <em> <i> <q cite="">
<strike> <strong> <pre class="">

Recent Posts

Art-Net
proxy – broadcast to unicast converter

Using
Tinkerkit DMX shield with deskontrol DMX library

Small
Arduino DMX controller

Arduino
based ArtNet-Node for led pixels

Arduino
based DMX ArtNet-Node

Dimmerino
– Part 1 – Constant voltage mode power PCB for LED strips.

Schematic
Arduino 4 universes dmx shield

Arduino
four universes DMX 512 library

Information
about SPI digital led strips

Recent Comments

Toni Merino on Arduino
based ArtNet-Node for led pixels

Toni Merino on Schematic
Arduino 4 universes dmx shield

Toni Merino on Arduino
based DMX ArtNet-Node

Toni Merino on Arduino
based DMX ArtNet-Node

Nate McGraw on Arduino
based ArtNet-Node for led pixels

Nate McGraw on Arduino
based ArtNet-Node for led pixels

rrrok on Schematic
Arduino 4 universes dmx shield

Tony on Arduino
based DMX ArtNet-Node

Tony on Arduino
based DMX ArtNet-Node

Toni Merino on Arduino
four universes DMX 512 library

Arduino Art-Net Node with MadMapper pushing pixels |
Ready.Destroy on Arduino
based ArtNet-Node for led pixels

Bernd on Arduino
four universes DMX 512 library

Toni Merino on Arduino
four universes DMX 512 library

Petar Chan on Arduino
four universes DMX 512 library

kouga001 on Arduino
based ArtNet-Node for led pixels

Publicidad

Follow us on Facebook

Nuevos productos deskontrol

LED
RF controller for RGB LED strip 12-24v 12A - 36,18 €: Controls up to
12A RGB LED strips through radio frequency remote control Up to 600 LEDs
SMD5050 RGB 12v Up to 1200 LEDs SMD5050 RGB 24v...
P3
RGB LED Display Module 192x96 mm - 168,80 €: P3 indoor Best view
distance: 3M - 60M Pixel compose: 3mm SMD2020 3 IN ONE Display color: Full
color Brightness: >=1500 Nits/square meter...
RGB
LED panel 36 LEDs SMD5050 24v 180x180mm - 27,71 €: LED panel RGB
SMD5050 36 leds DC 24v In RGB panels can display any color, intensity and
lighting effects.
RGB
digital led strip WS2812b 60 leds/m 72w - 119,19 €: Digital led
strip 5 meters, power DC5V, spi controller WS2812b. smd5050 rgb, 60 leds per
meter, addressing at led level (one at time). Controller not
included.
Switch
mode power supply 40w - 12v - 3A - 24,08 €: Switching power supply.
For LED strips, LED pixel, LED tubes. 40w - 12v - 3A...
Switch
mode power supply 240w - 24v - 10A - 52,64 €: Switching power
supply. For LED strips, LED pixel, LED tubes. 240w - 24v -
10A...
Art-Net
LED Controller for LED pixels 12 universes - 309,76 €: Up to 2040
LED pixels. Firmware Upgradeable. On the fly color reorder. Supports:TM1803,
TM1809, TM1812, WS2811, WS2812, WS1812B, UCS1903, UCS1903B, UCS1909, UCS1912,
UCS2903, UCS2909, UCS2912, LPD1883, LPD1886, WS2801, WS2803, LPD6803, LPD1101,
UCS69...
Art-Net
LED Controller for LED pixels 8 universes - 237,16 €: Up to 1360 LED
pixels. Firmware Upgradeable. On the fly color reorder. Supports:TM1803,
TM1809, TM1812, WS2811, WS2812, WS1812B, UCS1903, UCS1903B, UCS1909, UCS1912,
UCS2903, UCS2909, UCS2912, LPD1883, LPD1886, WS2801, WS2803, LPD6803, LPD1101,
UCS69...

Deskontrol new products

LED
RF controller for RGB LED strip 12-24v 12A - 36,18 €: Controls up to
12A RGB LED strips through radio frequency remote control Up to 600 LEDs
SMD5050 RGB 12v Up to 1200 LEDs SMD5050 RGB 24v...
P3
RGB LED Display Module 192x96 mm - 168,80 €: P3 indoor Best view
distance: 3M - 60M Pixel compose: 3mm SMD2020 3 IN ONE Display color: Full
color Brightness: >=1500 Nits/square meter...
RGB
LED panel 36 LEDs SMD5050 24v 180x180mm - 27,71 €: LED panel RGB
SMD5050 36 leds DC 24v In RGB panels can display any color, intensity and
lighting effects.
RGB
digital led strip WS2812b 60 leds/m 72w - 119,19 €: Digital led
strip 5 meters, power DC5V, spi controller WS2812b. smd5050 rgb, 60 leds per
meter, addressing at led level (one at time). Controller not
included.
Switch
mode power supply 40w - 12v - 3A - 24,08 €: Switching power supply.
For LED strips, LED pixel, LED tubes. 40w - 12v - 3A...
Switch
mode power supply 240w - 24v - 10A - 52,64 €: Switching power
supply. For LED strips, LED pixel, LED tubes. 240w - 24v -
10A...
Art-Net
LED Controller for LED pixels 12 universes - 309,76 €: Up to 2040
LED pixels. Firmware Upgradeable. On the fly color reorder. Supports:TM1803,
TM1809, TM1812, WS2811, WS2812, WS1812B, UCS1903, UCS1903B, UCS1909, UCS1912,
UCS2903, UCS2909, UCS2912, LPD1883, LPD1886, WS2801, WS2803, LPD6803, LPD1101,
UCS69...
Art-Net
LED Controller for LED pixels 8 universes - 237,16 €: Up to 1360 LED
pixels. Firmware Upgradeable. On the fly color reorder. Supports:TM1803,
TM1809, TM1812, WS2811, WS2812, WS1812B, UCS1903, UCS1903B, UCS1909, UCS1912,
UCS2903, UCS2909, UCS2912, LPD1883, LPD1886, WS2801, WS2803, LPD6803, LPD1101,
UCS69...

Webs

DIY Led Table, Author: AVE

Dmx ArtNet node in Portuguese, thanks to A. Caneira

OLA open-lighting project

Archives

April 2013

January 2013

August 2012

July 2012

June 2012

Tags

4 universes
arduino dmx arduino 4 inputs
dmx arduino
4 outputs dmx arduino art-net
arduino
art-net node arduino
art-net to dmx arduino artnet arduino
artnet dmx arduino artnet
node arduino
dmx arduino
dmx circuit arduino dmx
controller arduino
four universes dmx shield art-net art-net
gateway art-net node artnet
artnet
node dimerino
dimmer
arduino dimmerino dimmerino
part 1 dimmer
led arduino dimmer schematic
dimming
led arduino diy led dimmer dmx
4 universes dmx 512 dmx
four universes dmx mixer dmx
schematic information
spi led strip led dimmer
circuit library
arduino 4 universes dmx library arduino
dmx modular
dimmer receive
dmx arduino schematic
4 universes dmx shield schematic dmx
shield schematic
dmx shield arduino spi led spi
led datasheet spi led strip tlc5940
arduino transmit
dmx arduino

Go
to shop online

English

Español

© Blog Toni Merino -
deskontrol