5x7 (4 LED/module) Matrix, Pls confirm calcs

Hello, Please see the attached schematic. I'm trying to construct a 5x7 LED Matrix (Column scanning) where each module has 4 LEDs. Please let me know if the calculations for the NPN-2n4401 are correct and if you think that this setup will work. Calculations derived from the equations here

Rows = 74hc595 -> NPN 2n4401 Colmuns = 74hc595 -> ULN2803a

Each row will only power 1 module at a time @ 20mA -> handled by the 2n4401 (20mA x1 = 20mA) Each column will sink up to 7 modules at one time -> handled by the ULN2803 (20mA x 7 = 140mA)

I feel like the calculations are well within the hardware's capability, I'm more worried with a flaw in the setup.

Thank you for any advice!

|500x310

Hi, in each "module" you have 4 leds in series, so if Vf is 2V each led then that is 8V in total so your led series resistors should be (12-8-0.75)/20=180 or 200R, if i have understood correctly?

As for your base resistors, Vcc is 5V not 12V and the base current should be a tiny fraction on the 50mA you have assumed. If the transistor gain is, say, 100 (check the data sheet), then the base current should be 0.2mA. 4K7 Base resistors should be fine.

Paul

Thank you Paul. I understand most of your math, but want to make sure I have a firm grasp for future endeavors.

IB = If /hfe = 20mA/100 = 0.2mA (data sheet says gain is 40min to 500max, and I have no way of measuring it, so 100 sounds good)

Rb = (VCC - 0.3 - VBE ) / IB VCC = 5 VBE = 0.7

(5-0.3-0.7) = 4 4/0.2mA = 20,000 ohm

Is this correct?

Firstly, you have the wrong ICs.

See my explanation in this adjacent post.

Paul__B: Firstly, you have the wrong ICs.

The circuit could have been designed much more simply with a better choice of ICs, yes.

If the OP has already purchased the components mentioned, then I think they should continue using those rather than waste them, because I believe they will work. However, if its not too late to change, or the components purchased can be saved for another project, your suggestion is clearly better.

Paul__b, just so that I understand, are you suggesting removing the 74hc595/ULN2803combo at the column sink and replacing them with a TPIC6A595? If this is correct, I love the idea of efficiency, but I have two questions: 1)Since this is not a shift register I won't be able to shift the data out, what if I wanted to increase the number of columns? 2) The TPIC6 seems to only handle 150-250mA per pin whereas the ULN can do 500mA. Is this the correct logic?

edit- it clearly states shift register on the data sheet

jeeep: 1)Since this is not a shift register I won't be able to shift the data out, what if I wanted to increase the number of columns?

It is a shift register and you can increase the number of columns in just the same way.

jeeep: 2) The TPIC6 seems to only handle 150-250mA per pin whereas the ULN can do 500mA. Is this the correct logic?

The ULN can do 500mA per pin, but not for more than 1 pin at a time, whereas the TPIC6C/B can handle that 100-150mA on each pin simultaneously. However, in your circuit, you will only sink current from one column at a time, so the TPIC6C/B is a disadvantage if you do need to sink that much current. But there are the TPIC6595 and TPIC6A595 which have higher capacities, up to 350mA I think. If you think you need more than 350mA perhaps you have another calculation wrong somewhere.

Awesome! Thank you!

PaulRB: If the OP has already purchased the components mentioned, then I think they should continue using those rather than waste them, because I believe they will work.

Hah!

You missed the blunder about the upper 74HC595 and the 12V supply. :astonished:

As to the current ratings, it makes somewhat more sense to multiplex by "row" here - that is, the resistor pull-ups - at a time. If you are using the TPICs, then you can drive the (suitable) transistors with 100 mA or more and have them switch up to a couple of Amps or more, using 1W LEDs if you really needed to.

And as in the other post, it is convenient to chain all the shift registers and drive them with only three pins (as each multiplex step involves setting up all registers anyway).

