:link_to_translation:`zh_CN:[中文]`
The maximum effective range of the ESP32-S3 ADC is 0 ~ 3100 mV. Through the external voltage divider circuit, it can meet most of the functions such as the ADC button or battery voltage detection. However, for applications such as NTC (Negative Temperature Coefficient) based temperature measurement, it may need to support full-scale (0 ~ 3300 mV) measurement. ESP32-S3 can adjust the ADC offset through registers, and combined with the nonlinear compensation method of the high voltage area, the expansion of the ADC range can be implemented.
The process is as follows:
- Measure the first voltage value using the default offset
- If the measured voltage is less than 2900 mV, the first voltage is directly output as the measurement result
- Else if the measured voltage is greater than 2900 mV, increase the offset value to take the secondary measurement. Then carried out the nonlinear correction calculation on the secondary value, will be output as the final measurement result.
- Restore the offset value once measurement is completed
Overall, during each ADC measurement, there will be 1-2 times ADC reading. For most application scenarios, the measurement delay introduced by this scheme is negligible.
At present, the patch file is developed based on ESP-IDF release/v4.4
branch:
- Please make sure ESP-IDF has been
checked out
to therelease/v4.4
branch - Please download file :download:`esp32s3_adc_range_to_3100.patch <../../_static/esp32s3_adc_range_to_3100.patch>` to anywhere you want
- Using command
git am --signoff < esp32s3_adc_range_to_3100.patch
to apply the patch to ESP-IDF
- To get the range expansion result, users must directly use
esp_adc_cal_get_voltage
to get the voltage ofADC1
orADC2
. - Other APIs of ESP-IDF ADC are not affected, and the read results are consistent with the default results