Introduction: DIY | 3x3x3 LED Cube for Arduino Nano+

Hi everyone!

My name is RGBFreak and I created a YouTube channel quite recently.
I love DIY and I especially love LED's, so that's why I decided to make my own 3x3x3 LED Cube!

You will need the following items to make this LED Cube:



• 27 single colored LED's.
• Arduino Nano or one of his bigger brothers.
• 3 NPN Transistors. I used the BC547.
• 3 pin headers with 3 pins.
• 1 pin header with 4 pins.
• A piece of perfboard.
• A few small cables.


Step 1: Creating the 3x3 Layers

To start off we have to make 3 layers of 3x3 LED;s. The easiest way to do this is to get a piece of cardboard and poke holes in a 3x3 pattern. Make sure the LED's won't fall through when you push them into the holes. In the end it should look something like in the picture.

Step 2: Soldering All Cathodes on Each Layer

We have to connect all cathodes on each layer now. Ofcourse we use solder for this.
Repeat step 1 and 2 two more times and you should end up with 3 layers that look exactly the same.

PAY ATTENTION: The cathodes and anodes should NOT touch eachother.

It's smart to test all your solder connections before continuing to step 3. The easiest method is to grab your Arduino and connect one of the cathodes (the pins you soldered) to the GND of your Arduino and connect a cable to the 3V3 of your Arduino. Now you can touch each anode with the 3V3 wire and if everything works the LED should light up.

Step 3: Soldering the Layers Together

Use something like a soldering hand to solder all anodes to the anode on the layer below.
Again, make sure not to accidentically solder the cathode to the anode.

After you finished soldering all 3 layers together your cube is done! Now all that's left is to add a few electronic parts and some connectors.

Step 4: Soldering the Cube to Your Perfboard

Now it's time to solder the remaining 9 anodes onto a perfboard.
You get the best result if you leave a gap between the perfboard and the bottom layer. This will make it look like the cube is floating in mid-air.

Step 5: Finishing the Perfboard

Solder the perfboard as shown in the image provided.

The black lines are connections between different copper strips. You can use solder or wire to connect them.
The blue lines is where you have to scratch the copper so that it doesn't conduct anymore.

Step 6: Connecting the Layers to the Perfboard

Use 3 wires to connect each layer to one of the transistors.
You can see which pin you have to solder in the perfboard layout in step 5.

Your cube is now done! To connect it to your Arduino you have to connect cables to the headers.
You can see how to connect the cables using the image provided in step 7 ("Programming").

After you connected your Arduino to the cube you can program my code to check wether everything is working properly. If you're not sure if it all works properly I suggest taking a look at my youtube video since it's the same code I used in the video.

Do some of the LED's not turn on? Check wether all your solder connections are ok and check for short circuits on your perfboard.
You might come across the issue that one of the layers isn't working. This is probably because one of the transistors is damaged.... Don't panic! If you replace the damaged transistor your LED cube should work fine.

Step 7: Programming the LED Cube

I'm pretty new to programming an Arduino myself, so I can't tell you a lot about it. I don't know how to use arrays and I don't know how to multiplex either.
But... I can explain a few simple tricks to make the programming a lot easier!

First off we are going to determine how we want to use the pins of our Arduino. We can do this by pasting the following code in our void "setup":

pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

Pins 2-10 are to control the LED's on each layer. Pin 11 is to control the lowest layer, pin 12 controls the middle and pin 13 controls the upper layer.

To connect your Arduino to the headers you should use the following pinout (based on the image provided):
From left to right > D10 – D9 – D8 – D7 – D6 – D5 – D4 – D3 – D2 – GND – D11 – D12 – D13

It's useful to create a void to make all layers active at once. You can do this easily using the following void:

void allLayer() {
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
}

To disable all layers at once you can use the same structure. All you have to change is the name of the void and change the value HIGH to LOW.
You could also use this structure to activate all LED's at once.

If you're interested to see more of my DIY projects make sure to take a look at my YouTube channel:
https://www.youtube.com/channel/UCKp8cQWkiGGfAV5FM...

Also don't forget to subscribe while you're there! ;)

Comments

author
AndréV97 (author)2017-05-09

