-
为解决使用MicroPython ESP32 ADC采集10K B3950 NTC电阻值获取对应温度
-
查看ESP32 ADC API官方文档:Analog to Digital Converter
-
我所关心的ADC值如何换算成电压:
上图是我关心的,但是我并不知道我的芯片是否有校准功能,其实根据上图所给的公式y = coeff_a * x + coeff_b我们可以利用万用表大致推算出coeff_a、coeff_b。简单选取两点GND(0mV)、VCC(3290mV)实测ADC值分别为142、3145。带入公式可求得coeff_a=0.913、coeff_b=142。最后由y = 0.913 * x + 142得电压(mV) x = (y-142)/0.913。选用更高精度的万用表多点测量更准确。
补充注意:
11 dB attenuation (ADC_ATTEN_DB_11) gives full-scale voltage 3.9 V (see note below)
Note
The full-scale voltage is the voltage corresponding to a maximum reading (depending on ADC1 configured bit width,
this value in ESP32 is: 4095 for 12-bits, 2047 for 11-bits, 1023 for 10-bits, 511 for 9 bits.
this value in ESP32S2 is: 8191 for 13-bits.)
Note
At 11 dB attenuation the maximum voltage is limited by VDD_A, not the full scale voltage.