So here’s my botched attempt at a 5x5x5 LED cube. Less than half the LEDs light up because of a number of problems and it’ll take too much work to fix it, so I’ll probably just start again from scratch when I find the time. Since I really don’t recommend you do what I did, I’m only going to give advice on what to avoid when planning out a project like this.
Lesson 1: Count Your I/O
So my first obvious blunder was that I didn’t realize how many I/O pins were needed to control a 5x5x5 cube until I got around to wiring it. As a breakdown, the cube controls each individual light with 2 pins. One for the layer, and another for each light in a layer. So my cube being 5x5x5 needs 5 layer pins and 25 column pins for a total of 30 I/O. Had I known this ahead of time, I’d of chosen to use a bigger micro-controller such as an Arduino Mega as the Nano I used falls a few short of this number.
Lesson 2: Use a build Jig
Thankfully this was one of the things that I actually did plan for. Alignment of the LEDs is crucial for a good looking cube. I’ve seen other people build their own jigs with a power drill and some cheap building material like plywood. While this is definitely better than trying to eyeball everything, it pales in comparison to a precision made jig. I personally used a 3D printed jig I found on Thingiverse here and I definitely recommend it. Of course, that only helps you with a single layer at a time. When you get to the part where you connect the layers together you’ll need to rely on measurements and spacers to get by, which is where I failed and wound up with a “cube” that’s about 1.5 times taller than it is wide.
Lesson 3: Test Everything Constantly
It’s a huge bummer to find a bad LED in your project once it’s too late to fix, so I made sure to test every LED I used with a coin cell battery before I started since it was quick, easy and guaranteed not to cause a blowout. However, this only works if you can touch both leads on an LED with it. After you trim off some leads and surround the LED with obstacles, it becomes impossible to test like this. Had I not been lazy, I would have used jumper cables connected to my MCU to test, but I was overconfident and under-prepared so I inevitably let some bad solder joints slip past my detection and shot myself in the foot.
Lesson 4: Understand Power Delivery
So a big thing with LEDs is knowing how to power them. Start by identifying positive and negative leads, the positive side being the longer one. Now consult a manufacturer spec sheet to figure out voltage requirements. Keep in mind that color and size are important details. These 3mm LEDs I got from Banggood require 1.8-2.3V for red LEDs, 1.8-2.3V for yellow LEDs, 2.8-3.6V for green LEDs, 2.8-3.6V for white LEDs and 2.8-3.6V for blue LEDs. This means that if you are outside the recommended range you risk blowing out the LED or not being able to light it up. Voltage drop across thin wire is also a concern but if you keep your runs short it won’t matter too much. Resisters might come into play if output pins exceed the recommended voltage so I recommend brushing up on Ohm’s law if you encounter problems.