Electronics & Circuits · Study deck

ADC Fundamentals: Conversion and Resolution

This first route follows a conversion chain from sensor voltage to a digital code, the number the converter reports.

Voltage Vera is your guide for this deck.

analogdigital
Voltage Vera, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Trace ADC Operation: Describe the sample-hold-quantize-encode pipeline that converts analog voltages to digital values
  • Apply ADC Formulas: Calculate digital output, step size, and reconstructed voltage from input parameters
  • Differentiate Resolution Levels: Analyze how bit depth (8, 10, 12, 16-bit) determines voltage precision and quantization step size
  • Estimate Quantization Error: Calculate maximum measurement error for a given ADC resolution and reference voltage
iotclass.org

Major section

Overview

This first route follows a conversion chain from sensor voltage to a digital code, the number the converter reports.

  • Bit depth sets how many code steps are available.
  • Reference voltage sets the scale those steps cover.
  • Quantization is the rounding of an input to one of those steps.
ADC and DAC conversion processes
ADC and DAC conversion processes
iotclass.org

Major section

Start Simple

A displayed number is not yet a good measurement.

  • The first check is whether a known input becomes the expected code, unit, and decision.
  • An analog-to-digital converter is a circuit that turns a measured voltage into a number.
  • ADC is the short name for that converter.
  • This runway does not prove measurement accuracy from bit count alone.
iotclass.org

Major section

MVU: Analog-to-Digital Conversion

Core Concept: An ADC (Analog-to-Digital Converter) translates continuous real-world signals (voltage) into discrete digital numbers that microcontrollers can process.

  • Noise, reference error, and other converter errors can still limit usable precision and accuracy.
  • A microcontroller can read digital sensors and may use a built-in or external ADC for analog sensors.
  • Understanding ADC resolution and quantization error helps you choose the right hardware for your accuracy requirements.
The Analog World: Continuous Sensor Measurements
The Analog World: Continuous Sensor Measurements
iotclass.org

Major section

For Kids: Meet the Sensor Squad!

The ADC is like a translator between the smooth real world and the step-by-step computer world!

  • Temperature Terry was frustrated. "I can feel exactly how warm it is: 23.456 degrees!
  • But the microcontroller keeps asking me for simple numbers like 23 or 24!".
  • Max was delighted. "961!

Why it matters

the battery smiled. "And because Andy translates so efficiently, I don't waste energy trying to send impossibly precise numbers!".

iotclass.org

Major section

For Kids: Meet the Sensor Squad! (continued)

When you tell me 23.456, I don't know what to do with the.456 part!".

  • With 12 bits, I can translate Sammy's smooth feelings into 4,096 different steps!".
  • I'll save it, send it over the network, and compare it to yesterday's reading!".
  • But even the best ADC rounds to the nearest step - that tiny error is called "quantization error"!
iotclass.org

Major section

Key Concepts

An ADC connects a sensor's continuously varying voltage to the microcontroller's finite set of numbers.

  • The voltage axis depends on reference voltage and resolution together.
  • The reference establishes the conversion scale, while an nnn-bit resolution provides 2n2^n2n possible codes across that scale.
  • Assigning a continuously variable input to one code is quantization, and the difference between the input and its representative level is quantization error.

Why it matters

More bits can reduce the ideal step, but they cannot repair an unstable reference, a noisy front end, or a poorly chosen sampling rate.

iotclass.org

Major section

The Analog vs Digital Divide

The sample-and-hold block takes one time-specific snapshot and keeps it steady long enough to measure.

  • This example then shows a SAR engine narrowing down the nearest supported level by comparison with an internal DAC.
  • The important change is not simply “analog in, digital out”; it is continuous signal → held sample → chosen level → stored code.
  • In @fig-adc-architecture-ai, start at the green waveform on the left: at this point, voltage is still a continuously varying electrical signal.
  • That sequence is the bridge the rest of the chapter will unpack.
ADC architecture showing the conversion from analog sensor signals to digital values
ADC architecture showing the conversion from analog sensor signals to digital values
iotclass.org

Major section

The Analog vs Digital Divide (continued)

Their units and timescales differ, but each curve can occupy values between the marked examples; the physical signal is not restricted to integer code levels. “Continuous” does not mean that a real sensor has infinite accuracy.

  • Sensor noise, bandwidth, calibration, and the analogue front end still limit what can be known.
  • In Figure: The Digital World, the left panel shows the storage alphabet: bits.
  • The right panel connects the number of available steps to bit depth.
iotclass.org

Major section

The Analog vs Digital Divide (continued)

In Figure: The Digital World, follow binary symbols through the staircase of allowed values to see how a chosen bit depth replaces a continuum with codes a processor can store, compare, and send.

  • A code is stable and easy to copy, but it represents an interval of possible input voltages rather than the exact original voltage.
  • Valid logic margins can tolerate some electrical disturbance, error checks can protect transmission, and arithmetic can turn readings into decisions.
  • Those advantages explain why IoT systems digitise sensor signals early, but they do not recover detail discarded during sampling or quantization.
