Toolvito

Works on this device

Adc Voltage Calculator

An analog-to-digital converter (ADC) turns a voltage into a whole number, its code. This calculator turns a code back into the voltage it stands for, a voltage into the code an ideal converter gives, and a known voltage and its code into the reference voltage.

Enter your values

The voltage that a code of an ideal converter stands for, and the band of input voltages that give it.

Your values

For example 10, 12, 16 or 24 bits.

Usually the reference voltage of the converter.

Usually 0 V (ground). For a range of −5 V to +5 V, type −5.

Bipolar converters often give two's complement codes. Offset binary is the same as straight binary here.

A whole number such as 2048, or a pattern such as 0x800 or 0b100000000000.

An ideal converter rounds to the nearest code. Many simple models, and some converters, truncate.

More options

Most ADC data sheets use range ÷ 2^N. Some texts divide by 2^N − 1. Choose the one your data sheet or course uses.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose the direction: code to voltage, voltage to code, or the reference voltage.
  2. Enter the number of bits and the input range. For 0 to 3.3 V, the top is 3.3 and the bottom 0. For −5 V to +5 V, the top is 5 and the bottom −5.
  3. Choose the code format: straight binary (0 at the bottom of the range) or two's complement (0 in the middle), and how the converter rounds.
  4. Type a code as a number (2048), a hexadecimal pattern (0x800) or a binary pattern (0b100000000000).
  5. Under More options, choose the step size: range ÷ 2^N (the usual definition) or range ÷ (2^N − 1).

The formulas

  • Step size: LSB = (top − bottom) ÷ 2^N, or (top − bottom) ÷ (2^N − 1) if your data sheet or course uses that convention.
  • Code to voltage: V = bottom + k × LSB, where k is the step number from the bottom of the range. For two's complement, k = code + 2^(N−1).
  • Voltage to code: k = (V − bottom) ÷ LSB, rounded to the nearest whole number (halves go up), or rounded down for a converter that truncates. Inputs beyond the range give the first or the last code.
  • Band of a code: with rounding, a code covers ½ LSB on each side of its voltage; with truncation, from its voltage up to one LSB above.
  • Reference from a known input: Vref = V × 2^N ÷ code (or × (2^N − 1) ÷ code), for a range that starts at 0 V.

Worked examples

12 bits, 0 to 3.3 V, code 2048: LSB = 3.3 ÷ 4096 = 0.8057 mV, so the code stands for 2048 × 0.8057 mV = 1.65 V. With rounding it covers 1.64960 V to 1.65040 V.

2.71828 V into the same converter: 2.71828 ÷ 0.8057 mV = 3373.96, which rounds to code 3374 (0xD2E). That code stands for 2.71831 V.

Reference: a known 1.1 V input that reads 1365 on a 12-bit converter gives Vref = 1.1 × 4096 ÷ 1365 = 3.3008 V.

Limits you should know

  • The converter is ideal: equal steps, no offset, gain or linearity error, and no noise. A real converter is off by a few LSB; its data sheet says by how much.
  • Converters differ in how they round and which step size they use. The data sheet of your converter decides.
  • For the step size, the dynamic range and the ideal SNR, use the Adc Resolution Calculator. To scale a sensor signal, see the 4 to 20 Ma Calculator.

Related tools