Home » Basics of Electricity » The Basics of Analog-to-Digital Conversion (ADC)

The Basics of Analog-to-Digital Conversion (ADC)

We have learned that real-world signals like temperature, sound, and light are usually analog. However, digital systems such as our computers and microcontrollers process data in digital form (binary) for better efficiency. This is where Analog-to-Digital Conversion (ADC) comes in—it bridges the gap between the analog and digital worlds, allowing digital systems to interpret real-world data.

bode plot of signal waveforms

This guide will introduce ADC concepts, explain how it works, and show how you can implement it in your projects.

What is Analog-to-Digital Conversion?

Analog-to-Digital Conversion is the process of transforming continuous analog signals into discrete digital values that can be understood by a digital system. This is crucial in applications such as:

  • Microcontrollers (reading sensor data)
  • Audio processing (converting sound waves to digital format)
  • Medical devices (monitoring vital signs like heart rate)
  • Industrial automation (reading temperature or pressure levels)

Key ADC Terms for Beginners

TermExplanationExample
Resolution (Bits)How finely the ADC divides the analog signal.10-bit ADC = 1024 steps (2¹⁰)
Sampling RateHow many times per second the ADC measures the signal.10 kHz = 10,000 samples/sec
Reference Voltage (Vref)The max voltage the ADC can measure.If Vref = 5V, 0V = 0, 5V = 1023 (10-bit)
Quantization ErrorDifference between real analog value and digital approximation.Smaller steps = less error

Common ADC Types (Simplified)

TypeSpeedResolutionBest For
Successive Approximation (SAR)Medium8-16 bitsMicrocontrollers (Arduino, STM32)
Delta-Sigma (ΔΣ)Slow16-24 bitsHigh-precision audio, sensors
Flash ADCVery Fast6-8 bitsHigh-speed applications (radar, video)
Dual-Slope ADCVery Slow12-20 bitsDigital multimeters (DMMs)

How does Analog-to-Digital Conversion (ADC) work?

Step-by-Step Processing of a Signal

image of block diagrams

Let’s assume we are converting an analog temperature signal from a sensor that varies between 0V and 5V into a digital format using a 10-bit ADC.

1. Analog Input

The input is a continuous voltage signal representing temperature. For example:

Temperature Sensor Output: 2.45V (Analog Signal)

This voltage must be digitized so a microcontroller can process it.

2. Sample & Hold Circuit

The ADC samples the signal at a specific interval (e.g., every millisecond). It captures and holds the voltage steady to prevent fluctuations while converting:

Sampled Value: 2.45V (Held Constant for Processing)

3. Quantization

The ADC divides the voltage range (0V–5V) into 1024 discrete levels (since it’s a 10-bit ADC). Each step corresponds to:

Step Size = 5V / 1024 ≈ 4.88mV per step

The sampled voltage (2.45V) is mapped to the closest discrete level:

2.45V / 4.88mV ≈ 502 (Quantized Level)

4. Encoding

The quantized value (502) is then converted into a binary number:

502 (Decimal) = 0111110110 (10-bit Binary Output)

5. Digital Output

The ADC outputs this binary number, which can be processed by a microcontroller:

Digital Output: 0111110110

This data can now be used in software for display, storage, or further processing.

image of block diagrams

Nyquist Theorem and Its Relation to ADC

The Nyquist Theorem, also known as the Nyquist-Shannon Sampling Theorem, states that:

To accurately reconstruct a continuous analog signal from its samples, the sampling rate must be at least twice the highest frequency present in the signal.

How Nyquist Theorem Relates to ADC

  • Sampling Rate: When converting an analog signal into a digital signal using ADC, the sampling rate determines how often the signal is measured.
  • Aliasing Prevention: If the sampling rate is too low, aliasing occurs (see figure below), meaning different signals become indistinguishable from one another, causing distortion.
bode plot of two signal waveforms
  • Choosing the Right Sampling Rate: To prevent aliasing, a signal containing frequencies up to f_max Hz should be sampled at a rate of at least 2 × f_max Hz (known as the Nyquist rate).
bode plot of two signal waveforms