For a standard 12-bit digital to analog and analog to digital converter operating on a 3.3V reference, the digital code 2048 converts exactly to 1.650V. Conversely, an analog input of 1.650V yields the digital code 2048. This baseline answer assumes a unipolar, straight-binary architecture where 0V equals code 0, and the maximum reference voltage (3.3V) equals the maximum code (4095 for 12-bit). If you are working with a 5.0V system like an Arduino Uno, that same code 2048 translates to 2.501V.

The Core Conversion Formulas

The translation between binary codes and physical voltage relies on two fundamental equations. The resolution of your converter—defined by its bit depth ($n$)—dictates the total number of discrete steps ($2^n$).

DAC Formula (Code to Voltage):
$V_{out} = \frac{Code}{2^n - 1} \times V_{ref}$

ADC Formula (Voltage to Code):
$Code = \frac{V_{in}}{V_{ref}} \times (2^n - 1)$

Substituted Example (12-bit, 3.3V Vref, Code 2048):
$V_{out} = \frac{2048}{2^{12} - 1} \times 3.3V$
$V_{out} = \frac{2048}{4095} \times 3.3V = 0.50012 \times 3.3V = \mathbf{1.650V}$

The assumption that fixes this answer is the stability of $V_{ref}$. If your 3.3V rail sags to 3.2V under load, your code 2048 output drops to 1.600V. Always use a dedicated voltage reference IC (like the TI REF3033) for precision work rather than relying on a microcontroller's noisy logic rail.

Neighboring Values Table (±20% Range)

When calibrating sensors or generating control voltages, you rarely sit exactly at mid-scale. Below is a reference table showing a ±20% spread around our mid-scale code (2048), mapped across the three most common reference architectures. Note how the step size (LSB weight) changes drastically with bit depth and voltage.

Digital Code (12-bit) Deviation from Mid 3.3V Unipolar (ESP32/STM32) 5.0V Unipolar (Arduino Uno) ±10V Bipolar (Industrial PLC)
1638 -20% 1.320V 2.000V -2.002V
1843 -10% 1.485V 2.251V -1.001V
2048 Mid-Scale 1.650V 2.501V 0.000V
2253 +10% 1.815V 2.751V +1.001V
2458 +20% 1.980V 3.001V +2.002V

How the Math Shifts for Mains and 3-Phase Systems

A common point of confusion is applying these logic-level formulas directly to mains power monitoring. You cannot feed 120V or 230V into a standard silicon ADC; it will instantly destroy the input stage. The conversion math shifts based on your front-end conditioning network.

  • 120V vs 230V AC Measurement: To measure mains voltage, you must step it down. If you use a 100:1 transformer to step 230V RMS down to 2.3V RMS, your ADC (sampling at 3.3V Vref) will read a peak code of roughly 1604 (since $2.3V \times \sqrt{2} = 3.25V_{peak}$). The math requires multiplying the ADC result by your transformer ratio and dividing by $\sqrt{2}$ to get back to RMS.
  • 3-Phase Systems: Measuring 3-phase power requires three synchronized ADC channels. If your ADC multiplexes (reads channels sequentially rather than simultaneously), you will introduce a phase-shift error in your power factor calculations. For 3-phase, you must use a simultaneous-sampling ADC like the Analog Devices ADE9000, which handles the internal math and phase compensation natively.

When the Conversion Becomes Meaningless

Do not trust your calculated voltage if any of the following conditions exist. In these scenarios, the raw binary code has no physical correlation to the real-world signal.

Warning: Invalid Conversion States

  • Nyquist Violation (Aliasing): If your input signal frequency is higher than half your sample rate ($f_{in} > f_s / 2$), the ADC will output a lower-frequency "alias" code. The voltage reading will be mathematically correct for the alias, but entirely meaningless for the actual signal. Always use an analog low-pass anti-aliasing filter before the ADC pin.
  • Overvoltage Clipping: If $V_{in} > V_{ref}$, the ADC saturates at its maximum code (e.g., 4095). A reading of 4095 means "3.3V or higher." You cannot distinguish between 3.3V and 5.0V without a voltage divider.
  • Unknown/Internal Vref: Many microcontrollers default to using the main power rail as the ADC reference. If your USB port sags from 5.0V to 4.7V, your $V_{ref}$ shifts, and your calculated $V_{in}$ will be wrong by 6%. Always explicitly set the ADC to use a fixed internal bandgap reference (e.g., 1.1V or 2.5V) in your firmware.

Component Decision Tree: Pick Your ADC or DAC

Stop guessing which breakout board to buy. Use this decision matrix to select the exact part number for your workbench based on your interface, speed, and precision requirements.

If your application requires... And your constraint is... Then buy this exact Part Number Typical Price (2026)
Generating slow CV (control voltage) for synths or dimming LEDs via I2C Low cost, 12-bit is enough, single channel Microchip MCP4725 $1.50 - $2.50
Reading load cells, thermocouples, or precision 4-20mA loops High resolution (16-bit), low noise, I2C interface Texas Instruments ADS1115 $3.00 - $5.00
Generating high-speed arbitrary waveforms or audio signals Fast settling time, SPI interface, 16-bit TI DAC8560 $8.00 - $12.00
Measuring 3-phase mains power and power factor Simultaneous sampling, built-in DSP, SPI Analog Devices ADE9000 $18.00 - $25.00

Frequently Asked Questions

Why does my 10-bit Arduino ADC read 1023 instead of 1024 at max voltage?
A 10-bit ADC has $2^{10}$ total states, which is 1024. However, because counting starts at zero, the maximum digital code is $1024 - 1 = 1023$. The formula uses $(2^n - 1)$ in the denominator for DACs and as the multiplier for ADCs to account for this zero-indexing.

Can I use a PWM pin instead of a DAC?Yes, but only for non-critical applications like LED dimming or driving a DC motor via an H-bridge. If you need a true, clean analog DC voltage, you must pass the PWM signal through an RC low-pass filter (e.g., 10kΩ resistor and 1µF capacitor). Even then, expect 20-50mV of ripple. For clean audio or precision sensor excitation, buy a dedicated DAC IC.

What is the difference between unipolar and bipolar ADCs?
A unipolar ADC measures from 0V to $+V_{ref}$ (e.g., 0 to 3.3V). A bipolar ADC measures across a negative and positive range (e.g., -10V to +10V). If you feed a negative voltage into a unipolar ADC, it will either read code 0 or, worse, suffer latch-up and permanent damage unless protected by clamping diodes.