ADC Resolution Calculator Formula
Understand the math behind the adc resolution calculator. Each variable explained with a worked example.
Formulas Used
Digital Output Code
digital_code = floor(input_voltage / step_v)Step Size (1 LSB)
step_mv = step_v * 1000Reconstructed Voltage
reconstructed_v = floor(input_voltage / step_v) * step_vQuantization Error
quant_error_mv = abs(input_voltage - floor(input_voltage / step_v) * step_v) * 1000Total Levels
total_levels = pow(2, adc_bits)Variables
| Variable | Description | Default |
|---|---|---|
adc_bits | ADC Resolution (bits) | 10 |
v_ref | Reference Voltage(V) | 3.3 |
input_voltage | Input Voltage(V) | 1.65 |
max_code | Derived value= pow(2, adc_bits) - 1 | calculated |
step_v | Derived value= v_ref / pow(2, adc_bits) | calculated |
How It Works
ADC Resolution and Digital Conversion
An ADC maps a continuous voltage range to discrete digital codes. The resolution determines the smallest detectable voltage change.
Formulas
Step Size = V_ref / 2^N
Digital Code = floor(V_input / Step Size)
Quantization Error = V_input - Code x Step Size
The maximum quantization error is +/- 0.5 LSB.
Worked Example
10-bit ADC with 3.3 V reference, input 1.65 V.
adc_bits = 10v_ref = 3.3input_voltage = 1.65
- 01Step size: 3.3 / 1024 = 3.223 mV
- 02Digital code: floor(1.65 / 0.003223) = 512
- 03Reconstructed: 512 x 0.003223 = 1.6504 V
- 04Error: |1.65 - 1.6504| = 0.4 mV
Ready to run the numbers?
Open ADC Resolution Calculator