Wedding Cake Topper

IMG_3316.JPG

This cake topper was done for some good friends of mine.  The sculpture was an image imported into fusion 360 and traced out for a simple extrude. The cake topper is a sculpture lit by LEDs in the base.

I really wanted the matte/layered look of a nylon sintered 3d print so I had the model made at Shapeways after a test print on my personal printer.

testprint
A test print of the wedding cake topper

Electronics

The internals are an arduino and a credit card sized power bank.  The power bank has a capacity of 1,650 mAh.  I desoldered the blue LED indicators on the battery bank PCB so they wouldn’t interfere with the actual LEDs.

The LEDs can draw up to 960mA (60 mA per LED * 8 per bar * 2 bars).  With a 1,650mAh capacity, worst case the battery should last 1.7 hours.  Turns out the LEDs are about two times brighter than necessary so the overall battery life is about four hours.

I soldered some wires to the large USB type A output to power the arduino.  The LED bars get power and data from the arduino.  The battery can be charged using a standard USB micro cable.

finalelectronics
Inner electronics with spacer between the battery and electronics

Software

I used the Neopixel library from Adafruit to handle all the communications.  I wanted the pixels to walk the color wheel (on opposite ends) and fade to white in the center.  The bulk of the work is done by two state machines, and the results are copied to the other LEDs.

//Advances the colorWheel
void advanceColor(struct colorWheel * cw){
  switch (cw->state) {
    case RED_TO_BLUE:
    //color fading from red to blue
      cw->rgbLED.r = cw->rgbLED.r - 1;
      cw->rgbLED.b = cw->rgbLED.b + 1;
      if(cw->rgbLED.r == 0){
        //change to blue to green
        cw->rgbLED.b = 255;
        cw->state = BLUE_TO_GREEN;
      }
      break;
    case BLUE_TO_GREEN:
    //color fading from blue to green
      cw->rgbLED.b = cw->rgbLED.b - 1;
      cw->rgbLED.g  = cw->rgbLED.g  + 1;
      if(cw->rgbLED.b == 0){
        //chnage to green to red
        cw->rgbLED.g = 255;
        cw->state = GREEN_TO_RED;
      }
      break;
    case GREEN_TO_RED:
    //color fading from green to red
      cw->rgbLED.g  = cw->rgbLED.g  - 1;
      cw->rgbLED.r = cw->rgbLED.r + 1;
      if(cw->rgbLED.g  == 0){
        //change to red to blue
        cw->rgbLED.r = 255;
        cw->state = RED_TO_BLUE;
      }
      break;
  }
}

At first I had the colors fade to white in the center, but it looked better to have the outer two LEDs the same and the middle LEDs white.

After the code was finished I cleaned up the wiring a bit and drew up/printed a carrying case for the trip to Colorado.

topper_2016-dec-06_12-11-52am-000_customizedview16222710592
Exploded view of the cake topper with carrying case

Source code and solid files can be found on my github

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s