Is a 4x4x4 led cube possible???

I know you can use the arduino alone to make a 3x3x3 led cube since it only use 12 pins but what about a 4x4x4 led cube? It would take up 20 pins which would be every single pin on the board and far as I knew you must avoid using the TX and RX pin. I just wanted to know if it was possible or would cause issues if I were to use all pins. I know you can get an MAX chip to do this instead of using all the pins, but I just wanted something for now so I can mess around with until I can get the MAX chip in the future.

You can use the TX,RX pins but you should disconnect them before you upload a new sketch.
But the 4x4x4 cube will take more current then the ATmega chip can give (16 ledsx 20-15mA = 240-320mA. the ATmega can give about 200mA).
You can use a shift registers witch are a lot cheaper then the max chips.

I never used shift register so do you know a good tutorial or explain it a little on how I might use it and hook it up please.

http://earthshinedesign.co.uk/ASKManual/ASKManual.pdf

I think it's like halfway down or something? using the 74HC595 with LED's.

There are some other tutorials, but the code included with the manual is the easiest to use (for me anyway:))

I'm not sure about power supply. But you can reduce your pin count quite a bit using charlieplexing. If I remember correctly you can drive n(n-1) segments with charlieplexing. So a 4x4x4 matrix would require only 9 pins.

I thought by having the led turns on 1 at a time wouldn't exceed the board ma. Could someone explain that to me please. I'm also going to be using resistors.

I know how to charlieplex and it would be really cool to do but it wouldn't work for a cube. The wires would be a complete mess and I'm not evern sure if you can even make a cube that way, but be interesting to see if someone come up with a way.

I found an instructable on making a 4x4x4 cube with Charlieplexing:

But this is to complex in my opinion. Best way I see is using shift register in this case you will just need 2 because every one got 8 outputs(There is a great tutorial on the arduino playground on using them)

I don't see any way that wiring up a cube is going to be "elegant", no matter whether it's direct-connected, multiplexed (16x4, 8x8?) or charlieplexed (9x8, sortof.) You're pretty much always going to need some sort of mapping function to go from (X,Y,Z) to a particular set of signals, and while that may be somewhat simpler for the simplest case, it's not going to be THAT complicated even with charlieplexing.)

There are other possibilities:

One 12 bit shift-register.
One 8-bit shift register (3 pins) and 8 digital outputs.
Parallel Latches...

Charliplexing or using shift registers would work. Shift registers are cheap. I have seen them for .35-.40 cents

9 pins, 2 multiplexers, 4 NPN transistors.

http://vimeo.com/9285542

Very much possible. The cube is divided into two sections of 8 columns. The multiplexers have common select bits. Only 2 LEDs are lit at one instant. Animation is stored as an array of ints.

I've since disconnected it, and there were some flicker issues, but I forgot to decouple the ICs, so I'm not surprised. I've also heard that 4051s are rubbish for driving LEDs in this manner.

I think the elegant solution is to add a transistor to each LED, then run three 4-bit busses along the x, y and z planes, two being traditional mpx, the third driving the transistor bases to switch on the LED. At least the wiring is straightforward. Need current limiting resistors on 2 of the busses.

Hope that's clear - basically 3D active matrix. 12 pins. Unless I've missed something?

I'm not sure why you'd call 64 transistors elegant. Tell me how elegant you feel after soldering all those ;D

Not sure if you've missed anything, but I have no idea what you're talking about.

An LED cube (in its simplest form) works as follows:

  1. Create a "layer" of LEDs sharing a common cathode, with each column being the anodes.

  2. connect all the annodes in each column to form your cube.

  3. lighting an LED at x-row, y-column, and z-layer involves sinking current off z-layer (I used 1 transistor per layer), and passing current up x-row at y-column.

I won't get into anything like drivers, because I think that should be in the hands of the designer. There are a hundred ways to skin the cat. I think my next design will use shift registers, and I'm going to try programming an Atmel chip sans Arduino.

