I'm working on a very basic 4x4x4 LED cube. The LEDs are single color LEDs (blue, in my case) with a max forward voltage of 3.2v. I understand (conceptually) everything about how the cube functions with the exception of one thing: the transistors I need to control each horizontal "layer" of the cube. I've read countless threads, posts, and instructables on this, but yet I'm still confused on it. I'm hoping someone can help me out.
Some basic info:
- Using a standalone ATMEGA328
- 16 vertical cathode columns driven by two 74HC595 shift registers
- 4 horizontal anode layers
Why?:
- To learn & understand multiplexing with shift registers better
- To learn about PCB creation for small projects
- To have a cool thing to play with
I have the following schematic (please be gentle, I'm still learning how to make schematics):
My confusion is how to control the 4 anode layers. I have seen many people using NPN BJT transistors, but they tend to have common cathode layers instead of anode - which leads me to believe that I need 4 PNP transistors? Is that logic correct?
My understanding is that at any given time, only one layer will ever be "lit" at once, meaning a maximum of 16 LEDs will be on. If each LED has a forward current of 20mA, then at most I need a transistor that can handle 16 * 20mA = 320mA at once. Assuming I was right about needing a PNP transistor, would a 2N2907 PNP transistor be fine? It can handle 600mA (seems like overkill, but it's what I currently have).
If that is sufficient, how do I go about connecting it in my schematic? I'm assuming it would be placed somewhere in the "Anode Layers" block of my schematic. I'm unsure of how to wire it up to the rest of the circuit. If possible, can someone help me with that? I'm sure there needs to be another resistor in there, but as for where, I'm unsure. Thank you!