An analog to digital converter (ADC) is a semiconductor circuit that samples continuous voltage and translates it into discrete binary numbers. If you are asking what an analog to digital converter outputs for a specific voltage, the direct answer depends entirely on your reference voltage and bit-depth. For a standard 10-bit ADC with a 5.0V reference (like the ATmega328P on an Arduino Uno), an input of 2.5V converts exactly to a digital value of 512. The governing formula is D = (V_in / V_ref) × (2^n - 1). Substituting our bench values: (2.5 / 5.0) × 1023 = 511.5, which the microcontroller rounds to 512. This Volts-to-Bits conversion is the foundation of all microcontroller sensor reading.
Before calculating your own conversions, you must select the right silicon. Here is a data-dense specification table of the most common ADCs used in maker and prototyping environments in 2026:
| Component | Interface | Resolution | Max Sample Rate | V_ref Range | Approx. Cost (2026) |
|---|---|---|---|---|---|
| ATmega328P (Internal) | Internal Bus | 10-bit | 15 kSPS | 0 - 5.0V | $2.50 (MCU) |
| ESP32-WROOM-32 (Internal) | Internal Bus | 12-bit | 1 MSPS | 0 - 3.3V | $3.00 (MCU) |
| Microchip MCP3008 | SPI | 10-bit | 200 kSPS | 2.7 - 5.5V | $1.85 |
| Texas Instruments ADS1115 | I2C | 16-bit | 860 SPS | 0.3 - 6.1V | $4.20 |
Voltage-to-Digital Conversion Math & Reference Tables
The assumption that fixes any ADC answer is the Reference Voltage (V_ref) combined with the Bit-Depth (n). The ADC divides V_ref into 2^n discrete steps. If V_ref drifts due to a noisy USB power supply, your digital output will drift proportionally, even if the analog input is perfectly stable.
Below is a conversion table showing neighboring values within a ±20% range around a 2.5V center point. This demonstrates how a 10-bit system (5.0V V_ref) compares to a 12-bit system (3.3V V_ref, common on ARM and ESP32 boards). Notice the step size: the 10-bit ADC jumps in ~4.88mV increments, while the 12-bit ADC jumps in ~0.80mV increments.
| Analog Input (V_in) | 10-Bit Output (5.0V V_ref) | 12-Bit Output (3.3V V_ref) | Step Delta (12-bit) |
|---|---|---|---|
| 2.00V | 409 | 2482 | - |
| 2.20V | 450 | 2730 | +248 |
| 2.40V | 491 | 2978 | +248 |
| 2.50V (Center) | 512 | 3102 | +124 |
| 2.60V | 532 | 3226 | +124 |
| 2.80V | 573 | 3474 | +248 |
| 3.00V | 614 | 3723 | +249 |
For deeper theoretical background on quantization noise and step sizing, the Analog Devices Data Conversion Handbook remains the definitive industry reference.
How Reference Voltage and Bit-Depth Shift the Output
Just as AC power calculations shift drastically between 120V and 240V mains, ADC conversions shift based on your logic-level environment. You cannot apply a universal formula without declaring your V_ref.
- 3.3V Systems (ESP32, STM32, Raspberry Pi Pico): The maximum readable voltage is 3.3V. If you feed 5.0V into an ESP32 GPIO configured as an ADC, you will not get a higher number; you will clip at the maximum value (4095 for 12-bit) and likely degrade the silicon over time. To read a 5V signal here, you must use a voltage divider (e.g., 10kΩ and 20kΩ resistors) to scale it down to 3.3V, then multiply the software result by 1.5.
- 5.0V Systems (Arduino Uno/Mega, ATmega series): The default V_ref is tied to the 5V USB rail. Because USB power from a PC can sag to 4.7V under load, your 5.0V assumption breaks, introducing a 6% error into your math. For precision work, use the microcontroller's internal 1.1V reference bandgap, or an external precision IC like the LM4040.
- 12V / 24V Industrial Systems: Microcontrollers cannot read these directly. You must use an op-amp scaling circuit or an isolated ADC module (like an I2C ADS1115 paired with a high-voltage resistor network) to step the voltage down to the 0-3.3V or 0-5V window.
When designing for precision, remember that the ESP32's internal 12-bit ADC is notoriously non-linear near the 0V and 3.3V rails. Espressif's official ESP-IDF ADC documentation recommends software calibration routines or using an external I2C ADC if your sensor operates in the bottom 10% of the voltage range.
When ADC Conversion Becomes Meaningless (Failure Modes)
Calculating the exact bit-value is useless if the physical sampling conditions violate the laws of signal processing. The conversion becomes mathematically meaningless in three specific scenarios:
If your analog signal is a 1kHz sine wave, your ADC must sample at a minimum of 2kHz (2× the highest frequency component). If your microcontroller loop is bogged down with delay() calls or heavy I2C transactions and only polls the ADC at 500Hz, you will experience aliasing. The digital output will reconstruct as a completely false, lower-frequency waveform. Always use hardware timers or DMA (Direct Memory Access) to trigger ADC reads at fixed intervals.
An ADC pin has extremely high input impedance (often >100MΩ). If left disconnected, it acts as an antenna, picking up 50/60Hz mains hum and RF interference. The digital output will jitter wildly between 0 and 1023. Always tie unused ADC pins to GND, and ensure sensor circuits have a pull-down or pull-up resistor to provide a defined DC path.
Successive Approximation Register (SAR) ADCs, like those inside the ATmega328P, use an internal sample-and-hold capacitor (typically 14pF). If your analog signal comes from a high-impedance source (like a 1MΩ voltage divider), the internal capacitor cannot charge fully during the brief sampling window. The result is a digital reading that is consistently lower than the actual voltage. Keep your source impedance below 10kΩ, or buffer the signal with an op-amp voltage follower.
Frequently Asked Questions
What is the difference between an ADC and a DAC?
An ADC (Analog-to-Digital Converter) reads real-world voltages and turns them into binary numbers for a microcontroller to process. A DAC (Digital-to-Analog Converter) does the reverse: it takes binary numbers from the microcontroller and outputs a proportional continuous voltage to drive analog circuits.
Why does my 10-bit ADC read 1023 instead of 1024 at max voltage?
A 10-bit ADC has 1024 distinct states, but because it starts counting at zero, the maximum decimal value is 1023 (binary 1111111111). The formula uses 2^n - 1 to account for this zero-indexing.
Can I multiplex multiple analog sensors into one ADC pin?
Yes, using an analog multiplexer IC like the CD4051 or 74HC4067. However, switching between high-impedance sources requires a brief settling delay in your code to allow the ADC's internal sample-and-hold capacitor to charge to the new voltage level before taking the reading. For more on multiplexing architectures, review Texas Instruments' ADC circuit topologies.






