C6 · Lesson 30 · Analog switches and multiplexers
MOSFETs as switches for signals, and the resistance, charge and leakage they bring along
Lesson 29's sample-and-hold needed a switch that could connect a signal to a capacitor and then let go of it cleanly. The same part routes eight sensors into one ADC, changes an amplifier's gain or a filter's corner under software control, and chops signals in auto-zero amplifiers. It's a MOSFET, or rather a pair of them, used as a voltage-controlled resistor. An ideal switch would be zero ohms on and infinite off and would add nothing to the signal. A real one has an on-resistance that changes with the signal, dumps a little charge every time it opens, leaks when it's off, and couples high frequencies through its capacitance. Each of those sets a limit you can calculate.
- On-resistance against signal voltage for a CMOS transmission gate on a 5 V supply: an NMOS and a PMOS in parallel, each with = 1 mA/V² and threshold 0.7 V. The two dashed curves are each device alone.
- The NMOS conducts well near ground and stops near the top; the PMOS does the opposite. In parallel, with matched devices, their conductances add to a constant across the middle.
- Lower the supply and watch the flat region shrink: below about twice the threshold, there's a gap where neither device is on.
Predict
An NMOS switch on a 5 V supply ( = 0.7 V) passes signals well near ground. What happens to a 4.5 V signal?
The NMOS needs its gate at least a threshold above the signal, so with 5 V on the gate it stops conducting once the signal nears 4.3 V (less, with the body effect). Signals near the positive rail need a PMOS, whose gate is pulled to ground, and a switch that must pass the whole range uses both in parallel: the transmission gate.
Name it
The MOSFET as a resistor
With almost no voltage across it, a MOSFET in triode is a resistor whose conductance is set by its overdrive. For a signal at with the gates at (NMOS) and 0 (PMOS):
each zero when its overdrive is negative. In a transmission gate they're in parallel, and with and equal thresholds, wherever both conduct
is independent of the signal. The body effect raises the thresholds as the signal moves from the bulk's rail, so real switches show a gentle bump in the middle instead of a flat line. At low supply voltages there's a gap near mid-supply where neither device conducts, which is why low-voltage switches boost their gates with charge pumps.
Errors a switch adds
- On-resistance and its variation: in series with a load it forms a divider, , and any change of with the signal is distortion. Feed the switch into a high impedance, such as an op amp's input, and hardly matters.
- Bandwidth and settling: (plus the source's resistance) charges the load and the switch's own capacitance. Settling to within takes ; for an -bit converter's half LSB, .
- Charge injection: when the switch opens, the channel's charge leaves through both ends, roughly half each, and the half that lands on a hold capacitor makes a step . The gate's falling edge also couples through the overlap capacitance. A larger shrinks the step but slows the circuit; complementary or dummy switches cancel much of it.
- Leakage: an off switch leaks nanoamps or less, which through a source resistance is an error of . In a multiplexer, every off channel's leakage lands on the shared output.
- Off isolation and crosstalk: an open switch is still a capacitance , so a signal at frequency couples into a load with a gain of about while that's small.
Multiplexers
A multiplexer is switches sharing one output. The output node carries the capacitance of every switch, on or off, so its settling time grows with the channel count, and break-before-make timing keeps two channels from shorting together during a change.
Worked example
A transmission gate on 5 V has matched devices with = 1 mA/V² and = 0.7 V (ignore the body effect). Find its on-resistance at 0.5 V, 2.5 V and 4.5 V.
Show the solution
- At 2.5 V. Both devices conduct: so = 1/3.6 mS = 278 Ω.
- From 0.7 to 4.3 V. The sum is = 3.6 mS anywhere in this range, so the resistance stays 278 Ω.
- At 0.5 V. Only the NMOS conducts: which is 263 Ω.
- At 4.5 V. Only the PMOS conducts, with the same 263 Ω.
- Compare. The resistance varies only 5% across the whole range, against an NMOS alone that goes from 263 Ω to open.
Answer the on-resistance is 263 Ω at 0.5 V, 278 Ω at 2.5 V and 263 Ω at 4.5 V.
Worked example
A switch with = 10 µm, = 1 µm and = 5 fF/µm² opens with 3 V of overdrive onto a 10 pF hold capacitor. Estimate the charge-injection step.
Show the solution
- Channel charge.
- Step on the hold capacitor. About half goes to the hold capacitor:
- In LSBs. For a 12-bit converter with a 5 V range (an LSB of 1.2 mV), that's six LSBs.
- Reducing it. Quadrupling the capacitor gets it under two LSBs but quadruples the charging time; a half-size dummy switch, shorted and driven by the opposite clock, absorbs most of the charge instead.
Answer the charge-injection step is about 7.5 mV.
Worked example
An 8-channel multiplexer has 100 Ω on-resistance and 5 pF per channel at its output, drives a 20 pF ADC input, and each source has 1 kΩ of resistance. How long must the ADC wait after a channel change to settle within half an LSB at 12 bits? What error does 1 nA of total leakage add?
Show the solution
- Time constant. The output node has = 60 pF, charged through 1.1 kΩ:
- Settling time. Half an LSB at 12 bits is , so
- Leakage error. The leakage flows through the selected source's 1 kΩ: 1 µV, far below an LSB.
- With a high-impedance source. With a 1 MΩ sensor it would be 1 mV, nearly an LSB, which is why high-impedance sources get a buffer before the multiplexer.
Answer the ADC must wait 595 ns, and the leakage adds only 1 µV.
Check
A transmission gate has matched devices with = 0.5 mA/V² and = 0.7 V on a 5 V supply. What is its on-resistance where both devices conduct?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
An NMOS switch ( = 0.5 mA/V², = 0.7 V) has its gate at 5 V. What is its on-resistance with the signal at 2 V?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
A switch with = 10 µm, = 0.5 µm and = 8 fF/µm² opens with 3 V of overdrive onto a 2 pF capacitor. If half the channel charge lands there, how big is the step?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
Check
A multiplexer output with 20 pF is charged through 500 Ω in total. How long until it settles within half an LSB at 16 bits?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
Check
An open switch has 1 pF across it and feeds a 1000 Ω load. Estimate its off isolation at 1 MHz, in dB (a negative number), while the coupling is small.
Check
Why do analog switches use an NMOS and a PMOS in parallel instead of a single, larger NMOS?
Check
Show that a matched transmission gate's conductance doesn't depend on the signal where both devices conduct.
Step 1
What is the NMOS's conductance with the signal at ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
And the PMOS's?
Step 3
What is their sum?
Check
Sweep a transmission gate's on-resistance with the body effect. Each device's threshold rises with its source-to-bulk voltage: for the NMOS (bulk at 0) and for the PMOS (bulk at ), with = 0.4 V and = 0.7 V. With = 1 mA/V² for both and VDD = 3.3 V, Vt = 0.5 V, write ron(v) (return float('inf') where neither conducts) and set rmax, the largest finite on-resistance over 2001 evenly spaced points from 0 to VDD, and gap, the total width in volts of the points where neither conducts (count the points times the spacing).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
A data-acquisition board multiplexes eight thermocouple amplifiers and one 100 kΩ potentiometer into a 16-bit ADC. The thermocouple readings are fine, but the potentiometer's reading depends on which channel was read just before it. Explain why, and suggest two fixes.
When the multiplexer switches to the potentiometer, the output node and the ADC's sampling capacitor still hold the previous channel's voltage, and they must charge to the new value through the potentiometer's source resistance, up to tens of kilohms at mid-travel, plus the switch's on-resistance. With tens of picofarads, the time constant is about a microsecond, and settling within half an LSB at 16 bits takes about twelve time constants, longer than the ADC waits, so some of the previous channel's voltage remains: a memory effect. The low-impedance amplifier outputs settle quickly, which is why they're fine. Fixes: buffer the potentiometer with an op amp so every channel drives the multiplexer from a low impedance; lengthen the acquisition time for that channel or read it twice and discard the first; or add a capacitor at the potentiometer's wiper much larger than the sampling capacitor, so the charge sharing barely disturbs it.
Practice
Keep practicing
8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.