ADC
How many ADC channels does ESP32 have? What are the sampling rate and effective resolution?
- ESP32 has 18 ADC channels.
- When Wi-Fi is disabled and ADC DMA is used, the theoretical sampling rate does not exceed
2 MHz. In practice, a lower rate is recommended. - With Wi-Fi running normally, the rate can reach about
1000 samples per second. - The internal effective ADC resolution is
12 bits.
If an ADC pin is left floating and the printed VDD3P3 value is 65535, does that mean the voltage is 65535 / 1024 ≈ 63 V? Why is the result incorrect?
The ADC input voltage must be greater than 0 V and lower than the upper limit supported by the chip, often up to about 3.3 V depending on the device. A floating input is undefined, so the measurement result is not meaningful.
What is the input resistance of the ESP32 ADC?
The ADC input is capacitive, so its effective resistance can be considered very high.
When using the ESP32 ADC to measure supply voltage, is a resistor divider required?
The ESP32 ADC reference voltage is 1100 mV. The ADC range can be extended by configuring internal attenuation. Refer to the ADC chapter of the ESP32 Datasheet. If the required voltage still exceeds the supported range, an external divider should be used.
What is the maximum ADC sampling frequency supported by ESP32 in ADC DMA mode?
The theoretical maximum sampling frequency is 2 MHz.
Can ESP32 use ADC2 and Bluetooth at the same time?
Yes.
What ADC DMA sampling rate range is supported on ESP32-S2?
The supported frequency range is 611 Hz to 83333 Hz.
Does the ESP32 ADC support simultaneous multi-channel sampling?
No. ESP32 ADC does not support simultaneous sampling of multiple channels. If multiple channels are needed, they must be read in a polling sequence.
What is the measurement deviation between ADCs on ESP32 chips?
By default, the difference between ADC measurements on ESP32 chips is about ±6%. See the ESP32 Datasheet.
Can ESP32 use two ADC channels at the same time to measure different signals, such as current and voltage?
A single ADC cannot read multiple ADC channels at exactly the same instant. You can poll the two ADC channels sequentially.
Why can't an ESP32-S3 ADC configured with ADC_ATTEN_DB_12 reach the nominal 3100 mV measurement range?
When
ADC1orADC2on ESP32-S3 is configured withADC_ATTEN_DB_12, the measurement range is nominally0 ~ 3100 mV. However, some chips may measure a maximum voltage lower than3100 mV. The issue can be addressed in either of the following ways:
- Option 1: avoid operating near the upper boundary. Use an external divider to keep the input voltage closer to the middle of the range for better accuracy and consistency.
- Option 2: use the software ADC range extension solution to extend the maximum measurable voltage to
3300 mV. This solution is already supported for ESP32-S2 and ESP32-S3 inESP-IDF v4.4.8andv5.3.1, and can be ported to other ESP-IDF versions if needed.
When testing ADC2 on ESP32-S3-WROOM-1 with ESP-IDF v5.1, why does an input of 3.3 V on GPIO12 read as 5 V?
I (455346) EXAMPLE: ADC2 Channel[1] Raw Data: 4095
I (455346) EXAMPLE: ADC2 Channel[1] Cali Voltage: 4985 mV
I (456346) EXAMPLE: ADC2 Channel[1] Raw Data: 4095
I (456346) EXAMPLE: ADC2 Channel[1] Cali Voltage: 4985 mV
- The raw ADC reading is normal. The converted voltage becomes
5 Vbecause the valid measurable range of ESP32-S3 ADC is2900 mV. See the effective measurement range corresponding to ESP32-S3 ADC attenuation levels. - An input voltage above
2900 mVis outside the defined valid range, so this kind of result can occur. If you need to measure voltages above2900 mV, use a voltage divider or adopt the ESP32-S3 ADC range extension solution.
Why can adc2_get_raw() fail between esp_wifi_start() and esp_wifi_stop() on ESP32?
Wi-Fi also uses ADC2 and has higher access priority. Therefore, while Wi-Fi is active, application calls to adc2_get_raw() may fail. It is recommended to check the return value and retry the measurement if necessary.
How can the ESP32 ADC two-point calibration scheme be used?
ESP32 chips use reference-voltage-based ADC calibration by default at the factory. If better ADC consistency is required, the calibration scheme in eFuse can be changed to the two-point calibration scheme. However, eFuse changes are irreversible and should be made with caution. A software-based two-point calibration solution is also recommended: adc_tp_calibration.
How should ADC sampling error be calculated for an ESP32 module?
The following example uses battery voltage measurement.
- First calculate the actual voltage seen at the module ADC pin:
Use the calculated $V_{\text{adc}}$ to look up the ADC error table in the datasheet and obtain the ADC measurement error at that input voltage, denoted as $\mathrm{Atten}(V_{\text{adc}})$.
- The application usually needs to convert the measured ADC pin voltage back to the battery voltage:
If $V_{\text{bat}} / V_{\text{adc}} = 4$, the divider ratio is $1/4$, so the ADC error needs to be multiplied by $4$:
$$ \mathrm{Atten} = \mathrm{Atten}(V_{\text{adc}}) \cdot 4 $$If $V_{\text{bat}} / V_{\text{adc}} = 2$, the divider ratio is $1/2$, so the ADC error needs to be multiplied by $2$:
$$ \mathrm{Atten} = \mathrm{Atten}(V_{\text{adc}}) \cdot 2 $$When using ADC1 on ESP32-C3 with attenuation set to ADC_ATTEN_DB_12, is it normal for different chips to show different upper measurement limits?
Yes, this is normal. The 0 ~ 2500 mV value mentioned in the documentation is the recommended valid measurement range, not a hard upper limit.
In other words, 0 ~ 2500 mV is the range in which Espressif guarantees measurement accuracy after hardware and software calibration. It does not mean the ADC will definitely stop working or immediately saturate above 2500 mV. Beyond that range, the input enters an undefined or accuracy-not-guaranteed region, so variation between chips is expected. For example, some chips may reach nearly 2.9 V, while others may only reach a little over 2.7 V.
If you need to measure 3.3 V, it is recommended to scale the input down to 0 ~ 2.5 V with an external divider, then read it with attenuation and the calibration driver.