My 3x3x3 and 5x5x5 LED cube

So after 3 days I finished my 5x5x5 LED cube. Now everything is working fine, however if I multiplex more then three layers my LEDs goes less bright then when I'm only multiplexing 3 layers. It's not a big deal but if someone has an explanation for it it would be great!

pics comming soon!

How has this been going? do you have pix or video yet?

I dont understand your statement about how its going not so bright, or why that might be happening.

Sorry for the delay but I have been on vacation lately. Tommorow I will post some pics of it. I still have some struggling with the code but I almost figured out. So the videos will be posted within a week :).

I figured out the brightness issue though. Its because the duty cycle is around 1/5 if I multiplex 5 layers. To fix it I should pulse my leds with much more current then I do right now. I dont really mind about the brightness loss so I keep it in its original state:).

25 LEDs at 20mA is 500mA; you can't go much brighter without another supply.

Hi. im an arduino newbie as well and I just built a 3x3x3 led cube this weekend and wanted to ask you a couple of questions. I built the cube and made sure all the pins worked but got a little bit stumped when it came to programming since it was my first time. Just from reading through these posts I understand now that it is smarter to light up each layer at a time so I have a 1/3 duty cycle. (I was doing 1 led at a time with 1/27th duty cycle. :*) But my first question is why use transistors? I hooked each layer up to a specific pin and when I want the layer off I just set the pin to HIGH. Is there an advantage to using transistors?

My next questions is going to be about how you simplified your code. But im going to rewrite my coding a little tonight just so I can see the cube in action and then I will post it.

Thanks in advance! and good work, I hope I will learn as fast as you did!

What I did was do the 1/27 duty cycle, alot of code but you can copy and paste so it becomes easier. You could also use for less code is lable a xyz not sure how to do that though.

But my first question is why use transistors? I hooked each layer up to a specific pin and when I want the layer off I just set the pin to HIGH. Is there an advantage to using transistors?

Not just an advantage, but a requirement to use a transistor to enable or disable each layer. As when a layer is enable the amount of current allowed to flow is dependent on the number of leds your software has commanded to be on for that layer and that can vary from 0 to 9 leds for a 3x3x3 cube.

So worst case, 9 leds x 20ma= 180ma is way more current then the arduino output pin controlling the layer can handle, so the need for the arduino output pin to control a switching transistor that can handle that amount of current.

That make sense?

Lefty

Here are some pics :):

Next time I'm gonna design a PCB and etch it at school.

Somehow this ended up a lot more parts than I had originally expected. it looks like you are using 5 transistors for switching planes on or off, and 5 shift registers for columns.

Yes there quite a few parts in this one, here a list of all things I used:

-125 LEDs
-Copper wire to give the layers more thoughness
-5 NPN 800mA (2n2222) transistors
-5 x 150 ohm resistor for the transistors
-2 experiment boards to solder the components on
-14 male, 5pin connectors
-13 female, 5 pin connectors
-1 male, 3 pin connector
-2 meter 10wires ribbon cable
-6 meter white wire
-2 meter black wire
-2 meter red wire
-1 meter blue wire
-2 meter green wire
-2 meter yellow wire
-6 shift registers and 6 ic-sockets
-6 100nF ceramic capacitors
-25x 220 ohm resistors
-1x 10K resistor

This is all I used. I use 5 shift registers to control 5 LEDs per shift register, the 6th shift registers is for controlling the layers via the NPN transistors.

5x5x5 cube looks good!

I still dont understand the need for transistors for the grounds. When I want to ground a layer I just send a LOW signal to that layer. When I want to turn the layer off I send a HIGH to the layer. A 5V HIGH shouldn't be enough voltage to reverse bias the led so it shouldn't hurt it.

I may be wrong :astonished:

Thanks!

The digital pins from the arduino can only sink(/source) up, up to 40mA. If I turn on 25 LEDs on one layer the total current that need to be sinked by the digital pin would be 25*13mA = 325mA, this is far too much for a digitalpin. Instead I use NPN transistors, the collector from the transistor is connected to each layer of the cube. The emitter is connected to ground from the arduino (Ground from the arduino can sink up to around 450 mA on USB) and the base is connected to a digital pin on the arduino (in my case to the shift register). Now I am able to turn on 25 LEDs on one layer without frying something. The other advantage from transistors is the way how the ground is turned on/off, I send a HIGH signal to the base from the transistor so it switches the selected layer to ground. Because I can use HIGH instead of LOW (what you mentioned) it makes it easier to program.

Nice job with the build and assembly Wondertiger.
What current are you seeing from the 74HC595 outputs?
Set an LED high and measure the voltage across a 220 resistor.
I'd expect something like 2.8V/220 = 12.7ma if your LEDs have a Vf of 2.2V and you're actually gettiing 5V out of the 74CH595.

I did a measurement with a cheap digital volt meter and it came around 2.5V. I think I should invest in a better multimeter in the first place (a buddy of mine has an industrial fluke that works really well he said, maybe I should look for something like that) to get some accurate readings :blush:

WonderTiger:
I did a measurement with a cheap digital volt meter and it came around 2.5V. I think I should invest in a better multimeter in the first place (a buddy of mine has an industrial fluke that works really well he said, maybe I should look for something like that) to get some accurate readings :blush:

There are many reasons one might want to upgrade to say a fluke DMM (I own 3) but for the kind of stuff your doing with a typical arduino project a simple cheap DMM (unless defective) will not be a big deal as far as accuracy goes. Like any tool, it's not so much the tool but rather knowing how to use it properly and understanding it's limitations. The biggest draw back of modern DMM is that it always displays a number even when the number being displayed doesn't mean what you might expect it to or want it to mean. Measuring the output of a active PWM pin is one example of a improper measurement for a DMM, it will display a number but it doesn't mean what you think it means.

Lefty

I absolutely agree with the statement you made. However I think a good meter will be a good investment though (for my study and other projects in the future) even if it isnt really meaningful for now yet.

I use an inexpensive Extech (extech 330) meter that seems to work really well. You don't need to go overboard with an expensive Fluke meter.

WonderTiger:
You're absolutely right with the statement you made. However I think a good meter will be a good investment though(for my study and other projects in the near future) even if it isnt really meaningful for these kinds of projects yet.

I agree mostly about good test equipment being a near lifetime investment that will pay good dividends for a long long time. After working for decades in the electronics industry I found that fluke meters and tektronix scopes were all I ever wanted to own for personal use.

But the point is that arduino beginners should be encouraged that their first purchase to make after their arduino board is a DMM, well before obtaining any other components and/or modules for their various projects. So the $10 DMMs serve a good purpose in at least getting them started on the right path. Many young people starting out just can't yet afford the investment costs of say a Fluke meter, but can swing for a $10 DMM which is much better then no DMM at all which all too many appear to have.

Lefty

We just got my son a $19 extech meter, sprung for a little extra because this one also came with a thermocouple probe.

CrossRoads:
We just got my son a $19 extech meter, sprung for a little extra because this one also came with a thermocouple probe.

Cool, and if he misbehaves tell him you will use that probe to take his temperature the 'old fashion way'. :wink:

Lefty