If you are reading 2.15V on a 16-bit successive approximation analog to digital converter (SAR ADC) with a 5.0V reference, your direct digital output code is 28180 (or 0x6E14 in hex). This assumes an ideal, unipolar ADC where 0V equals code 0 and 5.0V equals the maximum code of 65535. If your reference voltage, resolution, or input signal type changes, this number shifts predictably based on the LSB (Least Significant Bit) weight.
The Core Conversion Formula and Neighboring Values
The fundamental math for any unipolar SAR ADC relies on dividing the input voltage by the reference voltage, then scaling it to the total number of discrete steps ($2^N$, where $N$ is resolution).
Substituted (16-bit, 5V Vref): $Code = \lfloor \frac{2.15}{5.0} \times 65536 \rfloor = \lfloor 0.43 \times 65536 \rfloor = \mathbf{28180}$
To understand how sensitive the ADC is to minor fluctuations, here is a spec-sheet-table showing the digital codes for a ±20% variance around our 2.15V nominal input. This is critical when setting software thresholds for alarms or triggers.
| Variance | Input Voltage ($V_{in}$) | Decimal Code | Hex Code | LSB Weight (76.29µV) |
|---|---|---|---|---|
| -20% | 1.720V | 22544 | 0x5810 | -5620 codes |
| -10% | 1.935V | 25362 | 0x6312 | -2818 codes |
| Nominal | 2.150V | 28180 | 0x6E14 | Baseline |
| +10% | 2.365V | 31000 | 0x7918 | +2820 codes |
| +20% | 2.580V | 33816 | 0x8418 | +5636 codes |
What Assumptions Fix This Answer?
The calculation above is locked in by three strict assumptions: a 5.0V unipolar reference, a 16-bit resolution, and an ideal transfer function with zero offset error. Change any of these, and the code shifts.
How the Math Shifts for Different Reference Voltages
- 3.3V Systems (e.g., ESP32 native or MCP3208): If $V_{ref}$ is 3.3V, the same 2.15V input yields $\lfloor \frac{2.15}{3.3} \times 4096 \rfloor = 2668$ (for a 12-bit ADC).
- 5.0V Systems (e.g., Classic Arduino or ADS1115): Yields 28180 as calculated above.
- Bipolar ±10V Systems (e.g., Industrial AD7606): If the ADC accepts -10V to +10V (20V span) at 16 bits, 0V is mid-scale (code 32768). The 2.15V input shifts to $32768 + \lfloor \frac{2.15}{20} \times 65536 \rfloor = 39813$.
How the Answer Shifts for 120V vs 230V vs 3-Phase Mains
When your SAR ADC is at the end of a voltage divider or potential transformer measuring AC mains, the nominal DC math shifts to AC RMS-to-peak scaling:
- For 120V nominal (170V peak): A 34:1 step-down yields a 5V peak, perfectly utilizing a unipolar 0-5V ADC's range without clipping.
- For 230V nominal (325V peak): That same 34:1 ratio yields 9.5V, instantly clipping a 5V ADC. You must shift to a 65:1 ratio or use a bipolar ±10V SAR ADC.
- For 3-phase systems: A standard multiplexed SAR ADC introduces fatal phase-skew between channels because it samples sequentially. You must shift to a simultaneous-sampling SAR ADC (like the AD7606-8) to capture all three phases at the exact same microsecond.
The math breaks down entirely if your input noise floor exceeds 1 LSB. On a 16-bit ADC with a 5V reference, 1 LSB is 76.29µV. If your breadboard has 2mV of switching noise from a nearby buck converter, your lower 5 bits are random garbage. Furthermore, if $V_{in} > V_{ref}$, the ADC saturates and outputs the maximum code (65535), giving you no data about how far over the limit you actually are.
Decision Tree: Picking the Right SAR ADC Part
Do not default to the built-in ADC on your microcontroller; most MCU SAR ADCs (like the ATmega328P's 10-bit or the ESP32's 12-bit) suffer from severe non-linearity and VCC-coupled noise. Use this decision-tree-table to select a dedicated external IC.
| If your application requires... | Then you need... | Concrete Pick (2026 Pricing) |
|---|---|---|
| High precision (16-bit) at low speed (DC/thermal sensors) via I2C | A low-power I2C SAR with internal PGA | TI ADS1115 (~$1.50 on breakout) |
| Medium speed (100 kSPS) multi-channel data acquisition via SPI | A 12-bit or 16-bit SPI SAR multiplexer | Microchip MCP3208 (~$1.20 bare IC) |
| Industrial isolation, ±10V inputs, and simultaneous 3-phase sampling | A 16-bit simultaneous-sampling SAR with integrated analog front-end | ADI AD7606-8 (~$18.00 bare IC) |
| Ultra-high speed (>1 MSPS) for RF or audio envelope tracking | Abandon SAR; switch to a Pipeline ADC | Out of scope for SAR |
Real-World Errors That Break the Math
The formula $Code = (V_{in} / V_{ref}) \times 2^N$ assumes a perfect staircase transfer function. In reality, the successive approximation register (SAR) architecture relies on an internal capacitor DAC that introduces specific silicon-level errors.
Integral Non-Linearity (INL) and Differential Non-Linearity (DNL): A cheap 12-bit ADC might have an INL of ±4 LSB. This means your calculated code could be off by 4 steps from the ideal straight line, regardless of how clean your input voltage is. The TI ADS1115 guarantees a maximum INL of ±1 LSB, which is why it remains the gold standard for hobbyist and prosumer bench tools.
Reference Voltage Drift: If you use the microcontroller's 3.3V LDO as your $V_{ref}$, and that LDO has a temperature coefficient of 100 ppm/°C, a 20°C rise in your enclosure shifts your $V_{ref}$ by 6.6mV. On a 16-bit ADC, that 6.6mV shift translates to an error of ~86 codes at full scale. For precision work, always feed the SAR ADC from a dedicated, low-drift voltage reference IC like the REF3033.
FAQ: Successive Approximation ADC Conversions
Why does my SAR ADC output fluctuate by ±10 codes even with a stable DC input?
This is thermal noise and quantization noise. If your source impedance is high (>10kΩ), the internal sampling capacitor of the SAR ADC cannot fully charge during the acquisition window, resulting in missing codes. Buffer your analog signal with an op-amp (like the OPA333) configured as a voltage follower before it hits the ADC pin.
Can I use a 5V SAR ADC to measure a ±12V signal?
Not directly. Applying a negative voltage to a unipolar SAR ADC input will forward-bias the internal ESD protection diodes, potentially destroying the silicon. You must use a resistor divider to scale the voltage into the 0-5V window, or use an op-amp summing circuit to shift and scale the bipolar signal into a unipolar range.
Is a higher bit count always better?
No. A 24-bit Sigma-Delta ADC offers more resolution than a 16-bit SAR, but it is drastically slower. If you are measuring a 50kHz PWM envelope or capturing acoustic transients, the SAR ADC's high sampling rate (often 1 MSPS+) is mandatory, making the 16-bit SAR the correct engineering choice over a 24-bit alternative.






