Go Down

Topic: New here - Planning a 5x5x5 (Read 2 times) previous topic - next topic


First post, don't flame me  lol
I am new to arduino, but have had a tiny bit of electronics exposure.  I plan to do a 5x5x5 LED cube. 
I'll use a ArduinoUNO and multiplex the LEDs using the 14 outputs - 7 cathode and 7 anode, multiplexing each through a grid of 12(3x4) transistors.
Still very much in the planning phase...
I have to learn what LED to use, what the pin resistor value should be, what the LED resistor value should be when powering via the transistor.
I have to check if multiplexing the 125 LEDs would give enough brightness as it cycles through.
I'm sure all this has been discussed, pointers to info welcome!
Cheers from Sydney Australia.


Google is your friend. www.google.com/search?q=arduino+5x5x5+led+cube


Anyway, I think I'll approach it on a grade-and-pave basis.
Get the hardware
Test driving one LED
Test driving one LED with transistor
Test driving 12 LEDs with transistor 4x3 array
Test driving 2x LED cube with anode&cathode on transistors
Build complete 5x LED cube and transistor arrays
Wire and try :)


Done some googling .. thanks dxw00d

What value of current limiting resistor would I need for the (ArduinoUNO) pin controlling the transistor base?

I will use 2N2222 NPNs multiplexing the LED using Arduino power.   As I understand it, if I use too high a resistance, the transistor will not go into saturation and will heat up, and if I use too low a resistance the transistor will oversaturate and not be able to operate at such a high frequency (probably not so big a problem since it will be multiplexed and cycled.. 

I want to keep the frequency at well over 50Hz to eliminate flicker, so that is max 20ms cycle.  I guess this is in the ballpark for the UNO to refresh 125 multiplexed LEDs with some re-calculation of pattern as fast as that?   Thank you for any comments.


150 ohm for the base.
For 5x5x5, that is up to 25 LEDs on at a time with standard method of driving the individual anodes and sinking all cathodes for 1 layer.
20mA each, that's 0.5A, too much for a 2N2222A, the arduino output pin has to drive 50mA into the base for that.

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


150 OhmSymbol.jpg ok.
I won't be doing it the standard way, I'll be cycling the 125 individually/sequentially, so only one at a time 20mA.  I hope it doesn't make it all too faint.

So hopefully the 2N2222A will suffice.  I'm attempting to run the whole thing off the UNO 14 pins.  If I multiplex the transistors, I figure it will give me space for a 12x12 virtual grid - plenty to run the 125 diodes.  The interesting part will be the software-mapping.


"cycling the 125 individually/sequentially"
How do you see that working?  I'm thinking 25 columns of 5 LEDs each,  with 5 pins enabling 1 of 5 columns. Then you have 25 groups of 5, having each group for 1/25 of the time will be much  brighter than each LED on 1/125 of the time. Change to the next group after 20mS for a 50Hz refresh rate.

"I'm attempting to run the whole thing off the UNO 14 pins."
Well, you actually have 20 pins, A0-A5 can be used as D14-D19.
18 pins if you commit D0/D1 to serial comm's for sketch downloading, or receiving PC Comms that will influence the pattern you show.
If not, you may just have to hold the arduino in reset as you start the download if you are using the Rx/Tx pins as part of your output drive, to give the bootloader a chance to start the download process. Not a big deal.

I  think you could do it with 15 pins tho. 5 Anodes, 5 cathodes, 5 row enables. Drive everything from Arduino pins.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


I'm doing this as a learning first-project thing.  I had got my head around the method I was going to use... but what you say makes a lot of sense.   I think you're still powering each LED off one pin.   I guess some of the 4x4x4 projects that cycle sequentially do look a bit dim and dropping that back 50% (to 5x5x5) will be significant so I see what you mean.   Dropping the cycle to 25 will be nearly three times brighter.

Because of the different logic of doing the groups of five, I'm going to have to study your diagram for some time to grok it. 


to grok it.

There's a word I haven't heard in a while. Should read that book again sometime. Must be 30 years since I last did.


It was giving me a headache, so I figured that was the best word to describe what i was trying to do!

I think I'm halfway there now.


OK so I'm getting there.. each of 5 planes of LEDs is powered on the anode side from a pin for the selected LED to be powered, providing the z-axis pattern.  (5 pins high=ON)

Each of the 25 verticals has the LED ganged on the cathode side to a transistor collector.  These transistors are ganged in groups of five along the x-axis and controlled by a pin ganged to their bases.  (5 pins high=ON)

These transistors are also ganged by their emitters in groups of five along the y-axis.   

These y-axis groups are turned on by a further transistor allowing the collectors to ground, and saving the pin from accepting the LED-cathode currents which could overload if all 5 were all on.  These further 5 transistors are controlled individually (5 pins high=ON)    (On my original method, low was going to be ON thus grounding the single-LED output to that pin with the others set High.)

Software cycles through each of 25 x/y positions with the appropriate z-pattern.   It will take a few more 2N2222A transistors and need 15 pins, but the programming and the brightness will be way better.  I'll look at the other D0/D1 thing when I get all the hardware  ... Heinlein lives!

Thanks CrossRoads    :)


No problem.
Just make sure your software only turns on 1 group of 5 at a time.
Turning on 2 would damage the arduino pin driving the anodes.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


Yes, good point. 

I'll play around with the software on a simple layout first, and work up.   I'll put in some delay loops and just make sure what's happening.

I've just ordered the hardware, so it might be another week...


Sorry to use this thread as my own personal blog... but guerss what?!@?!

My Auduino arrived today!!  I also have the LEDs, and I should be able to get the NPNs tomorrow.   Things are falling into place and I should be able to get started on this (my first project) on the weekend.

Since I am pretty sure of the assembly, first I will play with a flat 5x5 LED grid and try out the software programming.   I am planning to do some cooler patterns than I've seen on youtube .. depending on the processing speed and my 3D spatial geometry-fu. 

More to follow


Whoa this is so cool :)

I got the arduino hooked up to 4 LEDs to try out some software.  I got the LEDs on the PWM pins and address the brightness as the pattern moves through the grid.  I got the 2D geometry working nicely, 3D should not be a huge deal.  I can see that the 5Cube will be pretty cool - so long as the brightness is not compromised too much by the multiplexing.  Otherwise, I might have to figure out some kind of delay circuit with a capacitor and a transistor - hopefully it won't come to that.

Go Up