TExcelTAD
Home › Analog Electronics: Diodes, Transistors & Op-Amps › Instrumentation Amplifiers and Sensor Signal Conditioning

Instrumentation Amplifiers and Sensor Signal Conditioning

A kitchen-scale load cell is a Wheatstone bridge of four strain gauges. Excited with 5 V5\ \text{V}, it gives at most 10 mV10\ \text{mV} at full load, and that tiny signal rides on 2.5 V2.5\ \text{V} of common mode, because both output nodes sit halfway up the bridge. The microcontroller's ADC wants 00 to 3.3 V3.3\ \text{V}. You need a gain of a few hundred, applied only to the difference, with a CMRR well above 80 dB80\ \text{dB}, and you cannot load the bridge. The difference amplifier fails on two counts: its input resistance is only R1R_1, and with 1 % resistors its CMRR is about 34 dB34\ \text{dB}. The instrumentation amplifier (INA) fixes both. This lesson builds one from three op-amps, designs a complete load-cell interface (the roadmap's "precision sensor interface" lab) and covers the other conditioning tricks: reference pins for level shifting, ratiometric measurement and transimpedance amplifiers.

Vex = +5 V Rb3 350 Rb4 350 Rb1 350 Rb2 350 a b + - A1 - + A2 RG 75 Ohm Rf1 10k Rf2 10k o1 o2 R3 10k R5 10k - + A3 R4 10k out R6 10k ref = 0.3 V

The three-op-amp instrumentation amplifier

Input stage. A1A_1 and A2A_2 are non-inverting amplifiers whose inverting inputs are joined through one gain resistor RGR_G. By the golden rules, vn1=vav_{n1} = v_a and vn2=vbv_{n2} = v_b, so the current through RGR_G is (vb−va)/RG(v_b - v_a)/R_G, and it also flows through Rf1R_{f1} and Rf2R_{f2}. The outputs are therefore

vo2−vo1=(1+2RfRG)(vb−va),vo1+vo22=va+vb2v_{o2} - v_{o1} = \left(1 + \frac{2R_f}{R_G}\right)(v_b - v_a), \qquad \frac{v_{o1} + v_{o2}}{2} = \frac{v_a + v_b}{2}

The differential signal is amplified by G1=1+2Rf/RGG_1 = 1 + 2R_f/R_G, but the common mode passes with gain exactly 1, whatever RGR_G is, and whatever the mismatch of Rf1R_{f1} and Rf2R_{f2} (a mismatch only changes the differential gain slightly). Both inputs go straight into op-amp non-inverting inputs: the input resistance is gigaohms, so the bridge is not loaded.

Difference stage. A3A_3 with four equal resistors subtracts, vout=(vo2−vo1)+vrefv_\text{out} = (v_{o2} - v_{o1}) + v_\text{ref}. Its own CMRR is still set by resistor matching, but now the differential signal arriving at it is G1G_1 times larger while the common mode is not, so

G=(1+2RfRG)R4R3,CMRRINA≈G1⋅CMRRdiff stageG = \left(1 + \frac{2R_f}{R_G}\right)\frac{R_4}{R_3}, \qquad \text{CMRR}_\text{INA} \approx G_1 \cdot \text{CMRR}_\text{diff stage}

One resistor sets the gain, and high gain improves the CMRR. Integrated INAs trim the difference-stage resistors on the die to reach 100100 to 130 dB130\ \text{dB} at high gain, and specify GG by a formula that differs between parts: 1+49.4 kΩ/RG1 + 49.4\ \text{k}\Omega/R_G (internal Rf=24.7 kΩR_f = 24.7\ \text{k}\Omega) for the AD620 and INA129, but 1+50 kΩ/RG1 + 50\ \text{k}\Omega/R_G for the INA128 and 1+100 kΩ/RG1 + 100\ \text{k}\Omega/R_G for the INA333; always take it from your part's datasheet.

