My sister was turning 40, and my other sister wanted to throw her a party (they share the same birthday, 2 years apart, so she was sort of throwing herself a party too..) It was decided that her and my wife would make a birthday cake, the brief was "Disco and Peacocks". While they were discussing decorations and disco balls, I said "we could do a light-up style dancefloor on the top tier..." and so began the mission. This was decided at late notice, so I had a deadline of one week to get the dancefloor built so that the cake could be constructed around it.

Because of the short notice, I could only use stuff I had on hand, but luckily I have a lot of junk laying around. The dancefloor itself would be 3d printed in white PLA, and the lighting would come from WS2812 LED strips, with an arduino pro-mini making the lights blink.

I measured my WS2812 strips, and designed the dancefloor in freeCAD.

I probably should have measured the bed of my 3D printer, because this took up every mm of space, any bigger and I would hav had to modify my printer a bit. The print actually failed overnight, but I couldn't spend the time to print another, so the channels to hold the strips were never completed. After cutting and laying out the LEDs in strips of 10, I soldered them up and hot-glued them into place on the plastic floor.

It was about this point that I realized I wanted to have a disco ball rotating above the floor as well. I modded a cheap micro servo for continuous rotation, and printed a mount to hold it under the dancefloor. A hole was drilled throught the floor to allow an acrylic rod to pass through, the rod was connected to the servo gear by a piece of vinyl tube.

The servo mount was designed with slots for screws, but when it came time to put it together I was too lazy to find screws and just hotglued it all together.

The code was based on the demo from adafruit's neoMatrix library, and just cycles through each effect function. The effects themselves operate one frame at a time and return a time when the next frame should trigger, this let me define severaleffects that run at different speeds.

Now that the functionality was there, I added in a couple of details. I didn't want to have a visible switch on the cake, so I put a small reed switch on one side of the floor and connected it to one of the arduino pins, this let me set the cake up and then pop a magnet on top to switch off all the leds and the motor, minimizing battery draw. Because I would be running this from a LiPo battery, I didn't want it draining my battery to the point of destruction, so I made a quick voltage divider and connected that to one of the arduinos analog pins, and switched the code to run some predefined "low battery" effects so I knew to disconnect the battery. As it was, the battery lasted all night and I never got to see the low battery warning.

After that, an 8 inch styrofoam cake blank was hollowed out to hold eveything and I passed it over to my wife who actually did the "cake stuff" to finish it off. In the end, my sister was pretty happy with her cake and I've decided that cake decorating is Way Too Hard.

Parts list

Arduino pro mini eBay

Adjustable power regulator eBay

WS2812 LED strip eBay

Reed Switch eBay

Turnigy Micro Servo Hobbyking

Turnigy 2650mAh 2s Battery Hobbyking

Acrylic rod, local hobby store

Mini Disco Ball, local $2 shop

a couple of resistors to make a voltage divider

PLA plastic filament