Introduction: My Halloween Light Show

Picture of My Halloween Light Show

This year for Halloween I made a light show that was synced to music. I used an Arduino that was controlled by Vixen light software. My Arduino was connected to one power switch tail and four custom relay boards I built myself. The relays controlled a few different Halloween lights.
 

Step 1: Ingredients

Picture of Ingredients

The main ingredients of the project are:
The Arduino Uno (receives serial commands from Vixen and switches relays on and off)
Vixen Light Control Software (allows me to program, control, and execute my lights) 
Custom Relay Boards (These are plugged into the Arduino and turn the lights on and off. They are soldered to extension cords.)
My Windows Computer (Runs the Vixen software. My computer also plays the music.)
Amplifier and Rock Speaker (lets people hear the music outside)
The Lights to be Controlled
 Many Other Assorted Cables

Step 2: The Elements to Be Controlled

Picture of The Elements to Be Controlled

I had five light elements connected to my Arduino via relays. 
My first element to control was a black plastic pumpkin cutout outlined with lights. 
My second element was an orange plastic pumpkin stuffed with lights. 
The third and fourth element were strands of lights outlining my house. 
My last element was a strobe/shop light. 

Step 3: How It Is Hooked Up

Picture of How It Is Hooked Up

The relay is connected to my computer inside my house via USB. The strobe light is plugged into the power switch tail which connects to my Arduino. The rest of the lights are connected to extension cords that are spliced and hooked up to custom relay boards. You can hear the music via a rock speaker that is connected to an amplifier inside. I ran my USB and speaker cable inside to connect to the amplifier and Vixen light control computer. 

Step 4: Software and Arduino Code

Picture of Software and Arduino Code

I used Vixen light control software to control the Arduino. The Arduino receives serial data from Vixen and uses a simple sketch to turn the relays on and off. I found the small sketch from the DIY Christmas Forum. Below is how I configured mine to five channels. 
#define NCH 5    // ALTER THIS: the sum of pwm and digital pins (number of channels from vixen)
#define NPWM 3 // ALTER THIS: the number of PWM pins you use
#define NDIG 2  // ALTER THIS: the number of DIGITAL pins you use...make sure NPWM+NDIG=NCH

int pins[NCH]={ 3,5,6, 2,4  }; //ALTER THIS FOR YOUR PHYSICAL PINS...pwm first then normal digital pins (set for UNO currently)
int data[NCH];   // to buffer incoming data

void setup()
{
  Serial.begin(38400);  // ALTER THIS: for various serial speeds on Vixen                   
  for (int i=0; i<NCH; i++) pinMode ( pins[i], OUTPUT ); 
}

void readSerialBuffer()  { for (int i=0; i<NCH; i++) data[i] = Serial.read(); }

void outputToPins()   {
  for (int i=0; i<NPWM; i++) analogWrite(pins[i], data[i]); // first pwm
  for (int i=NPWM; i<NCH; i++) // now digital outputs
         if (data[i]<127) digitalWrite(pins[i], LOW); else digitalWrite(pins[i], HIGH);
}

void loop()

   if (Serial.available() >= NCH) {
      readSerialBuffer();
      outputToPins();
   }
}

I had to make sure the exact numbers of channels I was going to use in Vixen is setup in the sketch. I also had to make sure that the Baud rate matched on Vixen and the Arduino sketch.  I had Vixen output to the Arduino via the Generic Serial Output. Lastly I had to make sure the serial output matched the serial port on the Arduino. 

Comments