Reference pin. R6R_6 does not have to go to ground. Whatever voltage drives it is added to the output: this is how an INA level-shifts a bipolar signal into a single-supply ADC's range. Drive it from a low-impedance source (a buffer), because any resistance in series with R6R_6 unbalances the difference stage.

Sensor signal conditioning in four steps

  1. Excite the sensor: a voltage for bridges, a current for RTDs (a Pt100 is 100 Ω100\ \Omega at 0 ∘C0\ ^\circ\text{C} and rises about 0.385 Ω/∘C0.385\ \Omega/^\circ\text{C}, IEC 60751:2022), a bias for photodiodes.
  2. Amplify the difference with an INA, so the full-scale signal nearly fills the ADC range.
  3. Shift the output with the reference pin to leave headroom at both ends.
  4. Filter before the ADC, at least a first-order anti-alias RC (Active Filters for more).

Make the measurement ratiometric when you can: feed the bridge and the ADC reference from the same voltage. The bridge output is proportional to VexV_\text{ex} and the ADC code is proportional to v/Vrefv/V_\text{ref}, so a drift of the supply cancels in the code.

A photodiode is the other common sensor: it is a current source. A transimpedance amplifier (an inverting amplifier without R1R_1) holds the diode at 0 V0\ \text{V} on the virtual ground and gives vout=−IpRfv_\text{out} = -I_p R_f; 1 μA1\ \mu\text{A} into Rf=1 MΩR_f = 1\ \text{M}\Omega is −1 V-1\ \text{V}. A small capacitor across RfR_f is needed for stability (LEDs and Photodiodes, Stability and Compensation).

Worked example: load-cell interface

Given: a load cell, 2 mV/V2\ \text{mV/V} at full load, four 350 Ω350\ \Omega arms, Vex=5 VV_\text{ex} = 5\ \text{V}. A three-op-amp INA with Rf=10 kΩR_f = 10\ \text{k}\Omega and a unity-gain difference stage of 1 % resistors, rail-to-rail op-amps on a single 5 V5\ \text{V} supply. A 12-bit ADC with a 00 to 3.3 V3.3\ \text{V} range. The output should run from about 0.3 V0.3\ \text{V} (no load) to 3.0 V3.0\ \text{V} (full load).

Find: RGR_G, the real output span, the worst-case CMRR and its effect, and the resolution.

Solve:

vd=2 mV/V⋅5 V=10 mV,Gneeded=3.0−0.30.010=270RG=2RfG−1=20 kΩ269=74.3 Ω  →  75 Ω (E24),G=1+20 k75=267.7vout=0.3 V+267.7⋅10 mV=2.977 VCMRR≈267.7⋅1+14⋅0.01=13 400  (82.5 dB),Δvout=2.5 V50=50 mVLSB=3.3 V4096=0.806 mV,2.677 V0.806 mV=3322 counts over full load\begin{aligned} v_d &= 2\ \text{mV/V} \cdot 5\ \text{V} = 10\ \text{mV}, \qquad G_\text{needed} = \frac{3.0 - 0.3}{0.010} = 270 \\ R_G &= \frac{2 R_f}{G - 1} = \frac{20\ \text{k}\Omega}{269} = 74.3\ \Omega \;\to\; 75\ \Omega \text{ (E24)}, \qquad G = 1 + \frac{20\ \text{k}}{75} = 267.7 \\ v_\text{out} &= 0.3\ \text{V} + 267.7 \cdot 10\ \text{mV} = 2.977\ \text{V} \\ \text{CMRR} &\approx 267.7 \cdot \frac{1 + 1}{4 \cdot 0.01} = 13\,400 \;(82.5\ \text{dB}), \qquad \Delta v_\text{out} = \frac{2.5\ \text{V}}{50} = 50\ \text{mV} \\ \text{LSB} &= \frac{3.3\ \text{V}}{4096} = 0.806\ \text{mV}, \qquad \frac{2.677\ \text{V}}{0.806\ \text{mV}} = 3322 \text{ counts over full load} \end{aligned}

