⚡
usefultools.dev
ADC

Arduino Analog Voltage Calculator (analogRead)

NOUVEAU

Arduino analog voltage calculator: convert analogRead() values to volts and back for 10/12-bit boards, any AREF, with voltage-divider input and code.

Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.

Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.

DEFAULT: AVCC (≈ the 5 V supply — USB power is often 4.6–5.1 V).

analogRead()
512
Pin voltage
2.5 V
1 LSB
4.883 mV
Full scale (input)
5 V
Vpin = raw × Vref / 1024 = 512 × 5 / 1024 = 2.5 V

Arduino code

const float VREF = 5.0;        // volts — measure it for best accuracy

void setup() {
  Serial.begin(9600);
}

void loop() {
  int raw = analogRead(A0);
  float vPin = raw * VREF / 1024.0;
  Serial.print(raw);
  Serial.print('\t');
  Serial.println(vPin, 3);
  delay(500);
}

Board data: ATmega328P, 10-bit ADC, 5 V logic. Real readings also include reference tolerance, offset and noise of a few LSB — verify against the datasheet for your exact board.

⚡

Exemples rapides

Des entrées typiques et les résultats produits par cet outil.

10-bit
Uno, raw 512, 5 V ref
2.5 V (LSB 4.883 mV)
Volts → raw
Uno, 3.3 V on pin
analogRead() = 675
Divider
raw 800, 10k / 4k7 divider
Vin = 12.22 V
ESP32 / Pico
12-bit, 3.3 V, raw 2048
1.65 V (LSB 805.7 µV)
Internal ref
INTERNAL 1.1 V, raw 200
214.8 mV
📖

Présentation

analogRead() returns a number, not a voltage. To turn it into volts you need the ADC resolution of your board (10-bit on the Uno, Nano and Mega, 12-bit on ESP32, Due and Pico) and the reference voltage the ADC compares against — the 5 V supply, an internal 1.1 V or 2.56 V reference, or whatever you feed into AREF.

This Arduino analog voltage calculator converts a raw reading to the pin voltage and back, shows the size of one LSB and the full-scale range, and supports both the datasheet formula (divide by 1024) and the common sketch formula (divide by 1023). Add a resistor divider to measure batteries or 12 V rails: the tool computes the real input voltage, the divider current and warns when the pin would exceed the reference or the logic supply. Board data comes from the MCU datasheets and runs entirely in your browser.

Pourquoi utiliser cet outil ?

  • Board presets for Uno, Mega, Leonardo, ESP32, Pico and more
  • Raw → volts and volts → raw in one place
  • Voltage divider math with over-voltage warnings
  • Ready-to-paste analogRead() sketch
  • Free and private, runs in your browser
⭐

Fonctionnalités

🎛️

Board & reference presets

Pick the board and analogReference() option; custom or EXTERNAL AREF voltages are supported.

🔁

Two directions

Convert a raw reading to volts, or find the reading you should expect for a voltage.

📏

Resolution per LSB

Shows one LSB and full scale for 8- to 14-bit resolution where analogReadResolution() exists.

🔌

Voltage divider input

Enter R1 and R2 with values like 10k or 4k7 to compute Vin, current and resistor power.

⚠️

Safety warnings

Warns when the pin voltage saturates the ADC or exceeds the board’s logic supply.

🧩

Code snippet

Copy a sketch with analogReference(), analogReadResolution() and the conversion formula.

🛠️

Mode d'emploi

1

Choose board and reference

Select your board, the AREF option and the resolution.

2

Pick a direction

Use Raw → voltage or Voltage → raw and type the value.

3

Add a divider if needed

Tick the divider option and enter R1 (top) and R2 (bottom).

4

Copy the code

Check the formula and warnings, then copy the generated sketch.

🤔

Questions fréquentes