TExcelTAD
Home › Analog Electronics: Diodes, Transistors & Op-Amps › Current Sources and Current Mirrors

Current Sources and Current Mirrors

Open the schematic of any op-amp and you will find few resistors and many transistors in pairs, gates or bases tied together. Those pairs are current mirrors: they copy one reference current to wherever it is needed, as tail currents, bias currents and loads. A resistor is a poor current source (its current changes with every volt across it) and a poor load (a large value needs a large supply). A transistor in its active region carries a current that hardly depends on its output voltage, so it is both a good current source and a load of tens or hundreds of kilohms. This lesson builds the basic mirror in bipolar and MOS form, measures its error and output resistance, and then improves it: Widlar, Wilson and cascode mirrors, and the active load.

The basic mirror

basic mirror VCC = 12 V RREF 11.3 kOhm Q1 Q2 to load IO = 1 mA IREF Widlar mirror VCC = 12 V RREF 11.3 kOhm Q1 Q2 RE 11.9 kOhm to load IO = 10 uA IREF

Q1 is diode-connected (collector tied to base). The reference current IREFI_\text{REF} through RREFR_\text{REF} sets its VBEV_{BE}, and Q2, with the same VBEV_{BE} and (if matched) the same saturation current ISI_S, carries the same collector current. With VBE≈0.65 VV_{BE} \approx 0.65\ \text{V},

IREF=VCC−VBERREF,IO=IREF1+2/β(1+VCE2−VBEVA)I_\text{REF} = \frac{V_{CC} - V_{BE}}{R_\text{REF}}, \qquad I_O = \frac{I_\text{REF}}{1 + 2/\beta} \left(1 + \frac{V_{CE2} - V_{BE}}{V_A}\right)

Two errors remain. Base current: IREFI_\text{REF} must also feed both bases, 2IC/β2 I_C/\beta, so IOI_O is low by about 2/β2/\beta (1 % at β=200\beta = 200). Early effect: Q2's current rises with its own VCEV_{CE}, so the mirror is exact only when VCE2=VBEV_{CE2} = V_{BE}, and the output resistance is

Ro=ro2=VAIOR_o = r_{o2} = \frac{V_A}{I_O}

100 kΩ100\ \text{k}\Omega at 1 mA1\ \text{mA} with VA=100 VV_A = 100\ \text{V}. The MOS version is the same picture with M1 diode-connected; the gate draws no current, so the 2/β2/\beta error disappears, the output resistance is ro=1/(λID)r_o = 1/(\lambda I_D), and transistor sizes scale the copy: IO=IREF(W/L)2/(W/L)1I_O = I_\text{REF} (W/L)_2/(W/L)_1. That ratio is the main way IC designers make many currents from one reference.

Better mirrors

Mirror Idea Error RoR_o
basic same VBEV_{BE} (or VGSV_{GS}) 2/β2/\beta plus Early ror_o
with emitter resistors RER_E in both emitters as basic about ro(1+gmRE)r_o(1 + g_m R_E)
Widlar RER_E in Q2 only: small IOI_O from a sensible IREFI_\text{REF} as basic about ro(1+gmRE)r_o(1 + g_m R_E)
Wilson a third transistor feeds back the output current 2/(β(β+2))2/(\beta(\beta + 2)) about βro/2\beta r_o/2
cascode a second mirror stacked on top small about gmro⋅rog_m r_o \cdot r_o (MOS), βro\beta r_o (BJT)

The Widlar mirror solves a practical problem: a 10 μA10\ \mu\text{A} bias from 12 V12\ \text{V} would need a 1.13 MΩ1.13\ \text{M}\Omega reference resistor, large on a chip. Put a resistor RER_E in Q2's emitter only; the two transistors now differ in VBEV_{BE} by VTln⁡(IREF/IO)V_T \ln(I_\text{REF}/I_O), which must appear across RER_E:

IORE=VTln⁡IREFIOI_O R_E = V_T \ln \frac{I_\text{REF}}{I_O}

The equation is transcendental: given IOI_O it gives RER_E directly; given RER_E it needs iteration. The emitter resistor also degenerates Q2 and raises its output resistance. The cascode mirror applies the idea of Multistage Amplifiers and the Cascode: a second transistor holds the copying transistor's drain still.

Worked example

Given: VCC=12 VV_{CC} = 12\ \text{V}, RREF=11.3 kΩR_\text{REF} = 11.3\ \text{k}\Omega, QN transistors (β=200\beta = 200, VA=100 VV_A = 100\ \text{V}, VBE=0.655 VV_{BE} = 0.655\ \text{V} at 1 mA).