Check: the input-stage outputs swing to 2.5∓1.34 V2.5 \mp 1.34\ \text{V}, inside a 00 to 5 V5\ \text{V} rail-to-rail op-amp. The worst-case common-mode error of 50 mV50\ \text{mV} at the output is constant, because the bridge's common mode is fixed at Vex/2V_\text{ex}/2, so the usual "tare" (zero) calibration removes it; it would matter if the excitation changed.

In Python: design and error budget

python · try it yourself
import math

Vex, S, Rf = 5.0, 2e-3, 10e3
vd_fs = S * Vex
G_need = (3.0 - 0.3) / vd_fs
RG = 75.0
G = 1 + 2 * Rf / RG
print(f"full-scale input {vd_fs*1e3:.1f} mV, gain needed {G_need:.1f}")
print(f"RG = {2*Rf/(G_need-1):.2f} Ohm -> {RG:.0f} Ohm, G = {G:.2f}")
print(f"output: {0.3:.3f} V at no load, {0.3 + G*vd_fs:.3f} V at full load")

for t in [0.01, 0.001]:
    cmrr = G * 2 / (4 * t)
    shift = 2.5 * 2 * t          # CM gain of a unity difference stage, worst case 2t
    print(f"diff stage {t*100:.1f} %: CMRR {cmrr:6.0f} = {20*math.log10(cmrr):.1f} dB,"
          f" output shift from 2.5 V CM {shift*1e3:.1f} mV")

lsb = 3.3 / 4096
print(f"ADC LSB {lsb*1e3:.3f} mV, counts over full load {G*vd_fs/lsb:.0f}")
for name, vex_ref in [("fixed 3.3 V reference", False), ("ratiometric", True)]:
    for drift in [0.0, -0.02]:
        vex = Vex * (1 + drift)
        vref = 3.3 * (1 + drift) if vex_ref else 3.3
        code = (0.3 + G * S * vex) / vref * 4096
        print(f"{name:22s} Vex {vex:.2f} V: full-load code {code:.0f}")
full-scale input 10.0 mV, gain needed 270.0
RG = 74.35 Ohm -> 75 Ohm, G = 267.67
output: 0.300 V at no load, 2.977 V at full load
diff stage 1.0 %: CMRR  13383 = 82.5 dB, output shift from 2.5 V CM 50.0 mV
diff stage 0.1 %: CMRR 133833 = 102.5 dB, output shift from 2.5 V CM 5.0 mV
ADC LSB 0.806 mV, counts over full load 3322
fixed 3.3 V reference  Vex 5.00 V: full-load code 3695
fixed 3.3 V reference  Vex 4.90 V: full-load code 3628
ratiometric            Vex 5.00 V: full-load code 3695
ratiometric            Vex 4.90 V: full-load code 3702

With a fixed ADC reference, a 2 % sag of the excitation moves the full-load reading by about 2 % of span; with the reference tied to the excitation the reading moves only by the small part due to the fixed 0.3 V0.3\ \text{V} offset. (A real ratiometric design derives the offset from the excitation too.)

Cross-check with SPICE

The deck draws the circuit of the figure with the op-amp macro-model written for this course (A0=105A_0 = 10^5, GBW=1 MHz\text{GBW} = 1\ \text{MHz}). The first op is the unloaded cell; then alter changes the four arms by ±0.2 %\pm 0.2\ \%, the full-load imbalance of a 2 mV/V2\ \text{mV/V} cell.

