No, the 74HC595 has a total max current of 70mA, so the max per LED would be only 8~9 mA. That might sound enough, but don't forget to factor in the 1:8 multiplex ratio, making the average current per LED only ~1mA!
Better to use TIPC6B595 which can sink plenty, but can't source, so would you would need to make the columns your cathodes and maybe use a 74HC595 or 8 Arduino outputs to drive 8 * p-channel FETS to drive the anode layers.
If you must use your 74HC595s, pair each up with a ULN2803 to sink the current from each common-cathode column.
There was a recent thread about this - do a search!
No. 74HC595 is only good for 70mA total, so 8-9mA per output.
Better bet is TPIC6B595, can sink more than 20mA per output while being pulsed (150mA continuous).
Use 8 of these to sink current from cathode columns.
Use p-channel mosfet to source current to anodes connected in layers.
Use 9th TPIC6B595 to pull gate low on the p-channel mosfet to turn them on.
I offer a card with up to 12 TPIC6B595s, add 64 current limit resistors and 8 P-channel devices and start building the cube!
Card has 96 IO, if feeling adventerous can even go to 9x9x9 cube & use 90 of the 96 IO. http://www.crossroadsfencing.com/BobuinoRev17/
lRaHl:
I really don't want to change the physical design of the cube layers (cathode) columns (anode).
Why not? Did you already solder up the cube?
Yes, it is near completion. I chose to build it this way to simplify the build process and provide the maximum distance between the LEDs. Since the anode lead is always the longest it easily overlaps the LED in the previous layer as shown below in the first image on the corner of the cube. By constructing the cube this way there is no need to modify the lengths of the LED leads before building.
You mentioned that one before Bob. I checked the data sheet and max current appears to be 100mA, so only a little better than 70mA for the 74HC595. Would need 160mA for 20mA per output (obviously), so did I read the sheet wrong? It does say "see note 3", but that read ambiguously to me.
CrossRoads:
There's this one.
CD74AC164.
Need N-channel MOSFETs or NPN transistors to sink 1.28A of current from the layers.
So I could daisy-chain 9 of those with the last controlling transistors/MOSFETs of some type to turn the layers on and off?
Question #1: How do I connect those ICs to the Arduino and to each other.
Question #2: Can I still use the shiftOut function?
Question #3: What is a suitable transistor/MOSFET?
You could use shiftOut, connecting the data pin to DS1 or DS2 and clock to CP by the looks of things. Better to use SPI library for more performance.
What concerns me is there seems to be no serial data out from the chip, so maybe you can't daisy chain them and would need one arduino output for each register, and no latch pin either...
I would use SPI and direct port manipulation for a control pin (high into DS1 while using DS2 as serial data in).
if (time elapsed for next update){
set time for next update
clear the cathode drivers - use MR/ or shift in 0's
shift in 8 anode bytes
shift in next cathode bit
}
Use DS1 as active high ssPIN,
Feed Q7 to DS2 of next device.
I have not used this one. I have used 74AC299PC which is comparable (has a couple more control lines).
Paul, You mentioned using the ULN2803 to sink current for the cathodes.
Since I want to use 9 shift registers, 74HC595, could I pair them each to a ULN2803? Eight to the anodes and the last pair for the cathodes?
Can I source and sink current through the ULN2803?
Can use HC595 to source current to anodes, just limit it to 8mA.
(Vs - Vf - Vc)/.008 = resistor value
Vs = 4.8V from HC595 - IOH drops with higher current - 0.2V loss at 6mA, could be as high as 0.52V (assuming similar drops with Vcc at 5V vs 4.5V in datasheet).
Vf = drop across LEDs (varies by color, blue typically ~3.7V)
Vc = drop across cathode sink device:
N-channel MOSFET will be lowest, NPN will be higher, ULN2803 even higher, like 1.3-1.6V.
ULN2803 only good for 500mA/IO, will be on the edge with 8mA/column, may need to use 2 IOpins/layer. Blue may not even turn on if Vf is 3.7V.
3.7V + 1.3V = 5V, greater than 4.8 that will be available.
Better off with MOSFET, with low Rds of 0.025ohm will have just 12.5mV drop & hardly any power dissipation:
P=I2 * R = 1.281.28*.025 = 41mW.
ULN2803 only sinks current.
You could use them as anode "anti-drives" (just made that up):
+5 to current limit resistor to the anode.
When UNL2803 output is off, current flows into LED.
When ULN2803 output is on, current flows thru the ULN2803 instead, and LED stays off.
Then on the cathode, 4 ULN2803 IO pins/layer can sink the1.28A coming down the columns. Will be quite warm, maybe use a while chip per layer. I'd wire up just 1 layer to start, do some testing.
Still the question if there's enough voltage left for the LEDs to turn on.
CrossRoads:
Can use HC595 to source current to anodes, just limit it to 8mA.
(Vs - Vf - Vc)/.008 = resistor value
Vs = 4.8V from HC595 - IOH drops with higher current - 0.2V loss at 6mA, could be as high as 0.52V (assuming similar drops with Vcc at 5V vs 4.5V in datasheet).
Vf = drop across LEDs (varies by color, blue typically ~3.7V)
Vc = drop across cathode sink device:
N-channel MOSFET will be lowest, NPN will be higher, ULN2803 even higher, like 1.3-1.6V.
ULN2803 only good for 500mA/IO, will be on the edge with 8mA/column, may need to use 2 IOpins/layer. Blue may not even turn on if Vf is 3.7V.
3.7V + 1.3V = 5V, greater than 4.8 that will be available.
Better off with MOSFET, with low Rds of 0.025ohm will have just 12.5mV drop & hardly any power dissipation:
P=I2 * R = 1.281.28*.025 = 41mW.
ULN2803 only sinks current.
You could use them as anode "anti-drives" (just made that up):
+5 to current limit resistor to the anode.
When UNL2803 output is off, current flows into LED.
When ULN2803 output is on, current flows thru the ULN2803 instead, and LED stays off.
Then on the cathode, 4 ULN2803 IO pins/layer can sink the1.28A coming down the columns. Will be quite warm, maybe use a while chip per layer. I'd wire up just 1 layer to start, do some testing.
Still the question if there's enough voltage left for the LEDs to turn on.
I want to use nine 74HC595s, with 8 using your idea of the "anti-drives" for the anodes, and the last register using transistors or MOSFETs. I think I should use transistors or MOSFETs for the layers (cathodes) since the current is higher than the UNL2803 can handle.
What do suggest I use for the layers? Can you also explain your "anti-drive" setup in more detail? I know the outputs from the 74HC595 go the the UNL2803 then after that I am confused.
See if this helps.
In this case I shifted 1's into the TPIC6B595 to sink current from the anodes so they didn't turn on when the cathode was low.
When 0 was shifted in, the current flowed into the LED anodes. Those are the 64 anode columns.
I used ULN2803 to sink current from columns, in your case use a bigger transistor to sink current from a whole layer.
CrossRoads:
See if this helps.
In this case I shifted 1's into the TPIC6B595 to sink current from the anodes so they didn't turn on when the cathode was low.
When 0 was shifted in, the current flowed into the LED anodes. Those are the 64 anode columns.
I used ULN2803 to sink current from columns, in your case use a bigger transistor to sink current from a whole layer.
I still don't understand how that works. What do I need to modify in this schematic?
You need a resistor from V+ to the anode.
You need a 2nd '595 and ULN' connected to the anode.
Replace the ULN on the cathode with a heftier transistor that can sink current for the whole layer.
When the Anode is NOT pulled low and the cathode layer is pulled low the LED will turn on.
When the Anode IS pulled low and the cathode layer is pulled low the LED will NOT turn on.