Go Down

Topic: Help check my (basic) understanding (Read 4979 times) previous topic - next topic


No. Think about a given pattern you may want to display that turns on all 16 leds of a single level (Row) going to a single output pin driving that row. That could be 16 X 20 milliamos of current which is more then the poor row enable pin can supply, hence the need to use 4 switching transistors to drive the 4 levels (Row). That make sense?

 Regardless, I am amidst some heady (for me) reading on transistors and hope to understand the use of them for this project if necessary.  I have some 2N2222's here and was initially planning on using these on the rows but am having some serious trouble understanding the calculations behind choosing correct resistors to use with the transistors.  Any "beginner language" help would be greatly appreciated.

A 2N2222A transistor is really not able to switch 16 x 20ma of current, you need a 'bigger' transistor.

Yes, that does make sense.  I was assuming (incorrectly) that multiplexing was for every LED.  That is, only one LED would ever be lit at a time, not just for those in a single column (driven by a single pin). 

I am starting to track with the transistors and think I am getting some of the math down...

So the max current that would potentially need to be sunk(?) from one level is 20mA*16 == 320mA
I've read that you should build in some sort of safety factor, of say 2, when selecting the transistor.  In this case I would need a transistor with a collector current (Ic) of 640mA minimum.

What should I set by base current (Ib) to?  I understand it can be low.  Is there a rule of thumb at play here?  I'll assume 20mA for the Ib?

Hfe, or the gain (amplification) to the base current, is allegedly calculated Hfe==(5*Ic)/Ib where 5 is a factor used to ensure the switch closes "hard."  If this is correct, Hfe=(5*.64)/.02 == 160mA min.  I think things are falling apart here as I am not finding transistors that seem to fit this math.  If things were correct, I'd now go to the store and try to find a transistor that has a minimum Hfe of 160mA, with a minimum Ic of 640mA, operating at 5V (or should this be 5V - LED voltage drop?).

When trying to "shop" online for a transistor that fits the above specs I was not finding much.  I believe I am doing something horribly wrong here. 


I built an indicator out of various 3mm colored LEDs.  The red, green, yellow, and blue LEDs were all diffused, but the white was clear.  I sanded it with a fine sandpaper and it turned out great.  Easy does it though, a little goes a long way.  I canned my first attempt because I had sanded several flat spots into it.  ;-)  (Technically, I didn't can it, I just use it for breadboard projects where I don't care about the visual quality.  Why waste a good LED?)

At the risk of being a FET pusher, try a small MOSFET instead.  This is the perfect sort of application for them.  You should use a small (100-200R will do fine) resistor for good measure, but the FET gate (analogous to the base of a BJT) has a high impedance, so there's no need to current limit or calculate gains.  You'll need a logic level FET.

I use VN10LPs for moderate current (270mA) -- here's a link to Digikey: http://www.digikey.com/product-detail/en/VN10LP/VN10LP-ND/92610

If you're driving them all at a full 20mA, you'll need something with more gusto.  Here's a ZVN4206A good for 600mA:  http://www.digikey.com/product-detail/en/ZVN4206A/ZVN4206A-ND/92604

Those are both N-channel, so you'll be switching between the LED and ground.  (Same as NPN.)

Nickity, I'm digging this route since, frankly, it seems clearer to me... but that's probably b/c I haven't sunk down into the weeds yet.  Is there a benefit/drawback to running these at 20mA vs something lower?  It looks like the circuit will all be laid out in the same fashion so there isn't much difference between the two.  Would there be any difference in the programming?

Thanks for helping me through this beginning frustration!


It's pretty much that simple.  In my opinion, BJTs are more applicable for linear amplification circuits..  take something and make it bigger (in this case, current.)  FETs are ideal as switches.  They'll both do either, but their characteristics lend themselves to applications.  Some will disagree.

On a FET, you need to provide enough voltage to get it switched fully on.  The spec sheet will list Rds(on) at a particular voltage.  You want to provide the voltage listed in this spec, not the Vgs(thresh) spec.  That's where it's just beginning to turn on.

On LEDs..  the current defines brightness.  More current, brighter.  Less current, dimmer -- and cooler.  :-)  Nothing special there really.


Jan 31, 2013, 02:12 am Last Edit: Jan 31, 2013, 02:18 am by retrolefty Reason: 1
I too prefer logic level mosfets for simple switching applications. There was a time when the price and device choices were not as good as they are today, but now logic level mosfets of all current/voltage ratings are easy to find.

And as far as defining what current to run leds at in led cube applications, that is one of the real advantages of using external serial in/parallel out shift register to drive the columns. They (some of them anyway) have programmable constant current output drivers. So instead of building your design using fixed current limiting resistor and not really knowing how the final brightness will work out you can change a single resistor on a 16 bit shift register that will change the current value for the leds. So you don't have to commit so early in the design to what brightness level you will end up with.



Nickity & Lefty,

Thank you for the patience and for helping me understand these basic concepts.  This is a great, supportive community.  Parts are en route from digi-key.

More questions to come no doubt...

Go Up