ESP32 ADC测量电压换算

  • 为解决使用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.

  • 1
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值