If you’ve dabbled with some budding Arduino projects but are looking for something a little permanent and on a whole different level of awesome, then the humble 4 x 4 x 4 LED Cube is a natural choice. The design is much simpler than you might think, and using multiplexing, we can control all the LEDs right from one Arduino Uno board. This is excellent soldering practice and the total cost of the components should not exceed $40.
Today I will go into detail about the constructive side and provide software to make it work that will look impressive and teach you the basics.
You will need
- . The supplied code assumes an Arduino Uno, but can be adapted to a larger model.
- 64 LEDs — the choice is yours, but I used these bright 3mm blue LEDs ( 3.2V 30mA ) at £2.64 for 50.
- 16 resistors appropriate value for your LEDs. For the LEDs above, 99p bought 100 of them. Use ledcalc.com — enter 5V for supply voltage, LED voltage (in my case 3.2) and current in milliamps (3.2). Your desired resistor will be shown in the box labeled «nearest higher value resistor» and then just search for that value on eBay.
- A little craft wire to strengthen the base structure and for finishing — I used the thickness 0.8 mm .
- Bread board some type that you can solder all your bits to. I used one that didn’t have full tracks along it since I don’t have a road cutter, but use what works for you. The Arduino prototyping shield is too small, unless you squeeze your LEDs together.
- Random component wire — some cores of the network cable and some prototype wires from the kit will work fine.
- Clips «crocodile» or «helping hands» are useful for holding the bit in place.
- Soldering iron and solder.
- Some wood.
- Drill with a bit the same size as your LEDs.
Note: The 3D drawings in this tutorial were completed in a few minutes using TinkerCAD. I followed the existing build, in detail Instructables by user which you may also want to read before attempting this.
Be sure to read all of these instructions, before than trying to do it yourself.
The principle of this design
To drive all of these LEDs with just 20 pins, we’ll be using a technique called multiplexing. Breaking the cube into 4 separate layers, we only need control pins for 16 LEDs — so to light a particular LED, we have to activate both the layer and the control pin, which gives us a total requirement of 16 + 4 pins. Each layer shares a common cathode — the negative side of the circuit — so all the negative legs are connected together and connected to the same pin for that layer.
At the anode (positive) side, each LED will be connected to the corresponding LED in the layer above and below it. Basically, we have 16 columns of positive legs and 4 layers of negative ones. Here are some 3D connections to help you understand:
Since we won’t be using an all-metal soldering structure, we want all of the LED legs to overlap by about a quarter to give the structure rigidity. Fold the cathode of your LEDs — the side with the flat notch in the head and the shorter leg — over as shown. (It doesn’t really matter if you bend it left or right as long as you are consistent and never touch the anode)
The first important part of this project is the manufacture of the wood cutter. This will hold the LED layer in place while you solder the legs together, so it needs to be accurate and not too loose. Using a drill bit the same size as your LEDs, measure and then drill through the 4×4 matrix equally spaced holes. Keep in mind that you want about a quarter of a leg to overlap, and use a real ruler. Check each hole to make sure the LED is tight, but not so tight that you won’t be able to pull it out again or you’ll have trouble trying to remove the fully soldered layer.
Solder cathodes of 4 rows of LEDs. Be careful not to burn out the LEDs — you need a good hot iron as well as getting in and out. Here are my first four rows completed.
Now, to stiffen the layer, cut and solder two straight pieces of wire wire to both ends, making sure they connect with each row. This is your first layer completed. Leave all extra legs sticking out to the side.
Now is a good time to test — just load the default Arduino blink app and with a resistor connected, connect the ground to the layer frame and push the positive lead to each LED in turn.
I hope they all light up. If not, make sure you haven’t missed a solder joint somewhere and replace the LED if necessary.
Remove this layer from the clamp and repeat the process again 3 times .
Don’t worry if your soldering isn’t perfect — as long as it doesn’t break and the connection is solid, it won’t affect the final product. I admit, my soldering was pretty bad, my clamp was off and it all looked like the Leaning Tower of Pisa. However, I’m proud of the finished cube, and when the LEDs are lit you won’t be looking at the solder joints anyway!
Once you have 4 completed layers, you will want to connect all of the vertical legs together. I found this to be the hardest part of the build and to help with the process I cut the riser out of the map.