ADC Calculator

Verified real‑time conversion. Bidirectional update, saturation handling, and accurate quantization error.

5V / 12b / 2.5V 3.3V / 10b / 1.2V 2.5V / 16b / 1.8V
? Results
LSB (step size)
1.221 mV
Max code
4095
From Vin: Code = 2212
Binary 100010100100 Hex 0x8A4
Quantization error: 0.012 V
From digital code: Reconstructed V = 2.700 V

? Understanding the Analog‑to‑Digital Converter (ADC)

An ADC converts a continuous analog voltage into a discrete digital number proportional to the input. The fundamental parameters are resolution (N bits) and reference voltage (Vref).

? Key Concepts

  • Resolution (N bits): The number of discrete values the ADC can produce. An N‑bit ADC has \( 2^N \) possible codes.
  • Least Significant Bit (LSB): The smallest voltage step that can be resolved: \( LSB = \frac{V_{ref}}{2^N} \).
  • Quantization: The process of mapping an infinite range of input voltages to a finite number of codes. The unavoidable difference between actual input and the reconstructed voltage is called quantization error.
  • Full‑scale range: Typically 0 to Vref (unipolar) or ±Vref (bipolar). This calculator assumes unipolar 0‑Vref.

Transfer function (ideal, truncation):

\( D = \left\lfloor \frac{V_{in}}{LSB} \right\rfloor \)    for \( 0 \le V_{in} < V_{ref} \)

For \( V_{in} \ge V_{ref} \), the output saturates at \( 2^N - 1 \).

⚙️ Quantization Error & Noise

The quantization error \( \epsilon = V_{in} - D \times LSB \) lies in the range \( [0, LSB) \) when using truncation. With rounding, the error would be \( \pm LSB/2 \). The RMS quantization noise for a full‑scale sine wave is approximately \( \frac{LSB}{\sqrt{12}} \).

? Practical ADC Parameters

ParameterTypical valuesImpact
Resolution8‑24 bitsHigher bits → finer steps, lower quantization noise.
Reference voltage1.8V, 2.5V, 3.3V, 5VDetermines input range and LSB size.
Sampling ratekS/s to GS/sHow fast conversions can be performed.
INL / DNL±0.5 LSB to ±2 LSBIntegral/Differential non‑linearity – deviations from ideal.

? Applications

  • Microcontrollers (e.g., Arduino, STM32): Read analog sensors (temperature, light, potentiometers).
  • Data acquisition systems: Digitize real‑world signals for processing.
  • Audio converters: High‑resolution ADCs (16‑24 bits) for studio recording.
  • Instrumentation: Precision measurements with 16‑24 bit ADCs.

⚠️ Important Notes

  • This calculator uses an ideal model – no offset, gain, or non‑linearity errors.
  • The input voltage should not exceed Vref to avoid saturation (but we show clamped value).
  • For best accuracy, keep the input within the specified range.
  • Quantization error can be reduced by increasing resolution or using oversampling + dithering.

❓ Frequently Asked Questions

Truncation (floor) discards the fractional part, giving a digital code that corresponds to the lower boundary of the quantization interval. Rounding (to nearest integer) centers the error around zero and reduces average error. Most ADCs implement either rounding or a combination (e.g., successive approximation typically rounds).

Because the code 0 represents 0 V, and the last code \( 2^N - 1 \) represents voltages from \( V_{ref} - LSB \) up to \( V_{ref} \) (just below Vref). There is no code for exactly Vref if we use a 0‑to‑Vref range – the output saturates at the maximum code.

This version assumes unipolar 0‑Vref. For bipolar, the transfer function shifts: code = floor( (Vin + Vref) / LSB ) etc. You can still use it by mentally offsetting, but the numbers will not directly match.