Loading header...

Voltage References and Input Conditioning

An ADC result is a comparison between the input voltage and the reference. If the reference is noisy, drifting, overloaded, or poorly routed, the digital code will be wrong even if the ADC itself is excellent. Input conditioning makes the sensor signal safe, scaled, filtered, and settled before conversion.

Learning Objectives

By the end of this lesson, you should be able to:

  • explain how reference voltage sets ADC code scale;
  • choose between supply, internal, and precision external references;
  • scale and protect ADC inputs;
  • estimate RC filter cutoff and source impedance effects;
  • identify layout practices that protect measurement accuracy.

Reference Voltage

For an ideal unipolar N-bit ADC:

$$
\text{LSB}=\frac{V_\text{REF}}{2^N}
$$

and approximately:

$$
V_\text{IN}=\frac{\text{code}}{2^N-1}V_\text{REF}
$$

If V_REF changes by 1%, the measured voltage scale changes by 1%. Reference accuracy, drift, noise, and load regulation directly affect conversion accuracy.

Reference noise appears as conversion noise even when the input signal is perfectly quiet. Reference drift appears as gain error over temperature. For a measurement that must be accurate over months or outdoors, check initial accuracy, temperature coefficient in ppm/deg C, long-term drift, output noise, startup time, and required decoupling.

Reference Choices

Reference source Strength Watch out
MCU supply simple and cheap noisy, changes with load and battery
internal reference convenient limited accuracy and drive
external precision reference best stability cost, layout, startup, load current
ratiometric sensor supply cancels supply variation only works when sensor and ADC share ratio

Ratiometric measurement is useful for resistive sensors. If a bridge or divider is excited by the same voltage used as ADC reference, supply variation can cancel from the ratio.

Worked Example: Reference Error

A 12-bit ADC with V_REF = 3.300 V has:

$$
\text{LSB}=\frac{3.300}{4096}=0.805\ \text{mV}
$$

If the reference is actually 3.267 V, the scale error is:

$$
\frac{3.267-3.300}{3.300}=-1.0%
$$

A code that firmware converts as 2.000 V would represent about 1.980 V unless the reference value is measured, calibrated, or intentionally ratiometric.

Scaling the Input

A resistor divider maps a larger voltage into the ADC range:

$$
V_\text{ADC}=V_\text{IN}\frac{R_2}{R_1+R_2}
$$

For measuring up to 24 V with a 3.3 V ADC, choose a ratio below 3.3/24 = 0.1375. R1 = 180 kOhm and R2 = 27 kOhm gives:

$$
V_\text{ADC}=24\frac{27}{180+27}=3.13\ \text{V}
$$

Check resistor tolerance, ADC leakage, input impedance, power, and voltage rating.

The divider's Thevenin resistance is:

$$
R_\text{TH}=R_1\parallel R_2=\frac{R_1R_2}{R_1+R_2}
$$

For 180 kOhm and 27 kOhm:

$$
R_\text{TH}=23.5\ \text{kOhm}
$$

That may be too high for a fast SAR ADC sample window unless a buffer or longer acquisition time is used. Lower resistor values improve settling but increase input current and power loss, so the choice is a system tradeoff.

Buffering and Source Impedance

A SAR ADC usually charges an internal sampling capacitor during acquisition. If the source resistance is too high, the sampling capacitor does not settle to the true input voltage before conversion.

Use an op-amp buffer when:

  • the sensor or divider impedance is high;
  • the ADC sample time is short;
  • multiple channels are multiplexed quickly;
  • an anti-alias filter needs a low-impedance driver;
  • the signal requires gain or level shifting.

Choose a buffer whose input common-mode range, output swing, slew rate, gain-bandwidth, noise, offset, and stability with capacitive load all fit the circuit. A rail-to-rail label alone does not guarantee accurate operation at the rails.

RC Input Filters

A simple RC low-pass filter reduces high-frequency noise and provides some anti-aliasing:

$$
f_c=\frac{1}{2\pi RC}
$$

Example: R = 1 kOhm, C = 100 nF:

$$
f_c=\frac{1}{2\pi(1000)(100\times10^{-9})}=1592\ \text{Hz}
$$

flowchart LR SENSOR["Sensor"] --> SCALE["Divider or gain"] SCALE --> PROT["Clamp and series limit"] PROT --> FILT["RC low-pass"] FILT --> BUF["Optional buffer"] BUF --> ADC["ADC input"] REF["Reference"] --> ADC

Place the filter where it helps both noise and settling. A small series resistor near the ADC pin with a local capacitor can provide a charge reservoir for the sampling capacitor, but too much resistance creates acquisition error. A large capacitor directly on a weak op-amp output can make the op amp oscillate unless isolation resistance or compensation is used.

Protection

ADC inputs must never exceed absolute maximum ratings. Typical protection includes series resistance, Schottky clamps, TVS diodes, RC filtering, and firmware plausibility checks. Protection must be designed so normal operation remains accurate.

For mains, batteries, motors, and industrial wiring, use proper isolation, creepage, clearance, fusing, and certified design practices. Do not rely on an MCU clamp diode as a safety barrier.

Limit clamp current under the worst expected fault:

$$
I_\text{clamp}\approx\frac{V_\text{fault}-V_\text{clamp}}{R_\text{series}}
$$

This must stay below the ADC, MCU, and external clamp ratings. Also check fault power in the resistor:

$$
P=\frac{(V_\text{fault}-V_\text{clamp})^2}{R_\text{series}}
$$

For high-energy sources, add external protection and isolation instead of depending on tiny silicon input structures.

Layout Guidance

  • Put reference decoupling at the reference pin.
  • Keep analog return currents away from switching load currents.
  • Route high-impedance nodes short and clean.
  • Place RC filters close to the ADC input.
  • Avoid sharing the reference trace with pulsed loads.
  • Follow the ADC datasheet layout notes before copying generic advice.

Bring-Up Checklist

  1. Measure V_REF at the ADC reference pin with the product load active.
  2. Apply 0 V, mid-scale, and near-full-scale test inputs and log raw codes.
  3. Change the ADC sample time and confirm readings do not shift; a shift indicates settling error.
  4. Inject a fast input step and verify the first converted sample after channel switching.
  5. Heat or cool the reference area if temperature accuracy matters.
  6. Confirm no input can exceed absolute maximum ratings during startup, shutdown, connector insertion, or firmware reset.

Common Mistakes

  • Using a noisy digital rail as a precision ADC reference.
  • Building a high-value divider that cannot settle the ADC input.
  • Adding a large filter capacitor that overloads a weak sensor or op amp.
  • Ignoring reference startup time before first conversion.
  • Clamping inputs without checking injection current limits.
  • Treating ratiometric and absolute measurements as the same calibration problem.
  • Forgetting resistor voltage rating and fault power in high-voltage dividers.

Summary

The ADC measures input voltage relative to its reference. Stable references, correct scaling, low enough source impedance, suitable filtering, and safe protection are as important as the ADC bit count. Design the analog input so the ADC sees a valid, settled, in-range voltage at the instant it samples.

Further Reading

Mind Map

mindmap root((ADC Conditioning)) Reference Sets code scale LSB equals Vref over 2 power N Noise becomes code noise Drift becomes gain error ppm per deg C matters Ratiometric option Input scaling Divider ratio Vadc equals Vin R2 over R1 plus R2 Rth equals R1 parallel R2 Gain stage Level shift Protection clamps Voltage limits Filtering RC low pass fc equals 1 over 2 pi R C Anti alias role Settling time Op amp stability Practical checks Source impedance Sample time Reference decoupling Ground return Startup delay Clamp current Common mistakes Noisy Vref Weak divider drive Unsafe clamp current Poor layout Ignored fault power