Find: IREFI_\text{REF}; IOI_O of the basic mirror at VCE2=6 VV_{CE2} = 6\ \text{V}; its output resistance; and RER_E for a Widlar mirror giving 10 μA10\ \mu\text{A}.

Solve:

IREF=12−0.65511.3 kΩ=1.004 mAIO=1.004 mA1+2/200(1+6−0.655100)=0.9941⋅1.0535 mA=1.047 mARo=VAIO≈100 V1 mA=100 kΩRE=25.85 mV⋅ln⁡(1.004 mA/10 μA)10 μA=25.85 mV⋅4.60910 μA=11.9 kΩ\begin{aligned} I_\text{REF} &= \frac{12 - 0.655}{11.3\ \text{k}\Omega} = 1.004\ \text{mA} \\ I_O &= \frac{1.004\ \text{mA}}{1 + 2/200} \left(1 + \frac{6 - 0.655}{100}\right) = 0.9941 \cdot 1.0535\ \text{mA} = 1.047\ \text{mA} \\ R_o &= \frac{V_A}{I_O} \approx \frac{100\ \text{V}}{1\ \text{mA}} = 100\ \text{k}\Omega \\ R_E &= \frac{25.85\ \text{mV} \cdot \ln(1.004\ \text{mA}/10\ \mu\text{A})}{10\ \mu\text{A}} = \frac{25.85\ \text{mV} \cdot 4.609}{10\ \mu\text{A}} = 11.9\ \text{k}\Omega \end{aligned}

Check: the base-current error (−1 %-1\ \%) and the Early effect at 6 V6\ \text{V} (+5.3 %+5.3\ \%) are of opposite sign; at VCE2=1 VV_{CE2} = 1\ \text{V} the output would be 0.9941⋅1.0035=0.998 mA0.9941 \cdot 1.0035 = 0.998\ \text{mA}. The Widlar resistor is about one hundredth of the 1.13 MΩ1.13\ \text{M}\Omega a basic mirror would need.

In Python: errors and the Widlar equation

python · try it yourself
import math
from scipy.optimize import brentq

VT, VA = 25.85e-3, 100.0
for beta in (200, 50):
    simple = 1 / (1 + 2 / beta)
    wilson = 1 / (1 + 2 / (beta * (beta + 2)))
    print(f"beta = {beta:3d}: IO/IREF simple {simple:.4f}, Wilson {wilson:.5f}")

IO = 1e-3
print(f"Rout simple = VA/IO = {VA/IO/1e3:.0f} kOhm, Wilson ~ beta*ro/2 = {200*VA/IO/2/1e6:.0f} MOhm")

# Widlar: IO * RE = VT ln(IREF / IO)
IREF, IO = 1e-3, 10e-6
RE = VT * math.log(IREF / IO) / IO
print(f"Widlar for 10 uA from 1 mA: RE = {RE/1e3:.2f} kOhm (a basic mirror would need RREF = {(12 - 0.65)/IO/1e6:.2f} MOhm)")
for RE in (1e3, 5e3, 11.9e3):
    IO = brentq(lambda i: i * RE - VT * math.log(IREF / i), 1e-9, IREF)
    print(f"  RE = {RE/1e3:5.1f} kOhm -> IO = {IO*1e6:6.1f} uA")
beta = 200: IO/IREF simple 0.9901, Wilson 0.99995
beta =  50: IO/IREF simple 0.9615, Wilson 0.99923
Rout simple = VA/IO = 100 kOhm, Wilson ~ beta*ro/2 = 10 MOhm
Widlar for 10 uA from 1 mA: RE = 11.90 kOhm (a basic mirror would need RREF = 1.13 MOhm)
  RE =   1.0 kOhm -> IO =   69.1 uA
  RE =   5.0 kOhm -> IO =   20.2 uA
  RE =  11.9 kOhm -> IO =   10.0 uA

The Widlar current depends only logarithmically on IREFI_\text{REF}, so it is also less sensitive to the supply voltage than a basic mirror.

Cross-check with SPICE: IOI_O against the output voltage

Three mirrors share one deck: the basic and Widlar BJT mirrors run from the same reference, and a MOS mirror with RREF=10 kΩR_\text{REF} = 10\ \text{k}\Omega (VGS=2 VV_{GS} = 2\ \text{V} at 1 mA1\ \text{mA}). The output voltage sources are swept and the output current read at three voltages.