iotclass.org

Major section

Analog-to-Digital Converters (ADC)

An analogue-to-digital converter (ADC) observes an input voltage at a chosen time and assigns it one of the digital codes the converter supports.

  • To understand the result, do not jump straight from voltage to bits.
  • The conversion has three distinct decisions, and each one answers a different question.
  • The code is therefore a description of the selected level, not a perfectly precise copy of the original signal.
  • When firmware later converts the code into volts or engineering units, it is interpreting the end of this same chain.

Key terms

Resolution
Resolution is the number of discrete values the ADC can output.
ADC Internal Architecture: Sample-Quantize-Encode Pipeline
ADC Internal Architecture: Sample-Quantize-Encode Pipeline
iotclass.org

Major section

Analog-to-Digital Converters (ADC) (continued)

Figure: ADC and DAC conversion processes adds a useful reverse comparison.

  • Four settings define what that pipeline can do.
  • The input range states which voltages the front end is designed to accept; an out-of-range signal cannot be rescued by extra bits.
  • Resolution is the number of discrete values the ADC can output.
The Digital World: Discrete Binary Values and Step Changes
The Digital World: Discrete Binary Values and Step Changes
iotclass.org

Major section

Analog-to-Digital Converters (ADC) (continued)

The reference voltage provides the scale against which the held input is judged: Resolution sets how many codes divide that scale, while the sampling rate sets how often a new held value can enter the pipeline.

  • Resolution is easiest to understand by connecting the signal path to the converter settings.
  • The top row in Figure: Analog-to-Digital Converter operation and components reinforces the representation changes: waveform, held sample, chosen step, binary code.
  • Below it, VrefV_{ref}Vref​ and input range set the scale, resolution divides that scale into codes, and sampling rate controls the spacing between observations in time.
The Digital World: Discrete Binary Values and Step Changes
The Digital World: Discrete Binary Values and Step Changes
iotclass.org

Major section

Putting Numbers to It

For a 12-bit ADC with Vref=3.3V_{ref} = 3.3Vref​=3.3 V, the engineering step size (LSB) is Vstep=Vref/2n=3.3/4096=0.806V_{step} = V_{ref} / 2^n = 3.3 / 4096 = 0.806Vstep​=Vref​/2n=3.3/4096=0.806 mV.

  • Quantization error is up to ±Vstep/2=±0.403\pm V_{step}/2 = \pm 0.403±Vstep​/2=±0.403 mV.
  • For a bipolar ADC range, use the whole span.
  • Sensitivity must include that noise floor.

Numbers to remember

-1 VInput range

Why it matters

Averaging 64 independent samples can reduce random noise by sqrt(64) = 8, but it costs time and does not fix bias, nonlinearity, or correlated noise.

iotclass.org

Major section

Phoebe's Field Notes: Where the SNR Formula Comes From

At 12 bits those values are 0.806 mV, 0.403 mV, 0.233 mV, and 74.0 dB; real converters add reference, timing, and linearity errors.

  • Each added bit doubles the represented values, so the bars grow exponentially rather than by a fixed amount.
  • The derivation above explains the error associated with one step; @fig-adc-resolution-bits zooms out to show how rapidly the number of available values grows with bit depth.
  • That finer partition is the source of the smaller ideal step and higher ideal quantization SNR derived above.
ADC Resolution Comparison: 1-bit to 16-bit Value Ranges
ADC Resolution Comparison: 1-bit to 16-bit Value Ranges
iotclass.org

Deck summary

Key takeaways

This first route follows a conversion chain from sensor voltage to a digital code, the number the converter reports.

  • A displayed number is not yet a good measurement.
  • Core Concept: An ADC (Analog-to-Digital Converter) translates continuous real-world signals (voltage) into discrete digital numbers that microcontrollers can process.
  • The ADC is like a translator between the smooth real world and the step-by-step computer world!
  • When you tell me 23.456, I don't know what to do with the.456 part!".
iotclass.org

Retrieval practice

Recall check

Voltage Vera says: answer from memory, then check your reasoning.

Q1An ESP32 has a 12-bit ADC with a 3.3V reference. How many unique voltage levels can it distinguish?

A1,024 levels (about 3.2mV per step)
B65,536 levels (about 0.05mV per step)
C4,096 levels (about 0.8mV per step)
D256 levels (about 12.9mV per step)
Show answer

Answer: C A 12-bit ADC has 2^12 = 4,096 unique levels.

iotclass.org

Print reference

Answers

Answer key.

  1. C · A 12-bit ADC has 2^12 = 4,096 unique levels.
iotclass.org