Transistors to drive LEDs

Discussions on how to get your MSP JTAG programmer up and running.

Moderator: phalanx

Post Reply
Posts: 13
Joined: Sat Jun 24, 2006 8:00 pm

Transistors to drive LEDs

Post by fredriknyman » Sat Aug 02, 2014 10:27 am

I'm looking at the example at ... _Drive_LED but I'm not sure I follow it.

Could someone please check my understanding?

Given: Vcc = 3.6V on the EXP-MSP4320G2 board

First off, from the article, "When picking a transistor, its datasheet must be analyzed for its characteristic values.".
Any idea why was the PN2369 chosen? I'm not sure what characteristics the author was looking for when he chose that part.

Second, Ra is the current limiting resistor. Formula: Ra =(Vcc - Vf - Vcesat) / If
Vf and If are from LED datasheet, let's call it 2V and 10 mA using the article examples.
Vcesat is from the transistor datasheet. For the PN2369 used, the datasheet says that it's 0.25V max.

Plugging in the numbers, we get Ra = (3.6V - 2.0V - 0.25V) / 0.010 A = 1350 ohm

Is this right -- that is, do I plug in the maximum Vcesat value from the datasheet?

Third, Rb is the base resistor sitting between the transistor base and the MCU GPIO.

From the formula, Rb = [(Vcc - 0.3) - Vbe] / Ib

Where (Vcc - 0.3) comes from the processor datasheet, Voh = high-level output voltage on output ports.
Vbe is given in the transistor datasheet as 0.7 V min, 0.85 V max, so let's call it 0.8 V
Beta is given in the transistor datasheet as 5 (listed as Hfe)

Ib is the current the MCU can drive (source) and the reason we're fussing with the transistors in the first place.
Ib isn't given, but in the linked article and the datasheet (for the msp430g2553), we read that "The maximum total current, I(OHmax) and I(OLmax), for all outputs combined should not exceed ±48 mA to hold the maximum voltage drop specified." Let's assume worst case and have 24 output pins, which would give Ib = 48 mA / 24 output pins = 2 mA

This gives Rb = (3.6 - 0.3 - 0.8) / 0.002 = 1250 ohm

But in the article, a 2K2 resistor is used. Where did I go wrong?

Fourth, if I work backwards and compute Ib = Ic / Beta and use Beta = 5 (from transistor datasheet) I still get Ib = 2 mA and the same result as above.



Posts: 418
Joined: Sun Aug 03, 2008 6:11 pm

Re: Transistors to drive LEDs

Post by UhClem » Sat Aug 02, 2014 10:37 am

One mistake is that you used the small signal current gain (@100MHz) rather than the DC current gain.

User avatar
Posts: 263
Joined: Tue Jun 20, 2006 10:29 am
Location: Lake Tahoe, CA

Re: Transistors to drive LEDs

Post by viskr » Sun Aug 03, 2014 5:08 pm

When you are driving LEDs or loads that are typically on or off, you just want to saturate the transistor.

As to why they chose the PN2369, you would have to ask the author as it is not very common. A more common choice would be a 2N2222 which is made by everyone and can be found lots of places including here at SF.

So the DC beta at 10 mA is spec'd at 75, but most of the time you just overdrive the base, and 2.15K was shown, though 2.2K would be the standard.

The max value would be
Voh - Vbe / 10 mA *75
more like 22.5K
reviving the BASIC stamp

Post Reply