I provided a very simple NPN transistor set up and hFE values as shown below.

2N2222 datasheet

I am trying to calculate parameters such as base current, collector current, Vce using hFE (beta).

The base signal is a 5V pulse.

The formulas that I followed:

Ib = (Vcc-Vbe) / ( Rb + (beta+1)x Re. Here Vcc is 5 V pulse

Vcc = Vce + Ic( Rc + Re) I assumed that Ic is almost same as Ie and Vcc is 20 V here.

No matter what beta values I use, I cannot get the same Ib with LTspice. There is a huge difference between the LTspice result and the calculations.

Since I couldn't calculate the base current corrently I cannot use the second formula.

How should I use these formulas considering the hFE?

enter image description here

Source: my study

enter image description here

Source: https://pdf1.alldatasheet.com/datasheet-pdf/view/15067/PHILIPS/2N2222.html

  • \$\begingroup\$ You never said how much your Vce and Ic are. If you bias the transistor to 10V Vce and 150mA Ic like in the data sheet, what value of Ib and hfe you get? \$\endgroup\$
    – Justme
    Commented May 17 at 6:23
  • \$\begingroup\$ Do not confuse \$V_{CC}\$ and the input of +5V from V18. Call that input \$V_{IN}\$ to avoid ambiguity. Also, set V18 to produce a permanent +5V DC (not a pulse), and tell us what DC conditions the simulator yields. \$\endgroup\$ Commented May 17 at 7:35
  • \$\begingroup\$ My Vce is 7.4 V so it is close 10 V , Ic is 4.2 mA so it is between 1mA and 10mA. to check whether Ic= beta x Ib formula matches with Ltspice Ib result, ı used beta as 50 and Ib is around 60 uA but ltspice result is around 20 uA. is this still correct ? Another thing if ı use the first formula above to calculate Ib it is around 76 uA @Justme \$\endgroup\$
    – Mhan
    Commented May 17 at 9:10
  • \$\begingroup\$ @Mhan So if you are using different measuring conditions than the data sheet, why do you expect to end up with same hfe as in the data sheet? The hfe is what it happens to be when you measure it. The datasheet simply says, under the datasheet defined conditions, the hfe will be in some defined range, but the range is just very large. Do not calculate currents, measure Ib and Ic, and see if hfe is within specification. \$\endgroup\$
    – Justme
    Commented May 17 at 10:03
  • \$\begingroup\$ You don't state what values you calculated and what LTspice gives. What beta value did you use? The values on the left in the datasheet are the minimums - typically will be much greater. LTspice will be using a typical value. \$\endgroup\$ Commented May 17 at 10:11

3 Answers 3


Beta (or hFE) is a very loosely controlled parameter and can can vary by 10:1 over device to device, operation condition and temperature.

In general a good design is done such that the circuit will work over a wide range of values of beta and not assume a specific value.

In your example you state you are using a beta of 50 - it is more likely that it will be closer to the 300 mentioned in the last row of the table. (Please put that information in the question - not in the comments).

That parameter difference would account for the different results.


Perhaps you are overestimating \$V_{BE}\$. If, as you say \$I_C\approx I_E = 4.2mA\$, then for a 2N2222 with \$\beta\approx100\$, you would expect base current of:

$$ I_B = \frac{I_C}{\beta}=\frac{4.2mA}{100}=42\mu A $$

Then the voltage across base resistor R20 would be:

$$ V_{R20} = I_B \times R_{20} = 42\mu A \times 5k\Omega \approx 0.2V $$

I can predict that emitter potential will be:

$$ V_E = I_E \times R_E = 4.2mA \times 1k\Omega = +4.2V $$

Base potential will be the difference between input potential and the voltage across R20:

$$ V_B = V_{IN} - V_{R20} = 5V - 0.2V = 4.8V $$

Finally, the expected \$V_{BE}\$ will be:

$$ V_{BE} = V_B - V_E = 4.8V - 4.2V = 0.6V $$

If these are close to the values you measure, then nothing's wrong, except your application of the equations. For example, if you assumed \$V_{BE}=0.7V\$ then that would introduce a significant error.


Since I am using an LTspice simulation, I don't need to worry about burning the transistor out, nor about self-heating affecting the results- the junction will sit magically at 27°C even though it is dissipating an imaginary watt or two.

enter image description here

Using the NXP model, I've plotted Ic/Ib as a function of Ic. You can see that the model's hFE at 150mA agrees well with the datasheet range of 100 to 300- it's 150.

Note that at other currents the hFE maximum is unspecified, only the minimum.

If the Vce is very low, the hFE will be less, as the transistor goes into saturation and additional base current yields no additional collector current. In that regime it does not make sense to call it current gain, sometimes it is called "forced beta".

However in your circuit, the transistor is not saturated, and is far from saturation (Vce ~= 7.5V so the datasheet numbers will apply).

If I simulate it, I get Ic/Ib = 211, which agrees with the datasheet (minimum of 50 to 75 over the range of 1 to 10mA and your circuit is running at about 4mA Ic).

Since transistors can have a wide range of hFE (good ones intended and binned for analog use may have a 2:1 range, ones more intended for digital use can have 3:1 or more. If we assume 600 is the maximum gain (wag - or more scientifically around 3x the typical) then at 0.1mA the 2N2222 could have an hFE from 35 to 600, an almost 20:1 range.

The job of the circuit designer in this scenario is to come up with circuits that are not overly sensitive to hFE, so that even if hFE is the datasheet minimum or if it is way higher than typical, or when it changes due to temperature etc., the circuit will operate within requirements and will not require adjustments or trims. That's not always possible or practical. In this case, the emitter degeneration resistor R22 makes the circuit much less sensitive to hFE variations.

This points out a pitfall, if you tweak your circuit on the bench with a given sample of transistor or if you tweak it in simulation with a given model, you can get results that will not be reproducible once you buy many transistors from many different suppliers if your circuit is too sensitive to the allowable variations in parameters. That's the difference between design and tinkering (no offence to actual skilled utensil repair persons intended).

  • \$\begingroup\$ It should be noted that the 2N2222 model that ships with LTspice uses the Ebers-Moll model (instead of Gummel-Poon) which assumes constant \$\beta\$ across all currents. \$\endgroup\$
    – Ste Kulov
    Commented May 17 at 15:47
  • 1
    \$\begingroup\$ @SteKulov LTspice ships with the NXP model I used, and β is obviously not constant over current. The IKF = 0.3 parameter and XTB = 1.5 parameters are specified, so it models β decrease at high current, but not β fall-off at low current, and β increases with temperature. \$\endgroup\$ Commented May 17 at 16:55
  • 1
    \$\begingroup\$ Ahh. Ok. I missed the IKF. Thanks! \$\endgroup\$
    – Ste Kulov
    Commented May 17 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.