Explain quantisation and compute an ADC's resolution.
State the Nyquist criterion and explain aliasing.
Describe the role of an anti-aliasing filter.
Explain sample-and-hold and why the source impedance matters.
Everything in Circuit Analysis and most of Microelectronics has treated voltage as a continuous quantity. A microcontroller cannot hold a continuous quantity — it holds numbers. The analogue-to-digital converter is the bridge, and crossing it costs two things: precision, because a continuous range becomes a finite set of levels, and time, because a continuous signal becomes a sequence of instants. Both costs are quantifiable, and mishandling either produces measurements that look plausible and are wrong.
Quantisation first. An N-bit converter divides its reference range into 2N levels, so the smallest distinguishable step — the least significant bit — is the reference divided by that count. Any reading carries an inherent uncertainty of half an LSB, before any other error source.
LSB=2NVrefquantisation error=±21LSBresolution and its error floor
Resolution
Levels
LSB at 3.3 V
8-bit
256
12.9 mV
10-bit
1024
3.22 mV
12-bit
4096
0.806 mV
16-bit
65 536
50.4 µV
Resolution against reference: the Pico's ADC is 12-bit, so its steps are under a millivolt.
Now time. Sampling a continuous signal at intervals discards everything between samples, and that discarded information can make a fast signal masquerade as a slow one. The Nyquist-Shannon criterion states the condition for this not to happen: the sampling rate must exceed twice the highest frequency present in the signal.
fs>2fmaxthe Nyquist criterion
Aliasing: sampled too slowly, a fast signal is indistinguishable from a much slower one.
One more subtlety, and it explains a whole class of mysterious ADC errors. Most converters sample by briefly connecting the input to a small internal capacitor, then measuring that capacitor's voltage while disconnected — a sample-and-hold. The capacitor must charge to the input voltage within the sampling window, and that charging is CA-5's RC transient with R being the SOURCE's output impedance. Feed the ADC from a high-impedance source and the capacitor never finishes charging, so every reading is low.
Sample-and-hold: the switch closes briefly to charge C_H, then opens while the converter measures it.WORKED EXAMPLE
Reading the CA-2 light sensor properly
The LDR divider's Thevenin resistance is about 3.3 kΩ bright, 9.1 kΩ dark (your CA-4 and ME-4 capstones).
The RP2040's sample capacitor is small, but its datasheet recommends a source impedance well under about 10 kΩ for full accuracy.
In darkness the divider is right at that limit, so the darkest readings will be the least trustworthy — a systematic error that varies with the very quantity being measured.
The fix is ME-4's follower: buffer the divider, and the ADC sees an output impedance of a fraction of an ohm regardless of light level.
Buffer high-impedance sources — the error is worst exactly where the signal is weakest.WORKED EXAMPLE
Choosing a sampling rate
A temperature sensor's signal contains nothing above 2 Hz, but the wiring picks up 60 Hz mains hum.
Nyquist on the SIGNAL suggests fs>4 Hz — but the hum is also present at the input, and sampling at 4 Hz would alias 60 Hz down to 0 Hz, appearing as a fixed temperature offset that drifts.
Correct procedure: low-pass filter below 2 Hz to remove the hum, THEN sample at 10 Hz for comfort.
Nyquist applies to what actually arrives at the converter, not to what you intended to measure.
Filter first, then sample — the criterion governs the input, not the intention.
PRACTICE
Q1
A 10-bit ADC has a 5 V reference. What is its LSB size?
Q2
A signal contains components up to 1 kHz. What is the minimum sampling rate, and what rate would you actually choose?
Q3
A 12-bit ADC on a 3.3 V reference reads a code of 2048. What input voltage does that correspond to, and what is the uncertainty?
Q4
Explain why an anti-aliasing filter must come before the ADC rather than being applied in software afterwards.