Converting a 12-bit digital code of 2047 to an analog voltage using a 3.3V reference yields exactly 1.650V. The formula used is Vout = Vref × (D / (2n - 1)), substituting the values: 3.3V × (2047 / 4095) = 1.650V. If you are using a 5.0V reference instead, that same 2047 code shifts to 2.501V. The conversion is entirely dependent on your reference voltage and bit-depth, not the digital code alone.

Common Digital to Analog Converter IC Specifications

Before calculating your exact output, you need to know the hardware limits of your DAC. Below is a data-dense specification table of the most common DAC integrated circuits used in embedded systems and bench prototypes in 2026. Notice how the internal reference and resolution dictate your minimum step size (Least Significant Bit, or LSB).

Part Number Resolution Vref Range Settling Time Interface Approx. Price
Microchip MCP4725 12-bit 2.7V - 5.5V 6 µs I2C $1.20
Texas Instruments DAC8562 16-bit 2.7V - 5.5V 10 µs SPI $4.50
Analog Devices AD5686R 16-bit 2.7V - 5.5V 8 µs SPI $6.80
Maxim MAX5216 14-bit 2.7V - 3.6V 12 µs SPI $3.10

Sources: Texas Instruments DAC Portfolio, Analog Devices Data Converters.

The Core Conversion Formula and Critical Assumptions

The universal formula for a unipolar DAC is:

Vout = Vref × [ D / (2n - 1) ]

Where D is the digital integer code, n is the bit-resolution, and Vref is the reference voltage. The assumption that fixes your answer is the stability and exact value of Vref. If your 3.3V rail is actually sagging to 3.24V under load, your 1.650V output will drop to 1.620V. Always measure Vref at the DAC pin with a multimeter before trusting the math.

Readers transitioning from AC mains wiring often ask how the math shifts for 120V vs 230V vs 3-phase systems. In the context of digital to analog converters, mains voltage, phase angles, and power factor (pf) are completely meaningless. DACs operate strictly on low-voltage DC. Instead of line voltages, your conversion shifts based on the DC reference rail—typically 3.3V, 5V, or 10V. A 10V reference is common in industrial PLC analog output modules, while 3.3V dominates modern ESP32 and Raspberry Pi Pico projects.

When is this conversion meaningless?
The calculated voltage becomes meaningless if the DAC output is unbuffered and driving a low-impedance load (e.g., a 50Ω resistor or a heavy motor coil). The internal output impedance of the DAC (often 1kΩ to 10kΩ) will form a voltage divider, causing severe voltage sag. Always use an op-amp voltage follower (like the LM358 or OPA340) to buffer the DAC output if your load draws more than a few milliamps.

Neighboring Values: 12-Bit DAC at 3.3V (±20% Range)

When tuning a control loop or calibrating a sensor, you rarely land on the exact midpoint. Here is a quick-reference table for a 12-bit DAC (4095 max code) on a 3.3V reference, showing a ±20% spread around the 2047 midpoint code. This represents the typical adjustment range for fine-tuning an analog setpoint.

Digital Code (D) Hex Value Calculated Vout (3.3V Ref) Step Delta from Midpoint
1638 0x666 1.319V -0.331V
1843 0x733 1.484V -0.166V
2047 0x7FF 1.650V 0.000V (Midpoint)
2251 0x8CB 1.815V +0.165V
2456 0x998 1.980V +0.330V

Inline Data Highlight: At 12-bit resolution on a 3.3V rail, one single LSB (Least Significant Bit) step equals exactly 0.805 mV. If your multimeter only reads to two decimal places, you will not be able to see a 1-code change.

Choosing the Right Resolution for Your Voltage Range

Selecting a DAC isn't just about picking the highest bit-depth; it's about matching the step size to your system's noise floor. If your circuit has 10mV of switching noise from a nearby buck converter, buying a 16-bit DAC with a 0.05mV step size is a waste of money—the noise will dither the lower bits anyway.

Resolution Total Steps LSB Size at 5.0V Best Use Case
8-bit 256 19.53 mV Basic LED dimming, simple audio waveforms, slow motor control.
12-bit 4,096 1.22 mV Programmable power supplies, function generators, PID control loops.
16-bit 65,536 0.076 mV Precision lab equipment, medical sensor biasing, high-end audio.

Frequently Asked Questions

Why does my ESP32 output 3.1V when I command the maximum 3.3V code?
The built-in DAC on the original ESP32 (GPIO 25 and 26) is notoriously non-linear and suffers from internal voltage drops. It rarely hits the true 3.3V rail. For precision work, bypass the internal DAC and use an external I2C module like the MCP4725.

Do I need pull-up resistors on the I2C lines for an MCP4725?
Yes. While many breakout boards include 4.7kΩ pull-ups to 3.3V, if you are wiring a bare MCP4725 SOT-23-6 chip directly to a microcontroller, you must add 4.7kΩ pull-up resistors on both SDA and SCL. Without them, the I2C bus will float, and the DAC will latch onto random noise codes.

Can I use a PWM pin and an RC filter instead of a DAC IC?
You can, but the ripple voltage will be significant. A simple 1kΩ resistor and 1µF capacitor on a 5kHz PWM pin will yield a DC voltage, but with tens of millivolts of ripple. If your application requires a clean, flat DC reference (like biasing an op-amp), spend the $1.20 on a dedicated DAC IC.