Software controlled lighting

a USB Serial to DMX adapter

dmxTeensyAdapter

Materials used: 

  • 1 x Teensy 2.0
  • 1 x RS485 Transceiver (LTC1485)  
  • 1 x 3-pin XLR connector (NC3FAH1)  
  • 1 x 100 ohm resistor
  • 2 x 12-position 0.1″ headers  
  • 1 x Mini USB cable
  • 1 x PCB using OSH Park 

Step 1: Make some PCBs!

Download the board design files (“Gerber files”) and use them to order PCBs from the amazing OSH Park.

Step 2: Solder those PCBs

Solder up some boards, inhale fumes, and get a buzz..

If you don’t already own a soldering iron, may I suggest the most excellent Hakko FX-901 

Hakko-FX-902-Cordless-Soldering-Iron

Step 3: Program the Teensy

Use Arduino with the Teensyduino extension to program this code onto your Teensy 2.0

#include <DmxSimple.h>

void setup() {
  Serial.begin(115200);
  Serial.println("SerialToDmx ready");
  Serial.println();
  Serial.println("Syntax:");
  Serial.println(" 123c : use DMX channel 123");
  Serial.println(" 45w  : set current channel to value 45");
  
  DmxSimple.usePin(0);
}

int value = 0;
int channel;

void loop() {
  int c;

  while(!Serial.available());
  c = Serial.read();
  if ((c>='0') && (c<='9')) {
    value = 10*value + c - '0';
  } else {
    if (c=='c') 
      channel = value;
    else if (c=='w') {
      DmxSimple.write(channel, value);
      Serial.print("channel:");
      Serial.println(channel);
      Serial.print(" value:");
      Serial.println(value);
    }
    value = 0;
  }
}

Step 4: Enjoy your DMX adapter

The adapter receives commands in the following format:

ex:  123c 45w

This example sets channel 123 to value 45.