The short answer
The main purpose of an ADC (analog-to-digital converter) is to measure an analog signal, usually a voltage, and convert it into a number that a digital device can store, process or display. A microcontroller, computer or digital meter cannot work directly with a continuously varying voltage. The ADC bridges that gap.
Why digital systems need an ADC
Many sensors, such as temperature sensors, light sensors, pressure sensors and microphones, output a voltage or current that changes continuously. Digital processors work with discrete binary values. The ADC samples the input at regular intervals and assigns each sample a binary code.
You will meet ADCs in many places:
- A microcontroller reading a potentiometer or thermistor
- An audio interface recording a microphone
- A digital multimeter or oscilloscope converting the signal it measures into numbers
How an ADC works
An ADC does two jobs:
- Sampling: at regular intervals set by a clock, the converter captures the input voltage.
- Quantizing: the sampled voltage is mapped to the nearest of a fixed set of levels, and that level is output as a binary code.
The sampling rate is how often this happens. To capture a signal without losing its information, the sampling rate must be more than twice the highest frequency in that signal. This is the Nyquist limit. Frequencies above half the sample rate can appear at the wrong frequency in the output, which is called aliasing.
Resolution and step size
Resolution is the number of bits. An n-bit ADC has 2^n output codes. The smallest voltage change it can distinguish, the least significant bit (LSB), is:
LSB = V_ref / 2^n
Here V_ref is the reference voltage, the full-scale input range.
Worked example. The built-in ADC on an Arduino Uno has 10 bits, so its readings run from 0 to 1023. With a 5 V reference:
5 V / 1024 ≈ 4.9 mV per step
A 2.5 V input therefore reads about 512.
Resolution does not guarantee accuracy. Noise, reference voltage error and offset all add error, so check the accuracy figures in the datasheet, not just the bit count.
Common ADC types
- Successive approximation (SAR): uses a binary search with a comparator and an internal DAC. It is a general-purpose type at medium speed, and many microcontrollers include one on-chip.
- Flash: compares the input against many reference levels at once. It is very fast, but the number of comparators grows quickly with resolution, which raises cost and power.
- Delta-sigma: oversamples the input and filters the result. It achieves high resolution at lower speeds and is common in audio and precision measurement.
- Pipelined: passes the signal through several stages, each resolving a few bits. It suits high-speed, medium-to-high-resolution work.
- Dual-slope: integrates the input and measures how long the integrator takes to discharge. It is slow, but it rejects noise well, which is why some digital multimeters use it.
ADC vs DAC
A DAC (digital-to-analog converter) does the reverse. It takes digital codes and produces an analog voltage. Audio playback is a common example: a digital audio file passes through a DAC before it reaches the speakers.
Choosing an ADC: what to check
- Resolution in bits, and the effective number of bits you actually get
- Sample rate, and whether it is shared across channels
- Input range and reference voltage
- Input impedance, and whether a driver op amp is needed (see op amps in ADCs)
- Anti-aliasing: a low-pass filter before the input keeps high frequencies from aliasing (see analog filter design)
- Accuracy and noise specifications from the datasheet