bash · try it yourself
cat > ina.cir <<'EOF'
* load-cell bridge + three-op-amp instrumentation amplifier, G = 1 + 2Rf/RG
.subckt OA inp inn out
G1 0 n1 inp inn 1m
R1 n1 0 100meg
C1 n1 0 159.2p
E1 out 0 n1 0 1
.ends
Vex ex 0 5
Rb1 ex a 350
Rb2 a 0 350
Rb3 ex b 350
Rb4 b 0 350
X1 a n1 o1 OA
X2 b n2 o2 OA
Rf1 o1 n1 10k
RG n1 n2 75
Rf2 o2 n2 10k
Vref ref 0 0.3
R3 o1 m 10k
R4 m out 10k
R5 o2 p 10k
R6 p ref 10k
X3 p m out OA
.control
op
print v(a) v(o1) v(o2) v(out)
alter Rb1 = 350.7
alter Rb2 = 349.3
alter Rb3 = 349.3
alter Rb4 = 350.7
op
print v(b)-v(a) v(o1) v(o2) v(out)
.endc
.end
EOF
ngspice -b ina.cir 2>&1 | grep -E '^v'
v(a) = 2.500000e+00
v(o1) = 2.499975e+00
v(o2) = 2.499975e+00
v(out) = 2.999940e-01
v(b)-v(a) = 1.000000e-02
v(o1) = 1.165214e+00
v(o2) = 3.834736e+00
v(out) = 2.969462e+00

The common mode passes through the input stage untouched (vo1=vo2≈2.5 Vv_{o1} = v_{o2} \approx 2.5\ \text{V}) and the output rests at the 0.3 V0.3\ \text{V} reference. At full load the output is about 8 mV8\ \text{mV} below the ideal 2.977 V2.977\ \text{V}: the noise gain of 268 against A0=105A_0 = 10^5 costs 0.27 %, which the calibration absorbs.

Interactive: squeeze the strain gauge

The netlist uses controlled sources E1, E2, E3 (gain 10610^6) as the three op-amps, because ee-netlist has no op-amp element, and grounds the reference pin to stay within the lab's ten-node limit. The slider is one bridge arm, Rb1R_{b1}: a quarter-bridge change.

node voltages (to ground 0)ex5.000 Va2.498 Vb2.500 Vo12.165 Vn12.498 Vo22.833 Vn22.500 Vm1.416 Vout668.3 mVp1.416 Velement currents (node 1 to node 2 through it)Vexex>0-14.3 mARb1ex>a7.14 mARb2a>07.14 mARb3ex>b7.14 mARb4b>07.14 mAE1o1>0-41.5 uAE2o2>0-175 uARf1o1>n1-33.3 uARGn1>n2-33.3 uARf2o2>n233.3 uAR3o1>m74.8 uAR4m>out74.8 uAR5o2>p142 uAR6p>0142 uAE3out>074.8 uA

At Rb1=350.7 ΩR_{b1} = 350.7\ \Omega the lab shows V(a)=2.498 VV(a) = 2.498\ \text{V}, V(out)=668.3 mVV(\text{out}) = 668.3\ \text{mV}: one arm changed by 0.2 % gives a quarter of the full-bridge signal, 2.497 mV×267.72.497\ \text{mV} \times 267.7. Notice V(o1)V(o1) and V(o2)V(o2) spread symmetrically around 2.5 V2.5\ \text{V}.

Guided lab: a precision bridge interface

Hand calculation. As in the worked example; for a bench bridge without a load cell, use four 1 kΩ1\ \text{k}\Omega 0.1 % resistors with a 10 Ω10\ \Omega potentiometer in series with one arm (about ±0.5 %\pm 0.5\ \% adjustment, so ±6 mV\pm 6\ \text{mV} of imbalance at 5 V5\ \text{V}).

Simulation. The Python budget, the SPICE deck (change the arms to your values) and the lab.

