5x5x5 LED cube help

I am going to make a 5x5x5 LED cube. i was going to use the colomns of the LEDs for the anode and have the anode of each LED in the colomn connected. Then i was going to connect the cathode of each LED in a layer together and use it to control the cathode of each layer. that way i can turn on a certain layers cathode and a certain colomns anode and get a certain LED to light up. i will be using an arduino uno and as many transistors and shift registers as i need. i also have thought about using MOSFETs, but i think since each LED uses about 20ma, i will only ever have 100ma max going through a transistor at a time. i do believe a transistor can handle that. but my question is what transistors i should use to turn the anode and cathode on and off. i should be able to use some basic transistors due to the small amount of current that will be going through each one. but my main question is what i will do about power. i think im going to buy 2 5Volt 2Amp dc wall wart power supplies. that would be plenty of power to power everything, but the LEDs are only 3volts each. so i am either going to use resistors, or i am going to put some high current voltage regulators between the power supply and the power to the transistors that turn on the LED anodes. i really dont want to have to wire a resistor to each LED, but if that is the best choice, i can do it. any help is appreciated. i do not know much when it comes to this stuff. i am trying to use this to learn and figured the challenge would be nice.

suicidalacorn:
I am going to make a 5x5x5 LED cube. i was going to use the colomns of the LEDs for the anode and have the anode of each LED in the colomn connected. Then i was going to connect the cathode of each LED in a layer together and use it to control the cathode of each layer. that way i can turn on a certain layers cathode and a certain colomns anode and get a certain LED to light up. i will be using an arduino uno and as many transistors and shift registers as i need. i also have thought about using MOSFETs, but i think since each LED uses about 20ma, i will only ever have 100ma max going through a transistor at a time. i do believe a transistor can handle that. but my question is what transistors i should use to turn the anode and cathode on and off. i should be able to use some basic transistors due to the small amount of current that will be going through each one. but my main question is what i will do about power. i think im going to buy 2 5Volt 2Amp dc wall wart power supplies. that would be plenty of power to power everything, but the LEDs are only 3volts each. so i am either going to use resistors, or i am going to put some high current voltage regulators between the power supply and the power to the transistors that turn on the LED anodes. i really dont want to have to wire a resistor to each LED, but if that is the best choice, i can do it. any help is appreciated. i do not know much when it comes to this stuff. i am trying to use this to learn and figured the challenge would be nice.

Don't use resistors for LEDs, use a proper current regulating chip. This protects the LEDs and makes sure they all run at the perfect current.

Most cubes illuminate a whole layer at a time with the layers as anodes and the columns as cathodes ("common anode"). The reason is that LED switching devices prefer to be between the LED cathode and GND (even simple NPN transistors). You switch power to each layer in turn and put your switching devices in the base.

So...unless you've got a really good reason for doing otherwise, I'd use a tried-and-tested design. Common anode layout and something like four daisy-chained TLC5916 chips for switching and current regulating.

well, i would much rather use the shift registers because of multiple reasons. i see what you are saying, and that makes perfect sense. but i really want to do it with shift registers. i know it will add more parts and wires, but i am willing to do that if i can use shift registers. thanks for the advice, though.

suicidalacorn:
well, i would much rather use the shift registers because of multiple reasons. i see what you are saying, and that makes perfect sense. but i really want to do it with shift registers. i know it will add more parts and wires, but i am willing to do that if i can use shift registers. thanks for the advice, though.

The TLC5916 is a shift register, it just happens to have current regulation built-in.

Whatever you do, don't use MOSFETs. They switch very slowly unless you add special circuitry (extra transistors) to switch them.

