Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Adafruit ESP32 & TMP36
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit ESP32 & TMP36

by atabrizi on Sun Feb 23, 2020 1:55 pm

I have been trying to use ESP32 with TMP36 but unfortunately, things do not work out! Other users suggest using a 4.7K resistor or a capacitor in the circuit but none of these work. One user who posted a document in the Instructable uses a resistor but modified the temperature equation as (T= ((pin_reading/1023) - 0.5)*100. If the resistor is connected to the ground, this works but why? ESP32 is supposed to be a 12-bit system so instead of 1024 don't we need 4095? I am totally confused and I can't find any direct info on how TMP36 can be used to measure temperature using ESP32. Can anyone help out, please? Thanks. Abdie

atabrizi
 
Posts: 1
Joined: Sun Feb 23, 2020 1:40 pm

Re: Adafruit ESP32 & TMP36

by adafruit_support_carter on Mon Feb 24, 2020 12:28 pm

There's some basic usage info here:
https://learn.adafruit.com/tmp36-temperature-sensor

Also, keep in mind that the Arduino analogRead() defaults to 10bit regardless of actual ADC resolution:
https://www.arduino.cc/reference/en/lan ... nalogread/

adafruit_support_carter
 
Posts: 14974
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.