The Party Starter

by Grissini in Circuits > Arduino

12863 Views, 77 Favorites, 0 Comments

The Party Starter

Party Ball Main.jpg
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!

Parts & Tools

IMG_0360.JPG
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
Arduino Uno
Adafruit Wave Shield 
Continuous Rotation Servo
Battery Pack of your choice or Wall Wart
Tools
Arduino IDE (I'm still rocking 21)
Solder Iron
Dremel
Glue Gun
Gloves/Face Mask/Eye Protection

 

Underpainting the Ball

IMG_0363.JPG
IMG_0362.JPG
IMG_0366.JPG
IMG_0369.JPG
IMG_0367.JPG
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. 

Add the Mirrors

IMG_0370.JPG
IMG_0371.JPG
IMG_0372.JPG
IMG_0374.JPG
IMG_0375.JPG
IMG_0376.JPG
IMG_0411.JPG
IMG_0413.JPG
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.  

Finish the Ball

IMG_0414.JPG
IMG_0415.JPG
IMG_0417.JPG
IMG_0418.JPG
IMG_0419.JPG
IMG_0420.JPG
IMG_0421.JPG
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.  

Make the Base

IMG_0423.JPG
IMG_0424.JPG
IMG_0425.JPG
IMG_0426.JPG
IMG_0427.JPG
IMG_0428.JPG
IMG_0429.JPG
IMG_0430.JPG
IMG_0432.JPG
IMG_0444.JPG
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. 

Wiring

IMG_0470.JPG
IMG_0471.JPG
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.  

Upload the Code

arduino_logo.png
#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();
}

All Done!

IMG_0468.JPG
IMG_0457.JPG
IMG_0465.JPG
Now go around and start a party.  

In your workshop


In the car