A load cell supporting a cylindrical reference mass beside an ADC board and a second calibration mass.

What you need

Use saved ADC readings, the actual reference voltage and two or more known physical reference conditions.

Endpoint-normalized 12-bit voltage examples. Code 0: 0 V; Code 2048: 1.6504 V; Code 4095: 3.3 V.
Endpoint-normalized 12-bit voltage examples. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentV
Code 00
Code 20481.6504
Code 40953.3

The calculation

V_est ≈ code × V_ref / (2^N − 1)
x = (V_est − b) / a

N is ADC bit depth; the first formula is endpoint-normalized. The sensor model is V=a×x+b with sensitivity a and offset b.

Worked example

Illustrative numbers. Replace them with your measured inputs.

For a 12-bit ADC and 3.3 V reference, code 2048 gives about 1.6504 V using this convention. A hypothetical sensor with V=0.5+0.1x yields x≈11.504 units. A 1% reference error propagates into the voltage estimate.

Try it step by step

  1. Confirm whether the ADC output is unsigned, signed or offset binary and record its actual reference and gain settings.
  2. Convert code to voltage with the datasheet convention, then apply the sensor’s transfer function with units.
  3. Measure known reference conditions to estimate offset and sensitivity rather than assuming nominal values are exact.
  4. Check saturation, invalid codes and out-of-range values before using the result in control.

How to check the result

Compare converted values with independent references across the intended range and report residual error, not just bit depth.

Common mistake to avoid

Resolution is not accuracy. Reference drift, sensor tolerance, noise and loading can dominate the nominal code increment.

Reference reading

Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.

Read our methods, limitations and safety notes.