ESP32 ADC Resolution Too Low
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 ADC Resolution Too Low. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 analogRead() returns only 0-1023 (10-bit) instead of 0-4095 (12-bit).
Quick Fix
Wrong
int val = analogRead(34);
// Returns 0-1023 (default 10-bit on some cores)
ADC max value is 1023 (10-bit). Voltage resolution is 3.2mV per step.
Right
analogReadResolution(12);
int val = analogRead(34);
// Returns 0-4095 (12-bit)
float voltage = val * 3.3 / 4095.0;
Serial.printf("12-bit: %d, Voltage: %.3fV\n", val, voltage);
12-bit: 2710, Voltage: 2.180V
(12-bit = 0.8mV per step resolution)
Prevention
Call analogReadResolution(12) in setup for 12-bit mode. Lower resolution (10-bit) is faster but less precise. Use 12-bit for sensors, 10-bit for high-speed sampling. Check your framework default resolution.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro