Clarification and help with Transistors in LED Matrix

I'm not very familiar with the functions of electronic parts but I know that the transistor can amplify a current. First off, I would like to know which to use, PNP or NPN. What I was planning to do with the shift registers is send a signal to some transistors that would then amplify the current as each LED needs 20 mA to function. I would have one shift register turning on the Anodes while the other turning on the Cathodes. Do I have the right idea? No heavy terminology please and if you do have some heavy terminology please clarify what it means.

PNP for the anodes. NPN for the cathodes.

But the leds don't need 20mA to run. That's the max they can take. They will look nearly as bright at 10mA, and still OK at 5mA, especially if they are the modern high brightness type with the clear lenses.

Do you know how much current each pin on the 74HC595 delivers?

About 20~25mA I think. But the chip has an overall limit of 70mA. So if all 8 outputs need to source or sink current at once, you have to limit each output to about 8 or 9mA.

So I would place a resistor between the LEDs and the output pins of the shift register?

You will need series resistors whether you use transistors or not. 8 of them, either one on each column or one on each row. If using transistors on both the columns and the rows, you can use a low value series resistors (eg. 150R). If transistors on either rows or columns but not both, you must use higher value series resistors (eg. 510R) so that you don't exceed the 70mA limit of the '595. If using no transistors, you will need higher still value series resistors (eg. 1K2) to avoid overloading each pin of the '595. The higher the series resistors value, the dimer the leds will be. You will also need a base resistor (eg. 4K7) for each transistor.

Don't forget you should have a 0.1uF bypass cap for each chip. A 10uF reservoir cap would also be a good idea.

So your circuit could be as complex as two chiips, 16 transistors, 24 resistors and 3 caps. Or you could simplify it to one chip, one resistor, 2 caps.

How would I set this up with one chip and one resistor?

You can use the 74HC595 with current limit resistors to drive the anodes, and a TPIC6B595 to sink the current from each cathode one at a time. Or 8 NPN transistors with a resistor between an Arduino pin and the NPN base.

You can also do it (just) for an 8 X 8 matrix without any transistors or shift registers https://www.arduino.cc/en/Tutorial/RowColumnScanning
The trick is that, at any one time, only one led is lit. The diagram here does not show any series resistors, but you must include 8 of these.

Google for Arduino LED Matrix to see other examples

Or read this to find out what you are trying to do :- Arduino Workshop

BruceBerrios:
How would I set this up with one chip and one resistor?

Use a max7219 chip, as was suggested to you on the other thread you started.

PaulRB:
Use a max7219 chip, as was suggested to you on the other thread you started.

These are quite expensive, but do at least save a bit of soldering.

6v6gt:
These are quite expensive, but do at least save a bit of soldering.

If you buy a genuine Maxim chip they are expensive. But most max7219 chips available on eBay etc are "copies" which seem to work fine 99.5% of the time, and are probably cheaper than the 595 plus the all those other components you would need.

A row scan circuit seems like what I'm aiming for. So I'll use a 75HC595 to control PNP transistors that will function as a current source. Then I guess I'll use 8 pins to sink the current. Would this work if I want all the LEDS to on at the same time?

Yes, but you will need to use 8 series resistors around 500R to avoid overloading the 595. Combine that with a 1 in 8 multiplex, it's not going to be very bright. Ok for indoors and as a practice circuit.

If you want brighter, you could use a tpic6x595 to sink the cathode current, as Crossroads suggested.

I just need it for indoors. Thank you for the information.

This image says I need a 4k7 and a 2k7 resistor for the PNP. Why do I need this much resistance?

shapeimage_9.png

I'm not sure the 4K7 is critical. You could leave it out and see what happens. Could be is just to prevent random flashing when the Arduino starts up.

The 2K2 limits the current that flows from the PNP base pin to the Arduino pin. The value is high because only a little current is needed for this. That small current is amplified by the transistor to a larger current flowing to the matrix row. Strictly speaking, the transistor is not "amplifying" the current, because the output current does not change if there is a small change in the input current (the base current). The transistor is not in its "linear" region where that would happen. Rather it is in its "saturation" region where it acts more like a switch.

This image says I need a 4k7 and a 2k7 resistor for the PNP.

They are not current limiting resistors for the LED path they are current limiting resistors for the FET / transistor. You will still need to limit the current on the line that only has one LED on at a time.

BruceBerrios:
Then I guess I'll use 8 pins to sink the current.

Ah, did you mean 8 Arduino pins, or the pins of another 595? If using Arduino pins, you can sink a bit more current than the 595, 20mA per pin vs 8~9mA per pin. This is because the Arduino has a 200mA limit vs the 70mA limit of the 595. That means you can use lower value series resistors (eg.150R) for the leds.

So essentially, I have a 74HC595 connected to my Arduino. PNP transistors connected to the 74HC595 with a 2k Resistor in the base. The PNPs collector connected to each cathode row. Then the anode columns connected to a resistor of 150R back to pins on the Arduino. This will allow me to do whatever I want with the array, such as turning all the lights on without any problems correct?