I am trying to plot collector current vs V(CE) in LTspice, but I am getting a blank graph.
Can someone point out what mistake am I making?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
Here's how I might adapt your schematic:
I knew (because I looked) that the 2N2222 has \$\beta\approx 200\$. So I selected an appropriate base resistor, given the collector resistor I first selected. Other than that, there's not much to the adaptation except that I'm using two voltage sources instead of one so that I can sweep out the curves.
(Note that I multiplied the collector resistor by \$\beta\$. You used a factor of only 10 in your case. So that will already get you into trouble. Also, I'm using the DC sweep method available in Spice. Not the .TRAN card.)
Finally, if you feel a need to see the base currents for each curve (reasonable), then add a new plot pane like this:
That's the exact same run. But now you can match up the curve colors with the base current.
LTspice includes an example case called stepmodelparam.asc in its .\examples\Educational folder. Just load it up and run. It includes the feature, also, of varying the Early Effect, as well. But it is all there for you, already.
Here's what happens when you run it:
You can see on the schematic a .DC card (this is a DC sweep) that specifies both V1 and also I1 for the sweeps. (It will sweep one, over and over, while sweeping the other.) The .STEP card then modifies also the VAF parameter for the BJT over a range of values. (The format shown is documented in the help.)
(Their included example has a .PLT file associated with it that will automatically generate the above chart for you. If you were doing this by yourself, you would not have a .PLT file for a newly created schematic. And you'd then need to select the parameter you wanted to chart. But I'm sure you are used to that aspect, already.)
Note there is no use of resistors, nor are any required.
To simulate BJT output curves like this:
I would use a schematic like:
IB: constant current or stepped (parametric sweep). For example 1 uA or 1 uA to 10 uA in steps of 1 uA
VCE: DC sweep 0 V to 12 V
Note how I use the DC simulation (.DC) and not the transient (.tran) simulation!
I don't care how much time the transistor takes so no need to use a transient simulation. Only use the transient simulation when you want to see behavior over time (charging/discharging of capacitors for example).