An ADC maps a sampled analog voltage to a binary integer. MCUs process binary values. Sensors output continuously varying voltages.
Here:
- : digital output value
- : input voltage
- : reference voltage
- : resolution in bits
An -bit ADC produces discrete levels.
Parameters:
- Sampling rate
Maximum conversions per second. - Reference voltage
Upper bound of the measurable input range.
Types
- Parallel
All bits resolved simultaneously. Fast. Hardware cost scales exponentially with resolution. - Serial
Bits resolved 1 at a time over multiple cycles. Lower cost. Slower.
Flash ADC
comparators in parallel, each with a distinct reference from a resistor ladder. All fire simultaneously. A priority encoder converts the thermometer code to binary.
- Fastest: 1 clock cycle per conversion
- Hardware cost grows exponentially with bit depth
- Used in oscilloscopes and high-speed RF sampling
Counter-Ramp ADC
A counter starts at 0 and increments each clock cycle. Its value feeds an internal DAC, producing a staircase voltage. A comparator checks the staircase against each cycle. When the staircase exceeds , the counter is latched as output.
Here:
- : steps to reach
- : clock period
Conversion time varies with . Full-scale requires up to cycles.
- Simplest serial design: 1 comparator, 1 counter, 1 DAC
- Slower than SAR for most inputs
- Used in low-cost, low-speed applications
Tracking ADC
A counter-ramp variant. Replaces the reset counter with an up/down counter that continuously follows .
Per clock cycle:
- Counter increments if DAC output is below
- Counter decrements if DAC output is above
The counter never resets. Output is always the current counter value.
- No start-conversion trigger needed
- Fast for slowly changing inputs
Steps per cycle to maintain lock. - Slow for large step changes
Must slew per cycle. Worst case: cycles. - Unsuitable for multiplexed inputs switching between unrelated voltages
Successive Approximation Register ADC
1 comparator, 1 internal DAC, and an -bit SAR register. Resolves 1 bit per cycle via binary search, MSB to LSB.
Sequence for bit (starting at ):
- Set bit to 1 in the SAR register.
- Feed the SAR value to the DAC to produce a trial voltage.
- Compare DAC output to .
- If : keep bit at 1. If : clear bit to 0.
- Move to bit and repeat.
After cycles the SAR register holds the final output.
- Exactly cycles regardless of
- 1 comparator, 1 DAC, 1 shift register
- Most common in MCUs (ATmega, STM32, ESP32 all use SAR)
Dual-Slope ADC
2-phase operation:
- Integrate for fixed period , charging a capacitor.
- Discharge with fixed . Measure time to reach zero.
Result depends only on the ratio of times, not component tolerances. Noise averages out over .
- Very high accuracy and noise rejection
- Slow: conversion takes milliseconds
- Used in digital multimeters and precision instrumentation
Sigma-Delta ADC
Oversamples far above the Nyquist rate, applies noise shaping, then decimation-filters to a high-resolution output.
- Resolution up to 24 bits
- Slow: latency proportional to oversampling ratio
- Used in audio codecs and precision sensors
Comparison
| ADC Type | Resolution (bits) | Speed | Cost |
|---|---|---|---|
| Flash | 4–12 | Very fast | High |
| Successive Approximation | 8–16 | Medium–fast | Low |
| Dual-Slope | 12–18 | Slow | Medium |
| Sigma-Delta | 12–24 | Slow | Low |
Implementation in MCUs
MCUs expose multiple analog pins but contain only 1 ADC. An analog MUX connects exactly 1 pin to the ADC at a time. The MUX channel is set in software before each conversion.
Analog pins
A0 ─┐
A1 ─┤
A2 ─┼─── MUX ─── Sample & Hold ─── ADC ─── Digital output
A3 ─┤
A4 ─┘
A sample-and-hold captures the pin voltage at conversion start and holds it constant for the full duration.
1 ADC is shared across all channels to minimize silicon area. An ADC contains a comparator, an internal DAC, control logic, and reference circuitry. Duplicating it per pin multiplies cost proportionally. A MUX adds only a few transistors per channel.