Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Turn an ADC reading into a real-world value

Use when: firmware has a raw ADC code and needs a voltage, or the temperature, light level or battery voltage behind it

Goal: the quantity the sensor measures, with the arithmetic in the right order

Taught in How an ADC works

  1. 1

    Note n and V_{ref} as the firmware sets them, and which step convention you are using.

    Example

    Uno R4 Minima at its default 10 bits; suppose a 5 V reference: step = 5/1024 \approx 4.88 mV.

    Why: the same code means different voltages at different settings.

  2. 2

    Multiply the code by one step.

    Example

    Code 614: 614 \times 5/1024 \approx 3.00 V.

    Why: the code counts whole steps up from 0 V.

  3. 3

    If a divider scaled the signal down, divide by its ratio k = R_2/(R_1 + R_2).

    Example

    A 1/3 divider: 3.00 / (1/3) = 9.0 V at the battery.

    Why: the ADC measured the divider's output, not the original voltage.

  4. 4

    Use the datasheet's relation between volts and the quantity.

    Example

    A sensor at 10 mV per °C reading 0.90 V, with 0.75 V meaning 25 °C: 25 + (0.90 - 0.75)/0.010 = 40 °C.

    Why: the sensor's datasheet, not the ADC, defines what a voltage means.

Common mistakes

  • Using 3.3 V or 5 V as the reference without checking what the firmware set.
  • Forgetting the divider, and reporting the pin voltage as the battery voltage.
  • Mixing the 2^n and 2^n − 1 conventions inside one calculation.