Analog to Digital Converter
10 Bit
Input range 0.1V-3.2V
The ADC of the ESP32 is a bit disappointing, compared to the rest. The output is not only noisy, but also not very linear. You can't measure values down to zero Volts, the ADC shows zero with an input of ~0.1V. Same problem at upper end, but that is not so important.
https://randomnerdtutorials.com/esp32-adc-analog-read-arduino-ide/
Overview
The ESP32 integrates two 12-bit SAR (Successive Approximation Register) ADCs supporting a total of 18 measurement channels (analog enabled pins).
The ADC driver API supports ADC1 (8 channels, attached to GPIOs 32 - 39), and ADC2 (10 channels, attached to GPIOs 0, 2, 4, 12 - 15 and 25 - 27). However, the usage of ADC2 has some restrictions for the application:
ADC2 is used by the Wi-Fi driver. Therefore the application can only use ADC2 when the Wi-Fi driver has not started.
Some of the ADC2 pins are used as strapping pins (GPIO 0, 2, 15) thus cannot be used freely.
Example Code :
#include <driver/adc.h>
adc1_config_width(ADC_WIDTH_BIT_12);
adc1_config_channel_atten(ADC1_CHANNEL_0,ADC_ATTEN_DB_0);
int val = adc1_get_raw(ADC1_CHANNEL_0);