# NPN Resistor Values (using the right resistance)

#### ke5nnt

Joined Mar 1, 2009
384
Can anyone explain to me how you find the appropriate resistor values for R1 and R2? I'm not sure how to do that.

Thank You

#### Attachments

• 90.7 KB Views: 52

#### beenthere

Joined Apr 20, 2004
15,819
That will depend on the input voltage. What is the device identified as "logic", and what voltage outputs will it produce?

#### ke5nnt

Joined Mar 1, 2009
384
Logic device is a PIC MCU, +5V input to Vdd, I/O pin connected to NPN base.

#### Wendy

Joined Mar 24, 2008
22,138
If the logic is CMOS style you don't really need R2, since the logic family itself goes to ground when low.

The LED current kind of dictates it. A general rule of thumb is base current is 1/10 the collector current to achieve full saturation.

If the LED is going to use 10ma then you will need 1ma on the base. You can actually use less, the 1/10 rule is only an approximation.

So (5V - 0.6V (BE drop)) / 0.001A = 4400Ω ≈ 4.7KΩ

If the logic family doesn't go to a hard ground then R2 isn't critical, say 10KΩ. It is only there to turn the transistor off.

#### SgtWookie

Joined Jul 17, 2007
22,210
Just to add some basics to Bill's post:

Rb = (Vcc - Vbe(sat)) / (Ic/10)
where:
Vcc = your supply voltage for the current source of the base, not the collector.
Vbe(sat) = the voltage from base to emitter when current is being supplied. Note that this value will vary depending upon the actual base current; the greater the base current, the larger it will be. Minimum is around 0.6v. When driven by a PIC, which has an I/O limit of 20mA, the Vbe(sat) might get as high as 0.9v or even more at maximum base current. It will also change over temperature. Consulting the datasheet for the transistor in question is the best place to get your information; look at the Vbe(sat) plots.

Ic = the desired collector current.

Note again that each PIC I/O pin has a maximum limit of 20mA source or sink. There is also a package limit, and limits on the Vdd/Vss/GND pins for the total package. Consult the Electrical Specifications section of your PIC datasheet; this will vary between different PICs.

Very generally, if you use a 1k resistor on a PIC I/O pin, you're usually pretty safe. That limits the maximum source/sink current to 5mA. If you're below 500 Ohms, you really need to start paying attention to the source/sink requirements of your other I/O pins and total package current.

If you get below 270 Ohms resistance on an I/O pin, you need to be very careful, as you will be operating at/near the maximum current specifications.

Last edited:

#### ke5nnt

Joined Mar 1, 2009
384
If the LED is going to use 10ma then
So (5V - 0.6V (BE drop)) / 0.001A = 4400Ω ≈ 4.7KΩ

Thank you Bill, that makes perfect sense! It might be my imagination, but you write 10mA as .001A, unless you work for NASA, isn't 10mA = .010A?

#### Wendy

Joined Mar 24, 2008
22,138
Base current is 1/10 the collector current. I was figuring the LED took 10ma, so the base took 1ma, hence 0.001A.

The weather dumping on you yet?

#### MikeML

Joined Oct 2, 2009
5,444
Can anyone explain to me how you find the appropriate resistor values for R1 and R2? I'm not sure how to do that.

Thank You

Done for RL = 100, 200, 300, 400 and 500Ω. Note the Led current, and the power dissipation in RL

#### Attachments

• 30.7 KB Views: 25

#### ke5nnt

Joined Mar 1, 2009
384
Base current is 1/10 the collector current. I was figuring the LED took 10ma, so the base took 1ma, hence 0.001A.

The weather dumping on you yet?
Oh ok, makes sense, sorry, mistook what you were trying to say there. Yeah, getting soaked. Just got home yesterday from 2 weeks in Sunny Florida so kinda a bummer to come home to rain and winter weather in the forecast...

To Sarge, thanks for the further explanation. When you say Vcc (supply voltage), is that the 12V main voltage? If I have 1 LED at 20mA 2Vf, I would have 12-2 = 10V/.020A = 500Ω current limiting resistor for the LED. Would the Vcc then be 10V?

Assuming 10V, Rb = (Vcc - Vbe(sat)) / (Ic/10)
Rb = (10 - 0.8) / (0.020/10) Vbe = .8V at 0.020A and 25*C
Rb = (9.2) / (0.002)
Rb = 4600Ω

That right?

Last edited:

#### SgtWookie

Joined Jul 17, 2007
22,210
Just got home yesterday from 2 weeks in Sunny Florida so kinda a bummer to come home to rain and winter weather in the forecast...
Where in FL?

To Sarge, thanks for the further explanation. When you say Vcc (supply voltage), is that the 12V main voltage?
I realized that could be confusing, so I added a clarification say that Vcc in the formula was your base current supply voltage, and not the collector of the transistor in question.
If I have 1 LED at 20mA 2Vf, I would have 12-2 = 10V/.020A = 500Ω current limiting resistor for the LED. Would the Vcc then be 10V?

Assuming 10V, Rb = (Vcc - Vbe(sat)) / (Ic/10)
Rb = (10 - 0.8) / (0.020/10) Vbe = .8V at 0.020A and 25*C
Rb = (9.2) / (0.002)
Rb = 4600Ω

That right?
No, sorry for creating the confusion. The load voltage doesn't come into consideration for calculating Rb.
Rb = (5v-0.8v) / (20mA/10)
Rb = 4.2v/0.002
Rb = 2,100 Ohms

Standard resistance table: http://www.logwell.com/tech/components/resistor_values.html
2k and 2.2k are standard E24 values. You could use either.
4.2v / 2k = 2.1mA
4.2v / 2.2k = 1.91mA

#### ke5nnt

Joined Mar 1, 2009
384
Where in FL?

I realized that could be confusing, so I added a clarification say that Vcc in the formula was your base current supply voltage, and not the collector of the transistor in question.

No, sorry for creating the confusion. The load voltage doesn't come into consideration for calculating Rb.
Rb = (5v-0.8v) / (20mA/10)
Rb = 4.2v/0.002
Rb = 2,100 Ohms

Standard resistance table: http://www.logwell.com/tech/components/resistor_values.html
2k and 2.2k are standard E24 values. You could use either.
4.2v / 2k = 2.1mA
4.2v / 2.2k = 1.91mA
To answer your Q about where in FL, 2 weeks with my mother in Port Charlotte. Had a good time, went fishing several times, and caught some very nice grouper. Tasty!

To the matter at hand, thanks for clarifying Vcc. That helps a lot. Archiving those formulas for future ref. Cheers!

P.S. Fishing pic available upon request.

#### Metalfan1185

Joined Sep 12, 2008
161
Is there a general rule like this that applies to MOSFETS and Power Darlington's as well? I always have trouble selecting the base/gate current/voltage resistors and the pull downs for my circuits.

#### SgtWookie

Joined Jul 17, 2007
22,210
Your question is related, but not the same. You really should start a new topic when it's not the exact same Q that the OP has; otherwise things can get confused in a hurry.

With Darlingtons, you really need to look at the datasheet, as they are all different.

Some have intrinsic Rb's; like the ULN2x0x series driver ICs.

With MOSFETs, if you're using a resistor between gate and source as a "safety", you could just throw in a 10k and be done with it.

As far as snubbing resistors, that really depends on the load you're driving, and if you're seeing "ringing" on the gate.

#### Metalfan1185

Joined Sep 12, 2008
161
I apologise, and thanks...