can you post a picture of the bottom? so I can where exactly I should scratch and/or connect?

author
RGBFreak (author)AndréV972017-05-21

Dear André,

I'm very sorry to let you know that I don't have the original design anymore. There is however a PCB that you can make the 3x3x3 LED cube with as an shield. I designed a PCB for it. You can find it over here: https://easyeda.com/yourics/Arduino_UNO_LED_Cube_Shield-efL3XfxrJ

author
Flip434 (author)2017-04-26

Will 3.2 volt leds work? Or will i need a resistor?

author
Noisyblade (author)2016-12-18

Can You PLZ Do A Video On Programming The LED CUBE

PLZ IT WILL BE SO HELPFULL

author
bjrocket141 (author)2016-08-11

what was the size of the template?

author
erwinsanders (author)2016-06-05

hello

What size of the led did you use?

author
RGBFreak (author)erwinsanders2016-06-05

Hi! I used 5mm LEDs. If you still have to buy them I suggest looking for diffused LEDs, but normal ones will work fine as well

author
PhilipG5 made it! (author)2016-06-03

This was very informative and a fun project at that. Thank you for sharing. :)

temp_-970692590.jpgtemp_1808022635.jpgtemp_778104729.jpgtemp_-392293753.jpg
author
RGBFreak (author)PhilipG52016-06-03

AMAZING! Thanks for your comment! :)

author
Zheka163 made it! (author)2016-06-01

I have long wanted to collect the cube, but did not have enough time and persistence. But seeing this instruktabl decided not to postpone. Used MMBT5551 transistors and reliability added to the base circuit 3k resistors

DSC00742.JPGDSC00744.JPGDSC00747.JPG
author
RGBFreak (author)Zheka1632016-06-01

That looks amazing! I just finished my LED cube shield :)

author
parisaaa (author)2016-05-23

it's awesome

but i couldn't understand the 5th step. can you send me a picture of uneder the board?

author
RGBFreak (author)parisaaa2016-05-23

Which part you don't understand?

author
parisaaa (author)RGBFreak2016-05-23

part 5. how can i connect them together with soldering? i mean for example, which NPN has connected to which LED? you know what i mean? i need a picture of under the board to see how the connection of them is.

author
parisaaa (author)parisaaa2016-05-23

I mean how the Electronic circuit is?

All I need is a picture of the other side of the PCB (board).

author
RGBFreak (author)parisaaa2016-05-23

I had to experiment with mine, so there is a lot of solder in incorrect positions. Black lines is solder, blue lines mean scratch through copper layer. That's all. The lines with text on the transistors must be connected to the corresponding layer (according to the text)

author
parisaaa (author)RGBFreak2016-05-23

Ok thanks

author
RGBFreak (author)parisaaa2016-05-23

You're welcome. Feel free to ask if there is anything else you need help with :)

author
Zheka163 (author)2016-05-22

In my opinion should be added the concept of classic and not the wiring diagram on the breadboard. Since it is not very correct, but agree it is more evident but it is necessary to teach newcomers to the standard perception of electrical circuits.

author
RGBFreak (author)Zheka1632016-05-22

True! Thank you for your comment. Will go into more detail next time :)

author
boudou1234 (author)2016-05-21

Can i use bc548c instead of bc547?

author
RGBFreak (author)boudou12342016-05-21

Yes you can. Any NPN type transistor should work.

To find out if a transistor is NPN or PNP you just have to google "BC548" and open up a datasheet. It should say NPN or PNP on the first page.

I googled it for you and the BC548 is a NPN which means it should work fine.

author
AmCoder (author)2016-05-20

nice :)

author
RGBFreak (author)AmCoder2016-05-20

Thank you!

author
RGBFreak (author)2016-05-20

Sorry? I don't know what you mean

About This Instructable

11,856views

137favorites

License:

Bio: Hi there visitor! First of all thank you for checking out my profile! My name is Youri. I study Mechatronics in the Netherlands. I especially ... More »
More by RGBFreak:Cheap Flying Ghost Halloween Prank!DIY | RGB LED Shades Controlled By ArduinoAdd A Temperature Switch To Your Dusty Old Fan!
Add instructable to: