Introduction: Arduino Powered Party Shirt

About: I am a former English teacher turned Interactive Media Instructor turned STEM teacher turned computer science teacher. I like to make, fix, and take apart. Few things are more fun than taking something apart t…
This idea began years ago after my purchase of the soundtrack shirt from thinkgeek. It was an awesome shirt, but as is my nature I thought of some improvements. Specifically lights that pulse and blink to the music. After many failed attempts the party shirt was born. This shirt was possible through the help of akcarl's Beat Sync instructable.

Step 1: Parts and Tools

Tools
Soldering iron
Helping hands
Wire cutters
Tweezers
Soldering tools
Scissors
Wire stripper
Large sewing needle
Glue gun

Parts
1 - arduino uno
8 - leds (color optional)
1 - spool of wire
1- case for arduino
1 - circular lid
1 - speaker (from old answering machine)
1 - breadboard (optional, for testing your circuit)
1 - 3.5mm to 2xRCA (could be changed out for any other cord of similar function)
1 - spool of solder
1 - t-shirt
5 - zip ties
1 - Spade terminal connector
1 - Male terminal connector
1 - Spool of waxed thread

Step 2: Get the Code

This code uses the Fast Fourier Transformer library. The library can be found here. The code I used for my shirt can be found here.

I have also posted the code below, but I suggest you visit akcarl's instructable.

////  Beat Sync//  A music visualization device.//  Created by//  Carl Smith//  penguinmagic@hotmail.com//

#include <fix_fft.h>

int led[] = {5,6,7,8,9,10,11,12};

int x = 0;

char im[128], data[128];

char data_avgs[14];

int i=0,val;

#define AUDIOPIN 3

voidsetup()
{
  for (int i = 0; i <8; i++)
  {
    pinMode(led[i], OUTPUT);
  }
  Serial.begin(9600);

}

voidloop()
{
  for (i=0; i < 128; i++){                                   
    val = analogRead(AUDIOPIN);                                  
    data[i] = val;                                     
    im[i] = 0;                                                   
  };

  fix_fft(data,im,7,0);

  for (i=0; i< 64;i++){                                    
    data[i] = sqrt(data[i] * data[i] + im[i] * im[i]);  // this gets the absolute value of the values in the//array, so we're only dealing with positive numbers
  };   

  
  // average bars togetherfor (i=0; i<14; i++) {
    data_avgs[i] = data[i*4] + data[i*4 + 1] + data[i*4 + 2] + data[i*4 + 3];   // average together
  
    data_avgs[i] = map(data_avgs[i], 0, 30, 0, 9);                              // remap values for LoL
  }
  int value = data_avgs[0];//0 for bass
  ledArray(value);
}
void ledArray(int input)
{
  //if (input > 8)
  {
     for (int i = 0; i <8; i++)
     {
       digitalWrite(led[i], HIGH);
     }
  }
  elseif (input > 7)
  {
     for (int i = 0; i <7; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 7; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 6)
  {
     for (int i = 0; i <6; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 6; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 5)
  {
     for (int i = 0; i <5; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 5; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 4)
  {
     for (int i = 0; i <4; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 4; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 3)
  {
     for (int i = 0; i <3; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 3; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 2)
  {
     for (int i = 0; i <2; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 2; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  elseif (input > 1)
  {
     for (int i = 0; i <1; i++)
     {
       digitalWrite(led[i], HIGH);
     }
     for (int i = 1; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
  else
  {
    for (int i = 0; i <8; i++)
     {
       digitalWrite(led[i], LOW);
     }
  }
}

Step 3: Test Circuit

If you are experienced with circuits then you can skip this part.

This instructable guided the creation of my circuit. I have also made available the fritzing file if you want to play around with the circuit.

The ground from the arduino should be connected to the cathode leg of all the leds. The anode leg of each led will connect to a different digital output. The audio source's ground connects to the ground input on the arduino and the left or right channel connects to the analog input, A3, on the arduino.

The ground of the speaker goes to the ground of the av wire, the outside ring. The positive of the speaker goes to the positive of the av wire, the inside post.

Once you have everything hooked up plug it all in and test the circuit. The lights should blink in time with the music.

Step 4: Assemble Chest Piece

I selected a round coffee can lid to be the base for my chest piece. You can pick any shape you want. Layout where you want everything to go before you do anything permanent. Mark where you want everything to go.

Caution: The next step should be followed with care. Glue guns are hot and can burn you. Kids get an adult to help you. 
I made holes in the coffee lid using a hot glue gun. The glue gun melted holes just the right size for my speaker wires and leds. I then used the glue gun to glue the speaker. Before gluing in the leds I bent the legs. I bent the cathode leg of the leds 900 at the led. I bent  the anode leg 90at the led and then 90o up halfway down the leg.

 Caution: The next step should be followed with care. Soldering irons are hot and can burn you. Kids get an adult to help you.
The ground from the arduino should be soldered to the cathode leg of all the leds. The anode leg of each led will be soldered to a different digital output. The audio source's ground solders to the ground input on the arduino and the left or right channel solders to the analog input, A3, on the arduino.

The ground of the speaker solders to the ground of the av wire, the outside ring. The positive of the speaker solders to the signal of the av wire, the inside post. I did not want to cut up my cable so I used some terminal connectors for this part. I used the spade terminal to connect to the ground of the audio source. You may not be able to do this if your av cable is different. I used the male terminal to connect to the signal of the audio source because it fit fairly snugly over the wire. I then soldered those together. 

After you are done test the chest piece.

Step 5: Attach to Shirt

I had an instructables shirt and thought it would be perfect for this project. I made holes in the outer rim of the chest piece for the waxed thread to go through. I placed the chest piece where I wanted it and cut a hole for the wires to go through. The wires were many and slightly unruly so I used several zip ties to keep them in check. 

Then I used the waxed thread and a thick needle to attach it to the shirt. I have an old camera pouch with a belt loop that I put the arduino in. 

Step 6: Party!

Now you can wear your shirt out to your next party.



The shirt works great. I wore it to two parties and it worked fine the entire time. It was comfortable to wear and the electronics were not too obvious. In my next build I will minimize some of the electronics.
Make It Glow Contest

Participated in the
Make It Glow Contest

Supercharged Contest

Participated in the
Supercharged Contest

Hardware Hacking

Participated in the
Hardware Hacking