C5 · Lesson 27 · Transistor models lab
MOSFET, BJT and JFET models and their operating points, in Python
Lessons 15 to 24 solved transistor circuits by hand: guess a region, solve, check the guess. A circuit simulator does the same with models that cover every region at once and a solver that never has to guess. In this lab you'll write those models for the MOSFET, the BJT (the Ebers–Moll model, which handles saturation without special cases) and the JFET, a bisection solver that finds a MOSFET's operating point in either region, and a worst-case check of a bias design.
Play
- The curves are a MOSFET's drain current against drain voltage, at three gate voltages half a volt apart, from one model that covers cutoff, triode and saturation.
- Raise λ: the saturated parts of the curves tilt upward.
- Watch the knees: each one sits at , which moves with the gate voltage.
Predict
The Ebers–Moll model is asked for a saturated BJT's at a forced β of 10, with β = 100 and a reverse β of 1. What does it give?
About 0.07 V: = 25.85 mV × ln 13.3. The 0.2 V rule of thumb is for real parts, whose collector and emitter resistances add a drop the ideal model leaves out. The model's own number shows that a deeply saturated junction pair really can sit within a few tens of millivolts.
Name it
One MOSFET model for every region
with . Applying in both regions keeps the current continuous at the knee, as SPICE's level-1 model does.
Solving a bias circuit without guessing
For a MOSFET with and , try a current I: it fixes and , and the model then says what current the transistor would carry at those voltages. The function
falls steadily from positive to negative, so bisection between 0 and finds the operating point in whichever region it lies.
Ebers–Moll
The BJT as two coupled diodes:
In the active region is negative and ; in saturation both junctions conduct, and solving the two equations for a forced β gives
Worst-case bias
A bias design has to work for every part it might be built with. For divider bias, the current is lowest with the smallest β and the largest , and highest with the largest β and the smallest ; checking those two corners bounds every combination in between.
Worked example
Solve lesson 17's first circuit ( = 10 V, = 5 V, = 2 kΩ, = 3 kΩ, K = 1 mA/V², = 1 V) and its second ( = 0, = 10 kΩ) with the bisection solver.
Show the solution
- First circuit. Bisection on settles at 1.2192 mA, with
- Check its region. The drain is above = 4 V, so it's saturated, matching the quadratic formula's 1.22 mA.
- Second circuit. The same solver gives 0.9748 mA and = 0.2516 V, in triode.
- What did the work. No region was guessed in either case; the model's own switch between formulas did the work.
Answer the first circuit settles at 1.2192 mA in saturation ( = 6.342 V), and the second at 0.9748 mA in triode ( = 0.2516 V).
Worked example
A BJT model with A, = 100 and = 1 has = 0.70 V and = 0.60 V. Find , and the forced β, and check the saturation formula.
Show the solution
- The two exponentials.
- Currents. Then = 0.552 mA and = 17.8 µA.
- Forced β. That's well below 100, so it's saturated.
- Check the saturation formula. With β_forced = 31.0, exactly . The formula is the model, solved in reverse.
Answer = 0.552 mA and = 17.8 µA, a forced β of 31.0, and the saturation formula gives back exactly the 0.1000 V between and .
Worked example
Lesson 30's divider bias (47 kΩ over 10 kΩ on 12 V, = 1 kΩ) must work for any β from 50 to 300 and any from 0.6 to 0.8 V. What range of currents can it give?
Show the solution
- Low corner. With β = 50 and = 0.8 V,
- High corner. With β = 300 and 0.6 V, = 1.465 mA.
- Compare with nominal. Nominal (β = 100, 0.7 V) is 1.299 mA, so the spread is −13.5% to +12.8%.
- If that's too wide. A design that needs the current within 5% needs a larger emitter voltage, a stiffer divider, or feedback.
Answer it can give anywhere from 1.124 mA to 1.465 mA, −13.5% to +12.8% around the nominal 1.299 mA.
Check
Step 1. Write mos_id(vgs, vds, K, Vt, lam=0.0) returning the drain current of an NMOS in any region, as in the reading.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write mos_bias(VDD, RD, RS, VG, K, Vt) returning (I, VS, VD) by bisection on between 0 and (take λ = 0). Your mos_id from step 1 is available.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write ebers_moll(vbe, vbc, IS=1e-15, bf=100, br=1, VT=0.02585) returning (ic, ib), and vce_sat(beta_forced, bf=100, br=1, VT=0.02585) from the saturation formula.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write jfet_selfbias(Idss, Vp, Rs) returning (ID, VGS) for a self-biased n-channel JFET: the root of Shockley's equation with that keeps between and 0.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write bias_corners(VCC, R1, R2, RE, bmin, bmax, vmin=0.6, vmax=0.8) returning (Imin, Imax), the emitter currents of a divider-biased stage at its two worst-case corners.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What saturation voltage does the Ebers–Moll model give at a forced β of 10, with = 100 and = 2?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
Check
Divider bias of 39 kΩ over 15 kΩ on 9 V with = 2.2 kΩ must work for β from 40 to 400 and from 0.6 to 0.8 V.
(a)
What's the lowest emitter current?
Write units the way you normally would: 1.5 mA, 1500 µA and 0.0015 A are the same answer.
(b)
What's the highest?
Explain why
Why does a circuit simulator use models that cover every region, instead of the hand method of guessing a region and checking it?
The hand method works for one transistor, but with many transistors the number of region combinations to guess grows quickly, and a wrong guess has to be found and undone. A model that gives the current in every region with one continuous function lets the solver simply find where all the equations agree, by bisection for one unknown or Newton's method for many, without ever deciding the regions in advance. The region falls out of the answer. Continuity at the region boundaries matters too, because a solver can stall or jump if the function it's solving has a step in it.
Practice
Keep practicing
3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.