Go Down

Topic: Theoretically ONLY - Possibilty of using just 2 HC595 to control an 8x8x8 cube  (Read 808 times) previous topic - next topic

Azerla

Hello all,

First of all, I love "...I wonder what would happen if...", moments. That's when you look at something and get an idea that, in theory at least, should work.

Second, I'm an idiot. At least according to my wife. I'll look at something and think, theoretically that should work, and end up causing maximum havoc on a scale of zero to WTF idiot !

So it should come as no surprise to learn that, after recently starting to play around with my birthday gifted Arduino Uno and building my first successfully working 3x3x3 led cube, I started investigating the
possibility of expanding to a bigger cube. The problem was, I started thinking.

Unfortunately, that meant delving into the realms of Shift Registers, amongst other things, and I found both the resultant code and the wiring to be massive headache material.

However, my "... I wonder what would happen if..." moment came when I thought why can't an 8x8x8 led cube be driven by just 2 x 74HC595 shift registers?

Here's the theory:

Using Red LEDs with 1.8v forward voltage, and using appropriate current limiting resistors to limit max current to, arbitrarily, 8mA per column, use one Shift Register to address 8 common anode Columns. Then use another Shift Register to address the 8 common cathode Rows. The Register that addresses the Rows is connected to individual BC547 transistors and this Register is subsequently multiplexed via software, so are continually cycling sequentially.

Register 2's Output pins are connected via appropriate resistors to the Base of each transistor, the Rows of the cube are connected to Collector, and the Emitters to common ground.

IN THEORY, it should work, but there MUST be a reason it's not been done. Is it current handling of either or both the Arduino and the Registers in this situation ? The way I look at it, if all 8 LEDs of a column are active, 8 LED x 8mA = 64mA, and if I read the datasheet correctly the HC595 can handle up to 70mA across all 8 pins. So if the Rows are continually multiplex cycling there should never be more than 8 LEDs illuminated at once, as the multiplexing produces a POV display. Admittedly, at 8mA the LEDs will never produce full brightness, but I connected a 3mm LED to a current resistor to produce 8mA, and it was fine for what I need. I'm after a fair illumination of the LEDs for a cube, not a backup lighthouse for coastal shipping.

As I said, it's theory only, but the wife won't let me test it out, threatening withdrawal of marital services if I blow up my birthday gifted Arduino and / or other equipment to go chasing another one of my mad schemes.

I have a schematic of the system, but it's on my local hard drive and I can't post it under the Insert an Image function because I don't have a URL for it. Why can't we have the facility to Paste an image ? I've created an attachment for it instead, for those who are curious.

Anyway, let me know why I shouldn't go ahead and build it, I'm always receptive to constructive criticism from those in the know.

Regards





PaulRB

Yes, it would work in theory.

You might feel that 8mA per led is bright enough, and you would be right. But you won't be getting that, on average. You won't even be getting 1/8 of that. You will be getting 1/8th of 1/8th of that, ie. 1/64th of that. Very dim! Also, unless you plan on using transistors, one pin of a 595 can only sink around 35mA absolute max, so about 4mA per led peak, 1/64 of 4mA on average.

Azerla

Thanks Paul,

Ahh well, it was worth a try, I wasn't sure about the current limitation, Mathematics isn't my strong point, but your comments are well received and noted. Thank you.

And as  correction to the main post. I made a whoopsie by stating 8x8x8 when I meant 8x8 in a 2 dimensional array, not a cube, although, come to think of it (insert ...... I wonder what would happen if..).

Regards

Grumpy_Mike

An 8x8 arrangement of LEDs is known as a matrix and is much more feasible with two shift registers than a cube.
This is the sort of thing you need to do http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

WonderTiger

To counter the reduced brightness due to the longer duty cycle you have the option to pulse the LEDs at a higher current. For instance the image below plots the forward current of the LED versus the pulse length in milliseconds of the signal. As you can see you can pulse a LED at a very 'high' current when the pulses are short enough. Because more current equals a brighter LED you will end up getting a on average brighter display. I think the most trivial thing to get right will be the refresh rate of your LED cube. To avoid flickering you would want a refresh rate of 200-ish Hz. In one cycle all 64 rows should've been illuminated at least one time. This means you will end up with a switching frequency of 200 * 64 = 12.8kHz. This probably will be unfeasible to do on an Arduino uno as it isn't fast enough.

Universal LED cube library available at: https://forum.arduino.cc/index.php?topic=336469.0 :)
16x16x16 RGB LED cube: https://www.youtube.com/watch?v=JIGoYRGJOZk

Grumpy_Mike

Their are two problems with increasing the brightness of an LED to compensate for a long duty cycle.
1) If the code doing the multiplexing hangs for any reason the LED currently on will burn out.
2) Not all LEDs are designed to be able to take pulses above the maximum continuous current mentioned in the data sheet. In short if the data sheet does not say you can pulse them, or pulse them with a duty cycle longer than specified in the data sheet then the LEDs can burn out. I was once involved in a long expensive legal dispute over this precise question.

WonderTiger

I agree with both points you made. However, it shouldn't be too hard to design a bit of circuitry that monitors the pulse width of let's say the output enable. When this circuit detects that the pulse width exceeds the maximum allowable time, it can then for instance kill the power to the transistors driving the LEDs.
Universal LED cube library available at: https://forum.arduino.cc/index.php?topic=336469.0 :)
16x16x16 RGB LED cube: https://www.youtube.com/watch?v=JIGoYRGJOZk

Grumpy_Mike

Yes you can. Such a circuit is called a missing pulse detector. It works by firing a monostable on an edge and discharging a capacitor. When the voltage on the capacitor reaches a certain value, indicating the pulses have stopped, you detect this with a comparator and shut things down. You could do this with a couple of NE555 chips.

Go Up