It might seem "elegant" to use one transistor per LED, but it doesn't scale well to larger sizes, and don't forget that you have to run wires from all these transistors lest you should have a bunch of black flecks in your otherwise optically pleasing cube.

And don't forget that persistence of vision is your friend, you don't need absolute control over every LED simultaneously.

Well my thought is that by matching the symmetry of the array you make all the wiring linear and straightforward, but in 3 dimensions that means an X wire, a Y wire and a Z-wire, and the simplest way I can think of to enable an LED at the intersection of 3 signals is to make two of them 'power' and one 'enable' - or put another way each 4x4 layer is standard multiplexed, but each layer gets its own enable signal to switch on the transistor. That way you need 4 signals for each of 3 dimensions.

If you think of it as 4x16 you need 20 pins or a separate 4->16 decoder chip.

But yes, 64 transistors is a pain - but you have 64 LEDS anyhow, so its only doubling the work - I did look to see if there might be some sort of switched-LED on the market with no luck.

You could try and drive it as an 8x8 array - wiring is a little more complex (but not as bad as charlieplexing).
The advantage of x-y-z addressing from a software point of view is clear!

I'm now wondering if an LED tetrahedron would look cool :wink:

seeed studio has a kit which looks quite well done, but it is $80. >:(
http://www.seeedstudio.com/depot/rainbow-cube-kit-rgb-4x4x4-rainbowduino-compatible-p-596.html?cPath=71

seeed studio has a kit which looks quite well done, but it is $80. Angry
http://www.seeedstudio.com/depot/rainbow-cube-kit-rgb-4x4x4-rainbowduino-compati...

Its not that expensive considering it is 10mm diffuse RGB.

But there is no software, you have to program it via Rainbowduino and tha makes it very complicated to have 3D Pattern

I just ordered one of the 4x4x4 led cubes from Seeed Studio. I also previously bought a new 328 Rainbowduino. I didn't see any information if it will work with the new 328 Rainbowduino or just the older 168 Rainbowduino.

Also where is the software for the Rainbowduino for this 4x4x4 led cube?

I actually have a working 4x4x4 arduino controlled LED cube blinking away in front of me. I only used 17 pins because it's semi-chalieplexed. (in theory, you could control a 4x4x4 cube, 64 LEDs, with only 9 io pins using charlieplexing)Each LED is connected to every other one on its level (z axis) and to every one above and below with a column (x,y axis). Alternate levels have opposite polarity and are connected.

I control it by fist switching every pin to LOW, then making it INPUT, which makes it high impedance as if it were disconnected. I do that with port registers because high-level code wasn't working. Then, to turn a pin on I make it's level to either HIGH or LOW, depending on it's polarity, and make it's column to the opposite HIGH or LOW.

It's working almost perfectly. The problem is with pins 0 and 1, which are used for serial communication. When I try to use those everything gets screwy.

I can post my code if it would help anyone (or if they could help me!)
Dows anyone have any advice on how to make pins 0 and 1 behave "normally"?

I built a 5x5x5 led cube project based on the hardware design shown here:

You would scale it down to just one 16 bit constant current shift register to drive each 16 led common columns and then use just four row driver transistors to make a 4x4x4 design. The constant current outputs of the registers makes a nice adjustable (with one fixed resistor) brightness level for the leds.

I think this design is pretty nice trade-off of hardware Vs software to accomplish the task. Be sure to use diffused leds as the super bright ones have too limited a angle of light to look right.

I used the MStimer2 library to set up a interrupt routine that would refresh each row every 2 millisec for a 10 millsec total cube update time.

Lefty

The problem is with pins 0 and 1, which are used for serial communication. When I try to use those everything gets screwy.

Well pin 0 is hardwired through a 1k resistor to the FTDI's serial data output (arduino receive pin) pin, so it's going to act like a weak pull-up, so probably will mess a little with the multiplexing.

Lefty