If you are feeding 2.50V DC into a 12-bit a d converter circuit (such as the Texas Instruments ADS1115) configured with a 4.096V internal reference, the direct converted digital output is exactly 2500 in decimal (or 0x9C4 in hexadecimal). This assumes a unipolar, single-ended measurement where 0V equals a code of 0, and the full-scale reference voltage equals the maximum code.
The Core Conversion Formula
The fundamental math governing any analog-to-digital conversion is:
Digital Code = (Vin / Vref) × 2N
Substituting our exact query values:
- Vin (Input Voltage) = 2.50V
- Vref (Reference Voltage) = 4.096V
- N (Resolution) = 12 bits (meaning 212 = 4096 total steps)
Calculation: (2.50 / 4.096) × 4096 = 2500
Neighboring Values Table (±20% Range)
Here is how the digital output shifts across a ±20% range around our 2.50V baseline (2.00V to 3.00V), assuming the same 12-bit, 4.096V reference configuration:
| Analog Input (Vin) | Decimal Code | Hex Code | Step Delta |
|---|---|---|---|
| 2.00V | 2000 | 0x7D0 | -500 |
| 2.20V | 2200 | 0x898 | -300 |
| 2.40V | 2400 | 0x960 | -100 |
| 2.50V (Baseline) | 2500 | 0x9C4 | 0 |
| 2.60V | 2600 | 0xA28 | +100 |
| 2.80V | 2800 | 0xAF0 | +300 |
| 3.00V | 3000 | 0xBB8 | +500 |
What Assumptions Fix Your ADC Conversion Answer
The numeric output of an a d converter circuit is entirely dependent on three fixed assumptions. If any of these drift, your calculated voltage will be wrong, regardless of how perfect your code is.
- Reference Voltage (Vref) Stability: The ADC doesn't actually measure absolute voltage; it measures the ratio of the input to the reference. If you rely on the microcontroller's 3.3V VCC as your Vref, and your USB supply sags to 3.1V under load, your digital code will artificially spike. For precision work, always use an ADC with an internal bandgap reference (like the ADS1115's 4.096V or 2.048V options) or an external precision reference IC like the TI REF5040.
- Resolution (N-bits): A 10-bit ADC (1024 steps) will output a code of 625 for that same 2.50V input. A 16-bit ADC (65536 steps) will output 40000. You must explicitly define N in your firmware.
- Polarity (Unipolar vs. Bipolar): The calculation above assumes unipolar (0V to Vref). If your a d converter circuit is configured for bipolar inputs (e.g., ±2.048V), 0V yields a mid-scale code (0 or 32768 depending on two's complement formatting), and negative voltages yield negative digital codes.
Scaling the A D Converter Circuit for 120V, 230V, and 3-Phase Mains
You can never feed mains voltage directly into a silicon ADC. The answer shifts dramatically based on the front-end analog scaling required to keep the ADC within its absolute maximum ratings (usually 0-3.3V or 0-5V). Here is how the circuit topology and resulting math shift across different mains standards:
- 120V AC (North America): The nominal 120V RMS has a peak voltage of ~170V. To measure this, your a d converter circuit requires a high-impedance resistor voltage divider stepping 170V down to ~1.0V peak, followed by an isolation amplifier like the TI AMC1301 to protect your low-voltage logic from lethal fault currents.
- 230V AC (Europe/Global): The peak voltage jumps to ~325V. The resistor divider ratio must be increased (generating more heat and requiring higher voltage-rated resistors, like 1/2W metal film), or you must switch to a potential transformer (PT) module like the ZMPT101B to step the voltage down safely before the ADC samples it.
- 3-Phase Industrial: Measuring 3-phase power requires three isolated, synchronized ADC channels. Instead of building three discrete a d converter circuits, engineers shift to dedicated energy metering ICs like the Analog Devices ADE9000. These chips contain internal multi-phase ADCs and hardware DSP blocks that handle the scaling, phase-shift correction, and RMS calculations autonomously.
When the ADC Conversion Becomes Meaningless
An a d converter circuit will happily spit out digital numbers all day, but those numbers become mathematically and practically meaningless under two specific conditions:
- When the Power Factor (pf) is Unknown in AC Power Calculations: If you are sampling AC voltage and AC current to calculate Real Power (Watts), the conversion is meaningless if the phase angle or pf is unknown. Multiplying RMS Voltage × RMS Current only gives you Apparent Power (VA). Without synchronous sampling to capture the exact time-delay (phase shift) between the voltage and current waveforms, you cannot calculate the true work being done by the load.
- When the Sampling Rate Violates Nyquist: According to the Nyquist-Shannon sampling theorem, you must sample at least twice the highest frequency component of your signal. If you are measuring a 60Hz mains signal that contains high-frequency switching noise from a VFD (variable frequency drive) at 5kHz, and your ADC is only sampling at 1kHz, that 5kHz noise will 'fold back' and alias into your reading as a false low-frequency signal. Your digital code will be completely detached from reality.
Frequently Asked Questions
How do I wire a 16-bit a d converter circuit for bipolar ±10V inputs?
Silicon ADCs cannot natively read negative voltages or voltages above their VCC. To read ±10V with a 16-bit ADC like the AD7606, you must use a front-end op-amp level-shifter circuit. This circuit uses a precision resistor network to divide the ±10V signal down to ±2.5V, and then adds a +2.5V DC offset, mapping the -10V to +10V input range to a 0V to 5V range that the ADC can safely digitize.
Why is my a d converter circuit output fluctuating by ±10 LSBs?
Fluctuation in the Least Significant Bits (LSBs) is almost always caused by a noisy reference voltage or missing decoupling capacitors. Ensure you have a 100nF ceramic capacitor and a 10µF tantalum capacitor placed as physically close to the ADC's VCC and Vref pins as possible. Additionally, check for ground loops; if your analog sensor ground is at a slightly different potential than your ADC ground, that delta will be amplified directly into your digital code.
Can I use an ESP32 internal ADC instead of an external a d converter circuit for precision DC?
No. The internal ADC on the ESP32 (and ESP8266) is notoriously non-linear, particularly at the extreme low (0-0.2V) and high (3.0-3.3V) ends of its range, and it suffers from significant noise due to the internal RF radios. For any application requiring better than ±5% accuracy, bypass the internal ADC entirely and use an external I2C a d converter circuit like the ADS1115 or an SPI ADC like the MCP3208.






