At its core, an Analog-to-Digital Converter (ADC) is simply a unit converter: it translates continuous analog voltage (Volts) into discrete digital integers (Bits). If you are asking what is the analog to digital converter output for a standard microcontroller setup, here is the direct answer: For a 12-bit ADC with a 3.3V reference voltage, an analog input of exactly 1.65V converts to the digital integer 2047.
Digital Value = (Vin / Vref) × (2n - 1)
Substituted: (1.65V / 3.3V) × (212 - 1) = 0.5 × 4095 = 2047.5 (truncated to 2047 by the hardware register).
The assumption that fixes this answer is a perfectly stable 3.3V reference voltage (Vref) and a 12-bit resolution (n=12). If your reference voltage sags to 3.2V due to a noisy USB power supply, that same 1.65V input will suddenly read as 2111. Understanding this Volts-to-Bits conversion is the difference between a reliable data logger and a bench prototype that throws garbage data.
The Core Conversion: Volts to Discrete Bits
An ADC slices the continuous voltage range into discrete steps. A 12-bit ADC has 4,096 possible steps (0 to 4095). The voltage difference between each step is called the Least Significant Bit (LSB) voltage, or quantization step. For a 3.3V reference, one LSB equals 3.3V / 4095 = 0.805 mV. This means the ADC cannot distinguish between 1.6500V and 1.6508V; they both map to 2047.
When you are bench-testing a sensor, you rarely sit exactly on the midpoint. Here is how the digital output shifts across a ±20% range around our 1.65V baseline, assuming a 12-bit resolution and 3.3V reference:
| Analog Input (Vin) | Deviation from Baseline | Digital Output (Decimal) | Hexadecimal Register |
|---|---|---|---|
| 1.320V | -20% | 1638 | 0x0666 |
| 1.485V | -10% | 1843 | 0x0733 |
| 1.650V | Baseline | 2047 | 0x07FF |
| 1.815V | +10% | 2251 | 0x08CB |
| 1.980V | +20% | 2457 | 0x0999 |
According to All About Circuits, the most common mistake hobbyists make here is ignoring quantization error. If your sensor outputs a 5mV change, a 10-bit ADC (3.2mV LSB) will barely register it, while a 16-bit ADC (0.05mV LSB) will capture it cleanly.
Scaling for Mains: 120V, 230V, and 3-Phase Shifts
You cannot feed mains voltage directly into a microcontroller ADC. The conversion math shifts entirely based on your front-end scaling network (voltage dividers or Potential Transformers). Here is how the ADC sees the grid depending on your region and phase setup:
- 120V AC (North America): A 120V RMS sine wave has a peak voltage of ~170V. Using a standard 100:1 Potential Transformer (PT), the ADC sees 1.2V RMS (1.7V peak). The ADC reads a fluctuating integer between roughly 0 and 2111 (assuming a DC offset is added to keep the wave positive).
- 230V AC (EU/UK/AU): A 230V RMS wave peaks at ~325V. If you use that same 100:1 PT, the ADC sees 3.25V peak. On a 3.3V reference ADC, you are dangerously close to the clipping rail. The conversion shifts: you must step up to a 150:1 divider to keep the peak under 2.5V, leaving headroom for grid swells.
- 3-Phase Systems: Measuring 3-phase isn't just about higher voltage; it's about floating neutrals and phase shifts. A single-ended ADC referenced to earth ground will short out or read garbage when connected across two live phases. The conversion requires a differential ADC (measuring the voltage difference between Phase A and Phase B directly) or isolated ADCs on each phase.
When the Conversion Becomes Meaningless
An ADC will always spit out a number, but that number is mathematically meaningless under three specific conditions:
- Violating the Nyquist Limit (Aliasing): To accurately reconstruct a signal, your ADC sampling rate must be at least twice the highest frequency component of the signal. If you are sampling a 60Hz AC waveform at 100Hz, you will get a beat frequency that looks like a slow, random drift. The conversion is meaningless; you must sample at ≥2kHz for clean 60Hz RMS calculations.
- Source Impedance Mismatch: Microcontroller ADCs (like the internal ADC on an ESP32 or ATmega328P) have an internal sampling capacitor that must charge up in a few microseconds. If your voltage divider uses high-value resistors (e.g., 1MΩ and 1MΩ), the capacitor cannot charge in time. The ADC will read a lower voltage than actually exists. Keep your Thevenin equivalent source impedance under 10kΩ.
- Floating Inputs: If an ADC pin is left unconnected (floating), it acts as an antenna. It will convert ambient electromagnetic noise into random integers between 0 and 4095. Always tie unused ADC pins to ground via a 10kΩ pull-down resistor.
Decision Path: Which ADC Should You Actually Use?
Don't just default to the internal ADC on your microcontroller. Use this decision tree to select the right hardware for your specific conversion needs.
| Your Application | Required Resolution | Required Speed | Concrete Hardware Pick |
|---|---|---|---|
| Rough prototyping, basic potentiometers, battery voltage checks | 10 to 12-bit | Low to Medium | Internal ESP32 / Arduino ADC |
| Precision DC sensors (load cells, RTDs), high-accuracy mains RMS | 16-bit+ | Low (860 SPS max) | Texas Instruments ADS1115 |
| Audio sampling, high-frequency vibration analysis, fast oscilloscopes | 8 to 12-bit | Very High (1+ MSPS) | Microchip MCP3008 (SPI) or dedicated SAR ADCs |
| 3-phase motor control, isolated high-voltage differential measurements | 12 to 16-bit | High (Simultaneous sampling) | Isolated Sigma-Delta modulators (e.g., AMC1301) |
The Default Recommendation: If you need precision and are tired of the noisy, non-linear readings from the internal ESP32 or Arduino ADC, buy an ADS1115 breakout board (usually around $5 to $8). It is a 16-bit, 4-channel I2C ADC with an internal Programmable Gain Amplifier (PGA). As detailed in the TI ADS1115 Datasheet, the PGA allows you to switch the reference voltage internally from 6.144V down to 0.256V, effectively magnifying tiny sensor signals without needing external op-amps.
Frequently Asked Questions
Why does my ESP32 ADC read 4095 when I apply 3.3V?
The ESP32's internal ADC is notoriously non-linear at the top and bottom of its range. Furthermore, if your board has a voltage divider on the A0 pin (common on some dev kits to allow 5V input), 3.3V will be scaled up internally and clip the register at the maximum 12-bit value of 4095. For accurate top-end readings, use an external ADS1115.
Does a higher bit resolution always mean better accuracy?
No. Resolution is how fine the slices are; accuracy is how close the slice is to reality. A cheap 16-bit ADC with a noisy 5V USB power supply acting as its Vref will yield 16 bits of highly detailed, completely inaccurate garbage. According to Analog Devices, true accuracy requires a dedicated, low-drift voltage reference IC (like the REF3033) feeding the ADC's VREF pin, completely bypassing the noisy microcontroller power rail.