Paul__B: You missed the blunder about the upper 74HC595 and the 12V supply. :astonished:

Yes, sorry, I did miss that. An npn transistor would be needed between each '595 output and the pnp bases (to pull the bases low and switch the pnps on), plus a pull-up resistor on each pnp base (to switch them off). The npn would protect the 595 from damage due to the 12V.

A possible alternative to the npns and pnps would be a udn2981, if you can find at reasonable price, which is a sort of high-side equivalent of the uln chip.

Sorry, a bit confused. When you refer to pnp what specifically are you referring to? The uln2803? The 74hc595s aren't connected to 12 that's the Npn.

Anyways will the 74hc595, Npn, uln2803 combo work as it is in the schmatic or should I replace these compenents with the ones suggested? thanks

jeeep: Anyways will the 74hc595, Npn, uln2803 combo work as it is in the schmatic or should I replace these compenents with the ones suggested? thanks

Mmmmmm.

What did I say?

Why did I say it?

jeeep: When you refer to pnp what specifically are you referring to?

Ah, apologies again, another error I missed in your original post. You mentioned NPNs (2n4401) but your diagram shows PNPs. PNP would be the right choice in this situation because the transistor is acting as a high-side switch.

jeeep: The 74hc595s aren't connected to 12 that's the Npn.

Although the 595's supply pin is connected to 5V, its outputs are exposed to the 12V supply and could be damaged.

jeeep: Anyways will the 74hc595, Npn, uln2803 combo work as it is in the schmatic or should I replace these compenents with the ones suggested? thanks

As already discussed, they won't work as shown. With the right additional components I still think it could be made to work. If you have not purchased the components yet, switch to Paul__B's suggestions as they are simpler.

Ah, ok now I understand. I apologize for the errors, it was late when I made the schmatic and missed the npn/pnp issue and the calc errors (the other issues I was unaware of).

Utilizing the TPIC6A595 instead of the ULN3803 + 74hc595 makes complete since it can sink high loads and is a shift register too.

Concerning the high side to utilize the 74hc595 I would have to have the following: 74hc595, NPN, PNP to have the 12v. Whereas if I use the TPIC6A595 I will only have to use a PNP. Is this correct?

Thank you

jeeep: Whereas if I use the TPIC6A595 I will only have to use a PNP. Is this correct?

Did I not say that?

Incidentally, the only reason to use a ULN2803 is that it is a convenient array of NPN (Darlington) transistors, so arguably it would just as sensibly be "74HC595, ULN2803, PNP to the 12V".

But the ULN2803 is more-or-less obsolete as its Darlington transistors introduce an undesirable voltage drop (of about 1V) while FET drivers such as the TPIC6x595 have a voltage drop of mere tens of millivolts (which is why as explained above, the actual rating of the ULN2803 is so limited). It may appear cheap to use 74HC595 and ULN2803, but you pay for it in board design and performance.

TPIC6B595 can be found here for 96 cents

Compare that to 74HC595 + ULN2803 + extra assembly time for hand wiring or soldering parts in a board + the extra board space needed.

Another option for the high side switching would be 74hc595 plus udn2981 (or similar).

However, the voltage drop caused by the UDN chip will be even worse than the ULN chip - could be as much as 1.7V. But if the currents are low and the voltage drop is not a problem (8V led forward voltage and 12V supply, so might be ok) then this would be a lower-component-count solution.

Excellent! Thank you guys so much. I will redesign the schematic when i get a chance and upload. Thank you again.

Before I draw the entire schematic I want to make sure I have the core of it correct. Please let me know if I correctly drew what was suggested.

Also, as suggested, I will utilize the Row Scan method. The schematic below uses a PNP 2n4402 which has 600mA continuous current. However, with this setup the resistors that limit the brightness of the LEDs is on the row side. How can I manipulate this schematic so that the LED current resistor is on the column side?

|415x500