Thermistor connecting to esp32 and coding through Arduino IDE

avalox7
Posts: 1
Joined: Tue Dec 01, 2020 11:10 am

Thermistor connecting to esp32 and coding through Arduino IDE

Postby avalox7 » Tue Dec 01, 2020 11:23 am

I am connecting thermistor as the following picture is showing, except that wire which is connected to 5V,I connect on esp32 to 3.3V.
Image.When I write a simple code to get values from thermistor, all the time I receive 0,I am changing the temperature, because I want to measure the temperature of the water, I put the thermistor in hot water, and still got a result 0. Where is the problem and what should I fix to get correct values. My wish is to improve the program with the Stein-Hart equation, but first I want to be sure the thermistor is properly working. Below is the code. The thermistor pin is going to 36 on esp32. What I need to change in the wiring or in the code to receive correct results?Thank you all in advance.

Code: Select all

#define thermistorpin 36
void setup(){
  Serial.begin(9600);
}
void loop(){
  double thermVal;
  thermVal=analogRead(thermistorpin);
  Serial.println("Thermistor reading: ");
  Serial.println(thermVal);
  delay(2000);
}

CheckBackfocus
Posts: 1
Joined: Mon Dec 14, 2020 12:58 pm

Re: Thermistor connecting to esp32 and coding through Arduino IDE

Postby CheckBackfocus » Mon Dec 14, 2020 1:09 pm

Did you get this working? Which thermistor are you using? It seems odd that you seem to be performing analogRead on your power to the thermistor...

pipi61
Posts: 60
Joined: Fri Dec 23, 2016 10:58 pm

Re: Thermistor connecting to esp32 and coding through Arduino IDE

Postby pipi61 » Mon Dec 21, 2020 11:37 pm

Hi!
First check analog input with potentiometer.
sample https://randomnerdtutorials.com/esp32-a ... duino-ide/

DeivisSajermann
Posts: 4
Joined: Fri Dec 18, 2020 8:52 am

Re: Thermistor connecting to esp32 and coding through Arduino IDE

Postby DeivisSajermann » Tue Dec 22, 2020 9:04 am

Hi, which termistor are you trying to use (NTC, PTC, etc).
Deppending on the type, is necessary to change the value of the Resistor in your voltage divider, or even change the resistor position.
Ex: VCC - Termistor - Resistor - GND... (And you take analog samples on the resistor instead the Termistor).
Regards.
DeivisSajermann

Who is online

Users browsing this forum: No registered users and 43 guests