bash · try it yourself
cat > mirror.cir <<'EOF'
* Current mirrors from a 12 V supply: basic BJT, Widlar BJT and MOS
.model QN NPN(Is=1e-14 Bf=200 Vaf=100 Br=2 Rb=10 Cje=10p Cjc=4p Tf=0.4n)
.model MN NMOS(Level=1 Vto=1 Kp=2m Lambda=0.02)
VCC vcc 0 12
RREF vcc b 11.3k
Q1 b b 0 QN
Q2 c2 b 0 QN
VO2 c2 0 DC 6
Q3 c3 b e3 QN
RE e3 0 11.9k
VO3 c3 0 DC 6
RREFM vcc g 10k
M1 g g 0 0 MN W=1u L=1u
M2 d2 g 0 0 MN W=1u L=1u
VOM d2 0 DC 6
.control
op
let iref = (12 - v(b)) / 11.3k
let io_widlar = -i(vo3)
print v(b) iref io_widlar
dc VO2 0.2 12 0.1
let io_bjt = -i(vo2)
meas dc io_at_1v find io_bjt at=1
meas dc io_at_6v find io_bjt at=6
meas dc io_at_11v find io_bjt at=11
dc VOM 0.2 12 0.1
let io_mos = -i(vom)
meas dc iom_at_2v find io_mos at=2
meas dc iom_at_6v find io_mos at=6
meas dc iom_at_11v find io_mos at=11
.endc
.end
EOF
ngspice -b mirror.cir 2>&1 | grep -E '^(v\(|i\(|[a-z0-9_]+ +=)'
v(b) = 6.550118e-01
iref = 1.003981e-03
io_widlar = 1.005420e-05
io_at_1v            =  9.974228e-04
io_at_6v            =  1.047122e-03
io_at_11v           =  1.096822e-03
iom_at_2v           =  1.002188e-03
iom_at_6v           =  1.079280e-03
iom_at_11v          =  1.175644e-03

The basic BJT mirror gives 1.047 mA1.047\ \text{mA} at 6 V6\ \text{V}, as computed, and rises 99.4 μA99.4\ \mu\text{A} over 10 V10\ \text{V}: Ro=10 V/99.4 μA=101 kΩR_o = 10\ \text{V}/99.4\ \mu\text{A} = 101\ \text{k}\Omega. The Widlar output is 10.05 μA10.05\ \mu\text{A}. The MOS mirror is exact at VDS2=VGS1=2 VV_{DS2} = V_{GS1} = 2\ \text{V} and rises 173 μA173\ \mu\text{A} over 9 V9\ \text{V}, Ro=52 kΩR_o = 52\ \text{k}\Omega, close to 1/(λID)=50 kΩ1/(\lambda I_D) = 50\ \text{k}\Omega: the course's MOSFET is a worse current source than its BJT.

The active load

Replace a CE stage's collector resistor by a PNP mirror and the small-signal load becomes the mirror's ror_o. The gain is

Av=−gm(ro,n∥ro,p)A_v = -g_m (r_{o,n} \parallel r_{o,p})

For IC=1 mAI_C = 1\ \text{mA}: gm=1 mA/25.85 mV=38.7 mA/Vg_m = 1\ \text{mA}/25.85\ \text{mV} = 38.7\ \text{mA/V}, ro,n=100 kΩr_{o,n} = 100\ \text{k}\Omega, ro,p=80 kΩr_{o,p} = 80\ \text{k}\Omega (QP, VA=80 VV_A = 80\ \text{V}), so Av=−38.7 mA/V⋅44.4 kΩ=−1719A_v = -38.7\ \text{mA/V} \cdot 44.4\ \text{k}\Omega = -1719. A resistor load giving the same gain would need 44 kΩ44\ \text{k}\Omega carrying 1 mA1\ \text{mA}: a 44 V44\ \text{V} drop. Such a high-gain node has a very high output resistance, so it must drive a buffer, and its DC level is set by the two current sources fighting each other: in practice it is defined by an overall feedback loop, as in every op-amp.

The lab holds the small-signal model of this stage (a VCCS for the NPN, two resistors for the two ror_o; no transistors): 1 mV1\ \text{mV} in gives V(out)=−1.719 VV(\text{out}) = -1.719\ \text{V}. Slide RO2 down to 5 kΩ5\ \text{k}\Omega to see what a resistor load would give.

node voltages (to ground 0)in1.000 mVout-1.719 VnetlistV1 in 0 1mG1 out 0 in 0 38.68mRO1 out 0 100kRO2 out 0 80kelement currents (node 1 to node 2 through it)V1in>00 AG1out>038.7 uARO1out>0-17.2 uARO2out>0-21.5 uA

