ADC Range Extension Solution
ESP32-S3 ADC Range Extension
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.
Patch Use Guide
At present, the patch file is developed based on ESP-IDF v4.4.8
:
Please make sure ESP-IDF has been
checked out
to thev4.4.8
Please download file
esp32s3_adc_range_to_3100.patch
to anywhere you wantUsing command
git am --signoff < esp32s3_adc_range_to_3100.patch
to apply the patch to ESP-IDF
API Guide
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