Converting a 5.0V analog signal using a standard 12-bit analog to digital converter (ADC) yields a maximum digital code of 4095 and a voltage resolution (Least Significant Bit, or LSB) of exactly 1.22 mV. The foundational formula used is LSB = Vref / 2n. Substituting our exact query values: LSB = 5.0V / 212 = 5.0V / 4096 = 0.00122V. The resulting digital code D is calculated as Vin / LSB, so 5.0V / 0.00122V = 4095. This absolute conversion assumes a perfectly stable 5.0V reference voltage (Vref) and an ideal 12-bit resolution (n=12) with zero noise. If your reference voltage drifts to 4.95V, your LSB shrinks to 1.208 mV, introducing a systemic scaling error across every reading.
The Core Conversion: Volts to Bits Across ADC Types
The mathematical conversion from analog voltage to digital bits remains constant regardless of the types of analog to digital converter you choose, but the physical reality of the silicon dictates whether that math holds up on your workbench. The assumption that fixes your answer is always your Vref stability and your bit depth (n). A 10-bit ADC on an Arduino Uno (ATmega328P) gives you 1024 steps, while a 16-bit external module gives you 65,536 steps.
You cannot feed 120V or 230V AC directly into a microcontroller ADC; doing so will instantly destroy the silicon. To measure 120V RMS (which peaks at ~169V), you must use a resistor divider or an isolation amplifier (like the TI AMC1301) to scale the signal down to a safe 0–3.3V bipolar swing. The conversion formula then requires multiplying your digital result by the divider ratio (e.g., ×100). For 230V RMS (~325V peak), your divider ratio must be roughly doubled to maintain the same ADC input range. For 3-phase systems, you must sample three separate ADC channels simultaneously. If your ADC multiplexes rather than sampling all three phases at the exact same microsecond, the 120-degree phase shift will skew your calculations, rendering your computed power factor and real power fundamentally wrong.
Resolution Table: Neighboring Bit Depths (±20% Range)
When selecting an ADC, you rarely jump straight from 12-bit to 24-bit. Here is the conversion table for the neighboring ±20% bit-depth range (10-bit through 14-bit), showing how your voltage step size shrinks as resolution increases. Note how the choice between a 3.3V logic system (like an ESP32 or Raspberry Pi Pico) and a 5.0V system (like a classic Arduino Uno) drastically alters your LSB.
| Bit Depth (n) | Total Steps (2n) | LSB at 3.3V Vref | LSB at 5.0V Vref |
|---|---|---|---|
| 10-bit | 1,024 | 3.222 mV | 4.882 mV |
| 11-bit | 2,048 | 1.611 mV | 2.441 mV |
| 12-bit (Baseline) | 4,096 | 0.805 mV | 1.220 mV |
| 13-bit | 8,192 | 0.402 mV | 0.610 mV |
| 14-bit | 16,384 | 0.201 mV | 0.305 mV |
Matching ADC Architectures to Your Signal
The term "types of analog to digital converter" usually refers to the internal silicon architecture. The math above applies to all of them, but their real-world behavior differs wildly.
- Successive Approximation Register (SAR): The workhorse of medium-speed, medium-precision applications. They use a binary search algorithm to find the voltage. Bench Pick: The Microchip MCP3008 (10-bit, ~$2.50) for basic SPI sensor reading, or the Analog Devices AD7606 (16-bit, ~$25.00) for precision DAQ. SAR ADCs are fast but can suffer from kickback noise if your source impedance is too high.
- Sigma-Delta (ΣΔ): These oversample the signal at a high rate and use digital filtering to achieve massive resolution at low speeds. Bench Pick: The TI ADS1115 (16-bit I2C, ~$3.50) is the gold standard for adding precision DC measurement to an ESP32, while the HX711 (24-bit, ~$1.50) is dedicated to load cells.
- Flash: Ultra-high speed, low precision. They use a massive ladder of comparators to convert in a single clock cycle. Bench Pick: The AD9235 (12-bit, 65 MSPS, ~$40.00) for software-defined radio or oscilloscope builds. You sacrifice bit depth for raw speed.
When the conversion is meaningless: Calculating a 24-bit LSB of 0.298 µV (on a 5V HX711) is mathematically correct but practically meaningless on a standard breadboard. If your circuit has 5mV of 60Hz mains hum or thermal noise, that noise floor completely swallows the bottom 14 bits of resolution. Your 24-bit ADC is effectively performing as a 10-bit ADC. Always match your ADC type to your actual noise floor, not just the datasheet bit depth.
Frequently Asked Questions
What are the main types of analog to digital converters used in microcontrollers?
Most internal microcontroller ADCs (like those in the ATmega328P or STM32 lines) are SAR (Successive Approximation Register) architectures, typically ranging from 10-bit to 12-bit. They are fast enough for general potentiometer and basic sensor reading but lack the precision for lab-grade measurements. For higher precision, makers use external Sigma-Delta ADCs connected via I2C or SPI.
How does the ADC conversion change when measuring 120V or 230V AC mains?
The core bit-to-volt formula remains identical, but you must introduce a scaling factor and a DC bias. Because AC swings negative and microcontrollers only read 0V to Vref, you must bias the AC signal to Vref/2 (e.g., 1.65V on a 3.3V system). A 120V RMS signal peaks at ~169V; a 100:1 voltage divider scales this to 1.69V peak. Your code must subtract the 1.65V DC bias from the ADC reading, then multiply the result by 100 to reconstruct the true mains voltage.
When does calculating ADC voltage resolution become meaningless?
The conversion becomes meaningless when your system noise floor exceeds the LSB size. According to Analog Devices' ADC architecture tutorials, a 24-bit ADC theoretically resolves microvolts. However, standard jumper wires and breadboards act as antennas for EMI. If your environment introduces 10mV of noise, any ADC resolution finer than 10mV is just digitizing noise. In these cases, a cheaper 12-bit SAR ADC is just as effective as a $30 24-bit Sigma-Delta.
Why do my ESP32 internal ADC readings fluctuate when the math says it should be precise?
The ESP32's internal 12-bit ADC is notorious for non-linearity and noise, particularly near the 0V and 3.3V rails. As noted in the official ESP-IDF documentation, the internal ADC can exhibit ±100mV of fluctuation due to internal Wi-Fi/Bluetooth RF interference and silicon variance. If your project requires stable, repeatable voltage conversions (like reading a precision current shunt), bypass the internal ADC entirely and wire up an external I2C ADS1115 module.