Guided lab: build and test a mirror

Hand calculation. IREF=1.00 mAI_\text{REF} = 1.00\ \text{mA}, IO=1.00I_O = 1.00 to 1.10 mA1.10\ \text{mA} as VCE2V_{CE2} goes from 1 to 11 V.

Simulation. The SPICE sweep above.

What you would measure. Use two NPNs from the same reel, thermally coupled (glued together or touching): discrete parts are not matched like on-chip pairs, and a VBEV_{BE} difference of 2 mV2\ \text{mV} alone gives an 8 % current error (e2/25.85=1.08e^{2/25.85} = 1.08). Feed the output from a second current-limited supply channel through a 100 Ω100\ \Omega sense resistor and step the output voltage from 1 to 11 V; read IOI_O from the drop with a 4124\frac{1}{2}-digit meter. Expect IOI_O within about ±10 %\pm 10\ \% of IREFI_\text{REF} (matching) and a slope of roughly 10 μA/V10\ \mu\text{A/V} (depends on your transistor's VAV_A, often 50 to 150 V). Then add RE=11.9 kΩR_E = 11.9\ \text{k}\Omega in one emitter and check the Widlar current, around 10 μA10\ \mu\text{A}.

Hazards and safe setup. 12 V12\ \text{V} supplies limited to 20 mA20\ \text{mA}. Never connect the output node directly to a supply without the sense resistor and limit: a mistake that saturates Q2 with a hard source can overheat it.

Pitfalls

  • Unmatched discrete transistors. On a chip the two devices sit microns apart; on a breadboard they can differ by 10 % or more. Use a matched pair or emitter resistors with IRE≥100 mVI R_E \ge 100\ \text{mV}.
  • Temperature gradients. VBEV_{BE} falls about 2 mV/K2\ \text{mV/K}; 1 K between the two transistors gives about 8 % error.
  • Saturating the output transistor. Below about 0.3 V0.3\ \text{V} (BJT) or VovV_{ov} (MOS) the copy fails: every mirror has a compliance voltage.
  • Forgetting the base currents of many outputs. Ten outputs from one reference cost 11/β11/\beta; add a beta helper (an emitter follower that supplies the bases).

Practice

  1. A MOS mirror copies IREF=50 μAI_\text{REF} = 50\ \mu\text{A} to a transistor with three times the W/LW/L. What is IOI_O (ignore λ\lambda)?
  2. A Widlar mirror has IREF=1 mAI_\text{REF} = 1\ \text{mA} and RE=5 kΩR_E = 5\ \text{k}\Omega. Start from IO=20 μAI_O = 20\ \mu\text{A} and do one iteration of IO=VTln⁡(IREF/IO)/REI_O = V_T \ln(I_\text{REF}/I_O)/R_E.
  3. A CE stage with an active load has gm=20 mA/Vg_m = 20\ \text{mA/V}, ro,n=150 kΩr_{o,n} = 150\ \text{k}\Omega, ro,p=100 kΩr_{o,p} = 100\ \text{k}\Omega. Find the gain.
Answer
  1. 150 μA150\ \mu\text{A}.
  2. 25.85 mV⋅ln⁡(50)/5 kΩ=20.2 μA25.85\ \text{mV} \cdot \ln(50)/5\ \text{k}\Omega = 20.2\ \mu\text{A}; it has converged (SciPy gives 20.2 μA20.2\ \mu\text{A}).
  3. −20 mA/V⋅60 kΩ=−1200-20\ \text{mA/V} \cdot 60\ \text{k}\Omega = -1200.

Test yourself

In a basic BJT mirror with β=100\beta = 100, the output current is low by about…

  1. 0.1 %0.1\ \%
  2. 1 %1\ \%
  3. 2 %2\ \%
  4. 10 %10\ \%

The output resistance of a basic mirror at IO=0.5 mAI_O = 0.5\ \text{mA} with VA=50 VV_A = 50\ \text{V} is…

  1. 25 kΩ25\ \text{k}\Omega
  2. 100 kΩ100\ \text{k}\Omega
  3. 1 MΩ1\ \text{M}\Omega
  4. 10 kΩ10\ \text{k}\Omega

What does the Widlar mirror make easy?

  1. Very large currents
  2. Small output currents without a huge reference resistor
  3. Perfect matching
  4. Zero output resistance

Replacing a CE stage's collector resistor by a current-mirror load mainly…

  1. reduces the gain
  2. raises the gain to about gm(ro,n∥ro,p)g_m (r_{o,n} \parallel r_{o,p})
  3. lowers the output resistance
  4. removes the need for bias