A good transistor for switching LEDs would be a BC337 (or maybe a 2N2222 if you can't get a BC337).

I would suggest that switching speed depends on the selected MOSFET.
Th '328P is all CMOS(FET), and it switches 40mA outputs pretty quick.
Choose one with low input capacitance.

CrossRoads:
I would suggest that switching speed depends on the selected MOSFET.
Th '328P is all CMOS(FET), and it switches 40mA outputs pretty quick.

Sure, but the MOSFETs in a '328P are tiny...

You can get TO-92 size MOSFETs that switch really fast. They might be worth using instead of a BJT if you need a very low "on" resistance

(which LEDs usually don't)

CrossRoads:
Choose one with low input capacitance.

Easier said than done.

so if i used 2N4401 transistors to control the cathode(because it is a npn) and 2N4403(it is a pnp) to control the anodes, will that work? keep in mind i will probably make the anode be on the colomns so that there are only five LEDs per transistor. if i used common anodes on each level instead of common cathodes, there would be 25 LEDs per transistor. i think it would be better to use the common anode on the colomns. but i may be wrong. any input is appreciated.

I would suggest PNPs for common anode layers, and open drain shift registers, TPIC6B595 type, on the cathode columns.
Can use 5 '595s, 25 for cathode, and 5 to pull the PNP gates low to turn them on.
Each TPIC6B595 can easily sink the 160mA from 8 LEDs all on at once at 20mA if want them good & bright.

CrossRoads:
I would suggest PNPs for common anode layers, and open drain shift registers, TPIC6B595 type, on the cathode columns.
Can use 5 '595s, 25 for cathode, and 5 to pull the PNP gates low to turn them on.
Each TPIC6B595 can easily sink the 160mA from 8 LEDs all on at once at 20mA if want them good & bright.

that makes a lot of sense and would probably be the best way to do it, but i am on a tight budget. i do not want to spend more than i have to. right now i can get 20 of the 74HC595 shift registers for $5. but it would be $10 to get 5 of the TPIC6B595's. so it wouldn't end up costing much more, but i wouldn't have any spares in case something happened. i am pretty much a noob, so if i accidentally wired it wrong or shorted something out and fried all of the shift registers (or TPIC6B595's) i would have plenty to replace them. but if i bought some TPIC6B595's i would probably buy only a few since they are much more expensive. yes with regular 74HC595 shift registers i will have to buy transistors, but those are extremely cheap and they are always nice to have laying around in case i need them for something or for future projects.

TPIC6B595 are 83 cents at avnet.com
Who is asking $2 each?
Less likely to make wiring mistakes with fewer parts I would think.

CrossRoads:
TPIC6B595 are 83 cents at avnet.com
Who is asking $2 each?
Less likely to make wiring mistakes with fewer parts I would think.

That's what they were asking on eBay. From a US seller, that is. I can get them cheaper from China, but they might take a month to get here. So I only buy from US sellers.

78 cents. avnet.com is a US supplier.
I ordered a tube of 20 a while ago. Don't recall what shipping was. You have other parts to buy also?
If not, 74HC595 and NPN transistors will work too.

CrossRoads:
https://avnetexpress.avnet.com/store/em/EMController?langId=-1&storeId=500201&catalogId=500201&action=products&term=tpic6b595&Nn=25&N=100153+4294956112

78 cents. avnet.com is a US supplier.
I ordered a tube of 20 a while ago. Don't recall what shipping was. You have other parts to buy also?
If not, 74HC595 and NPN transistors will work too.

ok. thanks for the help!

What crossroads says is pretty accurate. Basically what he is saying is that using parts that meet or exceed your needs will reduce your chance of premature failure. You could get away with 595s, they wont break right away, but your needs exceeds the parts specifications, and may cause premature failure, and its not the proper way of doing things.

There are actually a lot of ways to solve this problem. I do like your idea of controlling 5 LEDs at a time, and doing that in a loop of 5 that is inside another loop of 5, and you have controlled all 125 LEDs. I dont think that I have seen that one before. It will have an extremely low duty cycle, so It will probably end up very dim, which is probably why we dont see that technique being used. It also means electrically isolating rows, which maybe tricky to make the structure hold up. its still an interesting idea, and may be worth playing around with.

If you limit the current to 8ma to your LEDs with resistors, you could reduce the current to the diodes to 8ma, then you would be within the 70ma max current spec of the 595s, and well within the LEDs specifications.

Another option is to simply run the LEDs and shift registers over spec, and expect to replace them sometime i the future, it can take months to wreck your leds or shift registers. You could build a spare in that time, and have it ready if this one fails.

Hippynerd:
What crossroads says is pretty accurate. Basically what he is saying is that using parts that meet or exceed your needs will reduce your chance of premature failure. You could get away with 595s, they wont break right away, but your needs exceeds the parts specifications, and may cause premature failure, and its not the proper way of doing things.

There are actually a lot of ways to solve this problem. I do like your idea of controlling 5 LEDs at a time, and doing that in a loop of 5 that is inside another loop of 5, and you have controlled all 125 LEDs. I dont think that I have seen that one before. It will have an extremely low duty cycle, so It will probably end up very dim, which is probably why we dont see that technique being used. It also means electrically isolating rows, which maybe tricky to make the structure hold up. its still an interesting idea, and may be worth playing around with.

If you limit the current to 8ma to your LEDs with resistors, you could reduce the current to the diodes to 8ma, then you would be within the 70ma max current spec of the 595s, and well within the LEDs specifications.

Another option is to simply run the LEDs and shift registers over spec, and expect to replace them sometime i the future, it can take months to wreck your leds or shift registers. You could build a spare in that time, and have it ready if this one fails.

well, i was going to isolate each layer, not the rows. that way it requires less transistors and less pins on the shift registers. and i was planning on having the layers be the cathodes for the LEDs. but to do that with transistors i would have to use a npn transistor to control a pnp transistor for each colomn. i will try to attach a pic of the circuit. but that is a lot of transistors, a lot of wiring, and a lot of work. lets say i decide to do it completely with transistors and the 74HC595's. What would be the easiest way to do it? keep in mind i do not want to spend a lot of money on this. it is mainly just for learning. it probably will not stay together for very long. after i finish this i am going to make an 8x8x8 RGB cube based off of this one. this one is almost like a prototype so that i know what im doing. thats one reason i do not want to spend much money on it.

basically the circuit is just something i made really quickly. it just shows how i would control the anodes of the LEDs on each colomn. In the Circuit the LED represents a colomn of LEDs. the transistors are just ones that the circuit creator tool had. i will use whatever will work best. same goes for resistors and power. i do still need help on that. i still do not really have a good answer on the best way to power these 3.2v LEDs. any help with that would also be appreciated. thanks for what you have told me so far. everything helps.

circuit.png

"controlling 5 LEDs at a time, and doing that in a loop of 5 that is inside another loop of 5, and you have controlled all 125 LEDs."
I have posted that before. Doubt I could find it with a forum search - I can post it again when I get home.

Cool! If you find it, please send it to me, or post it, im mostly just curious, sometimes i do build samples, just to see it work, just because I think thats neat.

I know where it is, I had it open to maybe copy part for what I had posted earlier in this thread.
Be home in an hour or so, will post it then.

CrossRoads:
I know where it is, I had it open to maybe copy part for what I had posted earlier in this thread.
Be home in an hour or so, will post it then.

awesome! thanks!

Here it is.
I only did 3 of 5 rows, the other 2 are connected up the same.