Electronics Projects

4x4x4 LED Cube

Before you start

 

In this guide i will show you what you will need and the steps to take to build your very own 4x4x4 LED Cube. Now you don’t actually need to have any working knowledge of electronics but a basic knowledge of soldering will be handy. You can find very useful videos on the basics of soldering on YouTube… but best way to learn would be to just practice, take two wires and try and join them or solder a wire onto a copper prototype board.

 

This project is a lead up to a larger 8x8x8 LED cube i wish to make. Hope to be posting that very soon.

 

Any who, hope the guide is of use, any suggestions please get in contact or send me a link to your working cube.

 

Components List

 

LEDs

You are going to need 64 of them in total, but you’ll probably find it cheaper and case some don’t work or you blow some, i would recommend to search for LED’s in batches of 100 or even 1000.  Also, to make the light from the led’s more omnidirectional and not shining straight up i would recommend diffused LEDs shine light evenly in all directions, whereas traditional ones shove most of their light out the top.  You’ll get very different effects depending on which type you use.

1000 Red Deffused 3mm red LED's (£5.54)
1000 Red Deffused 3mm red LED’s (£5.54)

 

Copper Wire

What you’re looking for is some conductive wire that you will use to join each row of 4 led’s together to make positive circuit for each layer. Beading Craft Wire “Jewellery wire” will work, i had some stiff insulated wire that i just stripped insulation off.

 

Resistors

For this project you will need a resister per connected anode layers, so 16 resistors to protect your LEDs from blowing when connected to your Arduino board.  The actual value of resistor will depend on the specifications of your LEDs, which should be provided by the retailer.

For a LED colour band checker i use – http://www.camradio.net/resistors.html

1280pcs 64 Values 1 ohm -10M ohm 1/4W Metal Film Resistors Assortment Kit Set (£4.09)
1280pcs 64 Values 1 ohm -10M ohm 1/4W Metal Film Resistors Assortment Kit Set (£4.09)

 

Prototyping board

To make soldering that bit easier i used a prototype board to solder the anodes onto and then the resister then the wire that will be pit into the Arduino. They come in sheets and can be cut/snapped into the size you require.

3 Pcs 9x15cm PCB Prototyping Printed Circuit Board (£3.99)
3 Pcs 9x15cm PCB Prototyping Printed Circuit Board (£3.99)

 

Arduino Uno

The core of this project will be an Arduino Uno micro-controller board.  The Uno is one of the more popular Arduino boards, and suits this project down to the ground.

Arduino UNO Rev3 (£4.39)
Arduino UNO Rev3 (£4.39)

 

Case – OPTIONAL

 

Not at all required but will make showing and demonstrating your new LED cube more “professional”. You can make one if you have the desire but i found one on eBay for few quid. Just need to make sure that the lid is larger than the square footprint of your LED matrix, and deep enough to put the Arduino and 20 wires without too much squashing.

MB3 ABS PLASTIC ELECTRONICS PROJECT BOX ENCLOSURE 118X98X45 (£3.99)
MB3 ABS PLASTIC ELECTRONICS PROJECT BOX ENCLOSURE 118X98X45 (£3.99)

 

Tools and equipment

You’re going to need some tools, below is a list of the basic tools i used and would highly recommend if your going to be doing more electronics invest in a set.

One of the hardest things i found to acquire is a good set of wire strippers. I bought and returned 3 others before finally finding a stripper that was simple to use and did the job perfectly each time. I ended up getting http://www.maplin.co.uk/p/automatic-wire-stripper-a35qw £7.99 and worth every penny to me.

 

  • Soldering iron – I Use
  • Flux core solder
  • Thin nose pliers
  • Wire cutters – I Use
  • Wire Strippers – I Use
  • Electric drill
  • 3mm / 5mm drill bit (depending on your LED size)
  • Ruler / measuring tape
  • De-soldering tool
  • Optional – 16 or as many colour varieties one for each anode pin

 

 

