How to Test Transistor Characteristics in LTSpice


If you are considering starting LTSpice, check out this post first: An Introduction to LTSpice This post is a continuation of my LTSpice topics and may be confusing to first users.

Starting to understand bipolar transistors is difficult, simulation and experimentation can make it easier. This post will be about setting up a circuit to get the same type of characteristic graph seen for NPN transistors seen in class (works with PNP too, but circuit setup is different). Here is a general look at how this is visualized:

Generally, 10uA steps are used to visualize how the output current (Ic) is amplified. The output is typically measured in a range of milliamps.

These characteristics typically change (although follow the same pattern) based on several values based on the transistor’s leg names: collector, emitter, and base measurements (voltage and/or current). Also, a contributing factor is the current gain called beta. There is another factor called alpha, but can be calculated from beta by:

\alpha =\frac{\beta}{1+\beta}

Conversely, beta can be calculated from alpha by:


Beta values are typically listed in the datasheet of bipolar transistors.
The values above are important to circuit designs with transistors involved.

Testing Circuit

In order to get the same looking graph (very good info to have for specific transistors, models change based on what parameters they have in LTSpice), I’d suggest using a testing circuit like this:
There are two parts that I have not used in the context of these posts: the current source I1, and transistor Q1.
Search for “cur” in the component library and place the device where it is located in the circuit. Make sure to rotate the component so that the arrow is facing up, as that is the current direction we want.
Search for “npn” in the component library and place/rotate as seen in the diagram. The values of the resistor on the left of the circuit (200k and 100k) are for reducing input current to microAmpere levels. The input current is connected to the base leg of the NPN transistor. Next, change the name of the transistor (not Q1, but the text below that) by right-clicking it:
Name the transistor something unique and easy, I just use “myNPN” by default. This custom name will be used in a particular spice command that lets the transistor behave as any model in the program’s library, but can be edited quickly. Before adding the command, right-click the transistor and press the “Pick New Transistor” button.
This will bring up the list of all the models the program installs with by default (quite a bit to use just for transistors). Any of the names on the left can be used in the command; here is the list that I see:

Make sure that in the SPICE model column that the transistor has a beta factor to edit (will be called bf=# or BF=# in that line somewhere).
Then use the following command to “copy” attributes to the transistor in the diagram, (press the “S” key to bring the spice command window up):
This allows us to quickly edit any parameter of the 2N2222 (replace 2N2222 with any other name to test different versions) transistor in the library. In this case, we are only interested in the beta factor as that is a main key factor in a bipolar transistor. The Bf=# can be any number, expect less significant values with a lower number though.


To obtain the same output characteristic on the virtual O-Scope, a special simulation must be used. The DC Sweep will be used to sweep both of our sources: the input voltage V1 and the input current source I1. The DC voltage is typically swept in a smooth linear fashion while the current source is stepped with significant micro amp stages. To achieve this, click run and swap to the DC Sweep tab and edit the first source as seen here:
V1 is the source we sweep, we are using linear interpolation, start at 0V, end at 16V (can be any number of preference), and increment each 0.1V. This will create a smooth linear input voltage rise. Then click the 2nd Source tab to edit the values for the current source I1:
The second source is stepped in significant stages with linear interpolation. Begin with 0A and end with somewhere around 200uA (can be more or less, depends on transistor choice and beta value, that is why experimentation works best with this method). Use an increment value of 10uA steps or anything beneath 200uA. Smaller steps will take longer for it to simulate but will be more accurate. Larger steps will take less time, but will not be a good representation of data. Click OK and there are a few places to consider measuring for experimentation. Specifically for getting the same graph as I mentioned before, probe the current on the leg where the 1k ohm line goes into the transistor (the collector). A special symbol will show up if one hovers over the leg. Here is the output I get with a beta factor of 50 on a 2N2222 transistor with the default setup:

What can be interpreted from this graph? For example, it takes around a 10V input to obtain a 9mA boosted signal from an input of 200uA because the transistor hasn’t saturated yet for lower levels of voltage input (the beta value is affecting this). Amplification needs to be consistent for most applications, so it would be best to have an output that doesn’t change that much per input voltage change. After 10V (for the top orange line), the output does gradually increase current, but not significantly. The measurement from when it levels off around 10V to the full 16 volts is only a 544.51uA difference while the difference between 0mA and 9mA is a steeper change. This is pretty useful information with certain designs. One final detail to mention is that beta and/or alpha can actually be represented visually because there are three more equations to mention that are key for transistors like this:


Beta can be solved for:


Alpha can be solved for:


To accomplish this in LTSpice right click on the O-Scope area and click Add Traces.
In expression(s) to add, type (or click the data points and add a / between them) Ic(Q1)/Ib(Q1) to plot beta:

Notice how they all float around 50 after the transistor stabilizes. This is expected because beta is held to be a constant value, so the graph is reasonable for the changing input current versus changing input voltage. To plot alpha, do the same process but use Ic(Q1)/-Ie(Q1) [negative Ie as Ie is the opposite of Ic to get positive values]:

This is also expected because alpha is calculated from beta and should be around 0.99.

1 Like