Introduction: The Party Starter

About: I make projects, they have names. Some are obscure and some straightforward. Form or Function; I go either way. Battery powered or edible, I love making things.
A desktop motorized musical disco ball.  Great for holiday parties, impromptu dance-offs, and Tuesday afternoons.   Bling, Music, Arduino, and glitter covered styrofoam; this Instructable has got what you need to get your boogie on.  Fires need help go get going, so do parties.   I recently moved from Hartford where my boys @HPSU(http://hartfordpartystarters.org/) would get it started every week.  Now I live in boring Indiana, where there are no parties(Save church socials).  With that in mind and the Party Season upon us, Lets make.  

I have a glitch in the code, so it stutters every once in a while.  No biggy for me,  I'll fix it later.   I also would have showed myself dancing and partying in the video, but my clothes are matte and boring.  



More videos on the last step!

Step 1: Parts & Tools

Craft Parts
6" Styrofoam sphere
"8x4x2 Styrofoam block (Not Pictured)
Alot of 1" mirror pieces
Quite a few .25" mirror pieces
Krylon Glitter Paint-Get the big can
Adhesive/glue/epoxy of choice-Hot glue worked the best for me(after trying others)
Velco Pads
Electronic Parts
Tools
Arduino IDE (I'm still rocking 21)
Solder Iron
Dremel
Glue Gun
Gloves/Face Mask/Eye Protection

Step 2: Underpainting the Ball

I wanted a base coat of reflective, shiny material so that anyplace where mirrors aren't has some reflective quality.  This ball used almost this entire mini can of spray paint.  The holder for the ball was quickly made by twisting some coat hanger wire into a shape that'd hold the ball off the ground. 

Step 3: Add the Mirrors

Start with the center line and work your way out.  Dab a bit of glue and place the tiles.  Don't worry too much about gaps, we are attaching square tiles to a circle after all.  That's why we painted it with sparkle paint.  
I had to take a break for the night after the top section was completed.  The glue I was using took FOREVER to dry.  The next day I switch to the ol' hot glue gun.  

Step 4: Finish the Ball

Now that the mirrors are all set,  We've got to use a clever way to attach it to the servo.   Velcro will be our mating material.  I don't want to ruin a servo and it'll be handy for transportation to be able to remove the ball.  

Step 5: Make the Base

Start by marking off where you want the components to go on the foam block
Like all cutting, measure twice and cut once.  
I used a Dremel to remove unwanted foam.  There are foamcutters, you could use a lighter, smash and tear at it.  Whatever your method, know that the servo must be tight so that all the torque and power is transferred to the party ball.   Also dremeling this foam turned it into a fake snow like substance, Lots of Fun, bad for the lungs-WEAR PROTECTION.
Go around, add a ton mirrors.  Try not to burn yourself on the glue or cut yourself on the glass. 

Step 6: Wiring

The servo is the only thing to wire up here.  5Volt, Ground and the signal wire(white) to pin9.  I've left room for LED's, Lasers, Buttons, etc. Add what ever you want.  Throw another servo on there and make a laser turret.  This is how I wanted mine, make your how you want it.  
We are not using the servo library in the Arduino code because it was being fussy with the other libraries.  I don't know why, but I just worked around it.  We are using a servo and not a different motor because of the ease that a servo will mount and attach.  

Step 7: Upload the Code

#include <AF_Wave.h>
#include <avr/pgmspace.h>
#include "util.h"
#include "wave.h"

AF_Wave card;
File f;
Wavefile wave;      // only one!



uint16_t samplerate;

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Wave test!");

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);

  pinMode(9, OUTPUT);

  if (!card.init_card()) {
    putstring_nl("Card init. failed!"); return;
  }
  if (!card.open_partition()) {
    putstring_nl("No partition!"); return;
  }
  if (!card.open_filesys()) {
    putstring_nl("Couldn't open filesys"); return;
  }

if (!card.open_rootdir()) {
    putstring_nl("Couldn't open dir"); return;
  }

  putstring_nl("Files found:");
  ls();
}

void ls() {
  char name[13];
  int ret;

  card.reset_dir();
  putstring_nl("Files found:");
  while (1) {
    ret = card.get_next_name_in_dir(name);
    if (!ret) {
       card.reset_dir();
       return;
    }
    Serial.println(name);
  }
}

uint8_t tracknum = 0;

void loop() {


   uint8_t i, r;
   char c, name[15];


   card.reset_dir();
   // scroll through the files in the directory
   for (i=0; i<tracknum+1; i++) {
     r = card.get_next_name_in_dir(name);
     if (!r) {
       // ran out of tracks! start over
       tracknum = 0;
       return;
     }
   }
   putstring("\n\rPlaying "); Serial.print(name);
   // reset the directory so we can find the file
   card.reset_dir();
   playcomplete(name);
   tracknum++;
}

void playcomplete(char *name) {
  uint16_t potval;
  uint32_t newsamplerate;

  playfile(name);
  samplerate = wave.dwSamplesPerSec;
  while (wave.isplaying) {    

   digitalWrite(9, HIGH); 
  delay(1);            
  digitalWrite(9, LOW);  
  delay(1);  
// you can do stuff here!
delay(50);
   }
  card.close_file(f);
}

void playfile(char *name) {
   f = card.open_file(name);
   if (!f) {
      putstring_nl(" Couldn't open file"); return;
   }
   if (!wave.create(f)) {
     putstring_nl(" Not a valid WAV"); return;
   }
   // ok time to play!
   wave.play();
}

Step 8: All Done!

Now go around and start a party.  

In your workshop


In the car

Arduino Challenge

Participated in the
Arduino Challenge

ShopBot Challenge

Participated in the
ShopBot Challenge

Holiday Gifts Challenge

Participated in the
Holiday Gifts Challenge