So I have a 10KOhm thermistor, that I have in series with a 10KOhm 1% resistor. I have the datasheet which effectively states the the B_Constant is 3997 @ 1%. I have verified that the resistance on the thermistor is 10Kohm with my multimeter and also double checked the resistor I’m using to verify that its 10K Ohms.
I should be getting 25C at 10K ohms with this setup is my understanding but I am nowhere near that, at 22.7C I’m basically at 1965Ohms. (not to be confused with KOhms) So I’m very far off. This is how my YAML is configured currently:
Okay so I seem to have this working now, what I did was I hooked it up to an ESP32, and I set the ‘attenuation’ on the ESP2 to 11db which gives a voltage max of 3.6V, then I manually set the resistance sensor voltage reference to 3.6V also and that appears to be working now. I dont quite understand why… if I try any other values like 6db (2.2 max V) and then set the resistance voltage reference to 2.2V that produces the wrong resistance values…
Maybe someone has an idea? I suspect I have a fundamental misunderstanding here.
Updated yaml that seems to be working an ESP32 on the “VP” pin which is GPI36 (input only)
Yeah thats what I thought originally but I ran across another website that said it was 3.6V so i tried that and I’m getting very accurate readings now, its really weird. With 3.9V as the reference voltage I was getting really off readings again.
That’s for a direct input to the ADC. i.e. 0-1V with an 11dB attenuation network = 3.548V.
But if you also have an external voltage divider that takes 3.3V in and presents it to the ADC as 1V (as a lot of development boards do) then your max input is at 11dB attenuation is 11.7V.
Put 1V on the ADC input. What does the ESP home debug log say the measurement is?
If it’s only 0.303V you have an extra voltage divider external to the chip.
I think i’m at a loss trying to understand what the resistance reference voltage is doing here, i understand the concept, convert the resistance to voltage, convert voltage to ohms, then ohms to temp, but I’m a little lost about the reference voltage on the resister platform and why altering that seems to be making such a drastic and working change.
Ok I know this is a stale thread but I’ve spent all night myself trying to learn how to setup a ntc thermistor with espHome. This thread led me to a few other sites like espHome and random nerd that got me there. Sharing my solution in case it helps someone else.
The problem with the code above is the “reference voltage” is the voltage across the voltage divider. It is NOT the max voltage of the ADC reading. By default this is 3.3 that would be powered by the esp32 board. So 3.6 got you closer to 3.3 than 3.9 but was still wrong. You can just remove that parameter all together and let it default to 3.3.
Did you ever get this working? I’ve got the exact same issue, and the comment after your last did not help.
Edit: The 11db attenuation does seem to give accurate readings. I just can’t figure it out why. The documentation is a bit omissive in this topic.