A JIG

I would say it would be highly improbable to build the layers evenly and straight without to use of a jig to hold the IED’s in place while you solder. I used an extra shelf left over from building the kitchen but any wood board would work, i would even suggest using cardboard before doing it freehand.

Now the size of the cube can be determined by the length of the LED’s legs once formed, so just before we make out the jig we need to bend a few LED’s to decide if we have a largest size.

 

Bending LED’s

The cube is made up of 4 layers which are each made up of 16 LEDs in a square configuration, so the first step is to put together four identical layers which will be soldered together later.

The layers are made by bending the cathodes (short legs) of the LEDs by 90 degrees and then soldering them all together to form a common cathode.  You’re then left with one common cathode and 16 individual anodes (long legs) per layer.

First bend the cathodes flat against the base of the LED, which will give you greater distance between them.

The distance between your LEDs needs to be just a bit longer then the length of the bent cathode, so that you’ve got some overlap to solder the cathodes together, but this doesn’t need to be more than 1 or 2mm.

1st Bend
Bent Cathode 90° over

Now you have the length of the LED’s legs you can make sure that the legs will overlap so soldering is possible. 13x13x13mm is my full cube measurements, so simply using a rule mark out your grid making (in my case) 13 by 13mm pattern.

LED Leg Length
LED Leg Length

Next simply using a drill and the right size bit (3 or 5mm depending on the size of your LED) drill the holes.

13 mm by 13mm Jig
13 mm by 13mm Jig

 

LED Testing

Your cube will be made of four identical layers, each with 16 LEDs.

Now this can be a bit tedious and boring, but it’s definitely worth doing.  You need to test all 64 of your LEDs to make sure that they work before you bend and solder.

I used the Arduino out of the box program called “Blink”, then Simply connect your LEDs one by one across pin 13 and the ground pin. Or if you have a CR2032 coin cell, press the legs of the LED against either side of it.  Do it the right way round and your LED should light up, if not its duff and throw away.

 

Bending the LED’s

Now you have 64 known working LED’s you’ll need to bend the cathode legs.  We know we need to bend the cathode over, this was done to get the jig size right. So, you need to bend to a 90 degree angle, it doesn’t matter which way as long as they are all the same, but don’t bend so that the bent cathode is in line with the anode, otherwise you won’t be able to solder the cathodes together.

Now using long nose pliers bend the anode about 2mm from the base of the LED 90° over and 90° from the cathode. final bend, using the long nose pliers bend the anode back up 90°.

 

Now do this to 64 LEDs (+extra 2 while you’re doing it just in case)

 

Assembly of one layer

 

Now time to put it all together to make a layer of LEDs. Place the first LED into the top right hole so that the cathode is pointing to the left overlapping slightly of the next home. Now replete this for the next hole along, then do the same for the next three other row’s until you have a full 4×4 grid of LEDs with each layer overlapping Cathodes and pointing up Anodes.

Then using a strip of copper wire or such, overlap the separated cathode layers to in order to connect the cathodes rows together to make a single cathode layer, it also helps with structure rigidity.

Do this another three times until you have four identical layers, all with 16 anodes and a single connected cathode.

 

Constructing the Cube

Now i unfortunately don’t have any pictures of the construction phase due to technical difficulty.

This is the fiddly step, you now need to connect each layer one on top another to make the cube. So placing one of the layers back in the jig you need to make sure you solder the next layer so that the centre of the LEDs makes a square on the side so the length, width and height are all equal. For my cube i needed to make sure the layer above was 13mm high and ended up using a 3rd hand soldering station to hold the layer while i soldered, making a 13 x 13 x 13mm cube in the corner, overall  52³mm cube.

53x53x52mm Cube
53x53x52mm Cube

So now you have 16 common Anodes and 16 Cathodes, but we only need 4 Cathodes. Now you can ether snip all the pointing out Cathodes and then run a wire from each layer down or bend the Cathodes down and solder each one to one another in a row. Then snip the Cathodes so that you have a single connection to each layer.

