Simple NTC Thermistor readings not working

Hi All, I am trying to read temperature from a NTC thermistor very simple configuration and I don’t need any precision temperature readings.
This is my first time on this (so I newbie). After fight with the IO pin naming convention I think i have it figured out, but the readings are always a fix number that it does not change with temp at all.
I am using a 10k resistor connected to 3,3v and the thermistor connected to ground. I set b constant and temp reference based on datasheet.
No matter what I set the values are always fixed no changes. When I disconnect the input pin the values oscillate but I think that is normal with the input is not connected to anything.
Could some tell me what I am doing wrong?
here is my code.
Thank you


No idea about A4, IMHO simplier to use GPIOxx - see them in blue boxes next to pin an attached picture. Config looks Ok, first idea is configuration not match actual pin used.
Try to connect 10k (or any other) potentiometer first and check You see voltage and resistance changes.

Thank you , I did change to GPIOxx , it seems to give the same results. I think ESP32 accept GPIO as well as Ax pin names i can also just say pin35. I installed a 10k potentiometer, I noticed it worked on the low resistance values … anything over 5kohms just clamp the value. only works with low values 5k to 0ohms …

Is there any filters to add in the code? it seems that everybody is using thermistors with 10kohms but this input doesn’t read more that 5kohms total. Could be for this model of ESP32 i am using? here is a pic of the esp

Right pin, good. Now need to configure attenuation and ensure voltage still in range for specified attenuation.

On the ESP32 the voltage measured with the ADC caps out at ~1.1V by default as the sensing range (attenuation of the ADC) is set to 0db by default.

OK It is working now !!!
I did try to use the attenuation and filters as per the instructions and it also worked, but calculating right the values to me was a bit confused and complicated to understand. The input has to measure 1.1v or less to show values, the original resistors that i used of 10kohm and the thermistor also10kohm were not sufficient to lower the voltage from 3.3 to 1.1v or less. so the reading clamped and it did not change at all.
I increased the resistor to a value until it reads less than 1.1v at the input and it started working.
For the correct readings I just set the resistor value that I am using (38kohm) into the code ! and it gave me a temp very close.I think I can add a filter to smooth the temp readings even more (I have to investigate that) but for now it is fine. It might not be the best solution but I just want to share this, so people can use it if they struggling like me for days


.Thank you Masterzz for pointing me in the right direction and for your quick response. !

1 Like