Chat freely about anything...

User avatar
By RMM1
#92176 256mv (from a LM35DZ) reports as 90 from analogRead(A0) on NodeMCU Amica.
656mv from a diode drop gives 222.

I created an ESP32 wireless remote for air conditioner control. That works with DS18B20. Now I want to create an 8266 version with LM35 which has much less MCU demand than the 1-wire devices.

These sensors worked as expected on Arduino UNO but ESP32 and 8266 have issues with analog. I could not find documentation that demonstrated correct usage.
User avatar
By schufti
#92197 stay with the ds18b20, the adc on the esp8266 has a useable resolution of 7bit at most. noise from wifi is horrible, linearity is ridiculous and repeatability is not given.
User avatar
By btidey
#92237 I agree one should use a digital temp sensor to avoid the ADC.

The ADC noise issue isn't necessarily as bad as normally painted. See viewtopic.php?f=13&t=21466

Boards with inbuilt high impedance dividers on the ADC like NodeMCU exacerbate the problem.

The more fundamental problems with the ADC of overall accuracy and linearity, particularly at low input remain.
User avatar
By eriksl
#92242 As various people already stated in various topics, simply do not use the built-in ADC, it is very hard to get it working on an acceptable level.

Just attach an external ADC using I2C, SPI or I2S. For the last two, ESP has even hardware support.

Note: this is not quite an "advanced user" question, I am moving it.