Please see the diagram, it’s hard to explain.

 

 

 

Optional Box

 

If your going to be presenting your LED³ on a display box then you now just need to transfer your earlier measurements you used to build the jig to making the holes for the lid of the box. Mark out the lid from the inside where each Anode pin will push through, and using small 2mm drill bit drill a small hole one for each Anode but also four extra holes for the Cathode layers.

 

IMG_20151114_135913
Push your cube into the new holes in the display box lid

 

 

Build Circuit

 

Now you’ll have 16 anode wires and 4 cathode wires poking through the underside of your case.

 

Now place the protoboard over the sticking out legs so that the lid inside has the copper tracks and 20 pins poking through. Now  just make sure that each anode is connected to a resistor.

Once your LED cube is fixed to the board (or at least connected up as above), you’ll need to connect your jumper wires to it.

Now if you have a good selection of coloured wire i would recommend using wire of around 200mm in length, as this will give you enough room to connect everything to the Arduino without being to fiddly but not to much so it wont all fit in the box if you have one.

Once you’ve soldered the wires to the 16 anodes and 4 cathodes, it’s time to connect them up to the Arduino.  You need to connect each wire to the correct port on the Arduino for the program to work, so check the diagram below which shows the LED cube as viewed from the top.

 

A1 11 7 3
A0 11 6 2
13 9 5 1
12 8 4 0
Layer 4 – A5
Layer 3 – A4
Layer 2 – A3
Layer 1 – A2

 

 

 

The Arduino needs to be programmed so that it knows what to do with the various connections on the board.

If you just want to get your cube working, then the easiest thing to do is just download this simple test pattern i use

4x4x4CubeCode Ino
4x4x4CubeCode Ino
4x4x4CubeCode.ino_.zip
2.6 KiB
192 Downloads
Details...
.

Once you’ve downloaded the code, open up the Arduino software and click File–>Open.  Navigate to the code you downloaded and open it.  Then click the “upload” button at the top of the window.

All being well you will now have patterns on your cube. If it seems like the lights aren’t in order check the pin configuration and tweak the code if needed.

int LEDPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, A0, A1}; //Adjust numbers here until LEDs flash in order – L to R, T to B
int PlanePin[] = {A5, A4, A3, A2};

Tweeking the above code in the project file will alter what LED will light up when the code is called. So it might be worth using the below code to make each layer light up for 5 seconds then each row for 5 seconds so you know if the pins are connected correctly.

B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 ,B1111,B1111,B1111,B1111 , 5000,
B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 ,B1111,B1111,B1111,B1111 ,B0000,B0000,B0000,B0000 , 5000,
B0000,B0000,B0000,B0000 ,B1111,B1111,B1111,B1111 ,B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 , 5000,
B1111,B1111,B1111,B1111 ,B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 ,B0000,B0000,B0000,B0000 , 5000,
B1000,B1000,B1000,B1000 ,B1000,B1000,B1000,B1000 ,B1000,B1000,B1000,B1000 ,B1000,B1000,B1000,B1000 , 5000,
B0100,B0100,B0100,B0100 ,B0100,B0100,B0100,B0100 ,B0100,B0100,B0100,B0100 ,B0100,B0100,B0100,B0100 , 5000,
B0010,B0010,B0010,B0010 ,B0010,B0010,B0010,B0010 ,B0010,B0010,B0010,B0010 ,B0010,B0010,B0010,B0010 , 5000,
B0001,B0001,B0001,B0001 ,B0001,B0001,B0001,B0001 ,B0001,B0001,B0001,B0001 ,B0001,B0001,B0001,B0001 , 5000,

 

Working

So with everything working its time to play with the code and see about making your own animations.

Enjoy!!!

 

Leave a Reply

Your email address will not be published. Required fields are marked *