What you would measure. Build the INA from a quad op-amp (rail-to-rail input and output, single 5 V5\ \text{V} supply from a current-limited bench supply at about 30 mA30\ \text{mA}, 100 nF100\ \text{nF} at the pins) or use an integrated INA with its datasheet gain formula. Measure the bridge difference with a DMM on its 200 mV200\ \text{mV} range (resolution 100 μV100\ \mu\text{V} on a 3½-digit meter, 10 μV10\ \mu\text{V} on a 4½-digit one) and the output on its 20 V20\ \text{V} range. Expect the output to equal 0.3 V+G (vb−va)0.3\ \text{V} + G\,(v_b - v_a) within about ±1 %\pm 1\ \% of span (RGR_G tolerance dominates) plus a zero offset of up to tens of millivolts. Then tie both INA inputs together, connect them to a 1 V1\ \text{V} peak, 50 Hz50\ \text{Hz} sine from the generator offset to 2.5 V2.5\ \text{V}, and read the output ripple to estimate the CMRR.

Hazards and safe setup. 5 V5\ \text{V} from a current-limited supply. Do not let the generator drive an input outside the op-amp's rails (keep the offset sine within 11 to 4 V4\ \text{V}). A real load cell must never be overloaded mechanically beyond its rated capacity.

Pitfalls

  • Ignoring the input common-mode range. An INA's internal nodes have their own limits; a single-supply INA may not work with inputs near ground at high gain. Datasheets give a "diamond plot" of allowed output against common mode.
  • Driving the reference pin from a divider. The divider's resistance unbalances the difference stage and destroys the CMRR; buffer it.
  • No path for the input bias current. A floating sensor (a thermocouple, a capacitively coupled source) needs a resistor from each input to a reference voltage.
  • Long sensor leads without filtering. They pick up radio-frequency interference, which the INA rectifies into a DC error (Grounding and Layout).

Practice

  1. With Rf=10 kΩR_f = 10\ \text{k}\Omega, what RGR_G gives G=101G = 101?
  2. A Pt100 is excited by 1 mA1\ \text{mA}. What voltage change does a 1 ∘C1\ ^\circ\text{C} rise give, and what INA gain maps 00 to 100 ∘C100\ ^\circ\text{C} onto a 2.5 V2.5\ \text{V} span?
  3. Why does raising the input-stage gain improve the CMRR of a three-op-amp INA?
Answer
  1. RG=20 kΩ/100=200 ΩR_G = 20\ \text{k}\Omega / 100 = 200\ \Omega.
  2. 0.385 Ω⋅1 mA=0.385 mV/∘C0.385\ \Omega \cdot 1\ \text{mA} = 0.385\ \text{mV/}^\circ\text{C}; over 100 ∘C100\ ^\circ\text{C} that is 38.5 mV38.5\ \text{mV}, so G=2.5/0.0385=64.9G = 2.5/0.0385 = 64.9 (the 100 mV100\ \text{mV} at 0 ∘C0\ ^\circ\text{C} is removed with a reference resistor in a bridge or by the INA reference pin).
  3. The input stage multiplies the differential signal by G1G_1 but passes the common mode with gain 1, so the difference stage's common-mode error is G1G_1 times smaller relative to the signal.

Test yourself

In a three-op-amp INA with Rf=10 kΩR_f = 10\ \text{k}\Omega and RG=1 kΩR_G = 1\ \text{k}\Omega (unity difference stage), the gain is…

  1. 1010
  2. 1111
  3. 2020
  4. 2121

What gain does the input stage of a three-op-amp INA give to the common-mode voltage?

  1. 0
  2. 1
  3. G1G_1
  4. −1-1

A measurement is ratiometric when…

  1. the gain is set by a ratio of resistors
  2. the sensor excitation and the ADC reference come from the same voltage
  3. the bridge has four equal arms
  4. the INA output is referred to mid-supply

Why should the INA reference pin be driven from a low-impedance source?

  1. To reduce noise only
  2. Its series resistance adds to R6R_6 and unbalances the difference stage, degrading CMRR and gain
  3. Because the pin is an output
  4. To set the input bias current