DIY 3D LED Cube With a Raspberry Pi

by tmckay1.jackson in Circuits > Raspberry Pi

7279 Views, 32 Favorites, 0 Comments

DIY 3D LED Cube With a Raspberry Pi

HOW TO MAKE AN LED CUBE: Making a WS2812b LED Cube with Animations | Raspberry Pi Projects
bloom.jpg
rain.jpg

This project goes over how we made a DIY 3D LED Cube from ws2812b LEDs. The cube is 8x8x8 of LEDs, so 512 total, and the layers are made of acrylic sheets we got from home depot. The animations are powered by a raspberry pi and a 5V power source. The cube is a great piece to show off to friends and can act as a lamp. Ours is a little too big for a lamp (2ft x 2ft x 2ft), but you can scale this down to fit your needs.

Supplies

  1. ws2812b LED Bulbs - https://amzn.to/370NCK7
  2. 5V Power Supply - https://amzn.to/36VDylP
  3. Raspberry pi 3b I used (can use any) - https://amzn.to/36VDylP
  4. SN74HCT125 Integrated Circuit - jumps voltage from raspberry pi signal to have proper voltage for led strip (I usually get my circuit parts from Digikey)
  5. 4ft x 8ft acrylic sheet - Home Depot

Break Down the Acrylic Sheet

p1.jpg
p2.jpg
p3.jpg

We are making an 8x8x8 cube with a string of ws2812b leds. The leds are separated by 3 inches, so the lights will be about 21inches by 21 inches long. We chose to make the acrylic sheets a little less than 2ft x 2ft to handle this. That means we can make 8 layers from a single sheet of 4ft x 8ft acrylic.

We started by breaking down the 4ft x 8ft piece into 2 pieces of equal widths (~2ft x 8ft) with a table saw. After that, we used one piece as a template to draw a line using a dry erase marker to make equal squares from the pieces. Then we used a straight edge and a circular saw to make the 8 square layers.

Measure Out the Holes for the LEDs

p6.jpg
p4.jpg
p5.jpg

After each of the 8 layers were cut to size, we drew out the measurements for where the LEDs should be. We used a dry erase marker and a straight edge to center the led square. Since we had an 8x8x8 led cube, there will be 64 LEDs on each layer aligned in a grid pattern with about 3 inches between adjacent LEDs.

Drill Out Holes for the LEDs

p9.jpg
p10.jpg
p11.jpg
p12.jpg

Once the holes are marked out, drill out 1/2 inch holes with a step drill bit. This will make sure the acrylic does not crack. We had issues using a regular drill bit on this material and had to get a step drill bit to finish the cuts. Since the pieces were clamped together, we only had to drill out 64 holes. We also made a layer out of plywood that will be the bottom of the cube. After the holes were drilled out, we fed the LED bulbs through each hole. We used a serpentine pattern to orient the leds in each row.

Combine the Layers

p16.jpg
p13.jpg
p14.jpg
p15.jpg

After the layers were made with the leds in each, go ahead and combine the layers using 3 inch pieces of acrylic as spacers. We hot glued all 8 layers together with 5 spacers per layer. Then we came back with longer 2 feet pieces of acrylic and reinforced the sides of the cube. This is the first step we really saw the cube come together, and it looked great.

Connect the Layers, Solder Up the Circuit, and Download the Code

p18.jpg
p19.jpg
circuit.png

Now that the layers were all secured, we had to solder up the connections between layers. Since we had an even number of leds (8), in each layer we ended the serpentine strip of LEDs on the same side as the start of the strip. Then we connected each layer to the layer above, which in turn made vertical serpentine pattern connecting layers. After the layers were connected we made a simple circuit as seen in the attached photo to send data from the raspberry pi to the ws2812b leds. Since the raspberry pi outputs at a 3.3V signal and we need a 5V signal to correctly send data to the ws2812b leds, we use a SN74HCT125 integrated circuit to step up the voltage.

Once the circuit is setup go ahead and download the code from my github repository. We have a bunch of animations and more are coming, feel free to take a look. I used the BiblioPixel library to draw animations to the screen and BiblioPixelAnimations library to copy some of the animation code. Since BiblioPixel did not correctly handle a snaking vertical cube, I had to modify the code a bit to handle this. Once BiblioPixel is installed you should be able to run the animations without issue.

Light It Up!

spiral.jpg
p21.jpg
matrix.jpg
p20.jpg
p23.jpg
p22.jpg
p24.jpg
p25.jpg

Enjoy the animations! There are some really cool ones and I suggest watching the youtube video to see them all in action. Thanks for reading!