I have KTY81-110 sensors. I would like to measure temperatures (between 20 and 130 Celsius) using KTY81 + Raspberry PI Pico W. I assembled a simple, classic voltage divider:
3V3 (from the PI board)
|
3k3 resistor
|
Analog IN (of the Pi board)
|
KTY81 (PTC!!!)
|
GND
I’m absolutely new with Home Assistant, I have some experience and project using Arduino and ESP8266.
I’m looking for a ESPHome yaml code to reading an analog GPIO and convert the value to Celsius.
I usually found solutions only for a NTC resistor.
Or is there an example to use Ardino code within ESPHome yaml?
I saw pages and examples where they used max31865. Currently I don’t have any, and I would like to solve this measuring without using any of this IC.
In the yaml there are 6 reference values, but only EXACTLY 3 allowed to use.
So, I commented out the 3 other reference values for future use.
Now I use three KTY81.
As external reference temperature sensors, I can only use three DS18B20.
Currently seems to correct that I measured with these KTY81 sensors.
I tried doing exactly what you are doing, just a few days ago… multiple problems cropped up. First, these sensors are extremely non linear. Second, the ADC on the esp chips is VERY noisy. So the values jump all over the place especially in the non-linear sections making the values basically unusable. EVEN WITH the max31865 chip the sensors jump all over the place. This is a known limitation of adc processing using esp chips.
I even hooked up a highly regulated variable DC power supply to test the ADC function and it was still extremely noisy.
The alternative might be a dedicated adc chip. However, I went a different direction with my temp probe as I wasted waaay too much time trying to get this working,
A DS18b20 works great if you need a probe. Ive had some under my house for 2 years taped to various places on my water lines. If it gets to cold, strings of heat tape turn on to keep the water lines from freezing.
Your timing on this is good. There is new code for Dallas sensors that you need to use to get rid of the scratchpad errors that have plagued all of us using ESPHome. I also use those exact same Dallas sensors. I’ll find my link and post it here.
There’s a raging debate about what value of resistor to use on Dallas sensors, despite what the docs say. I did a huge amt of testing when I worked with the ESPHome devs to fix the scratchpad problem and actually ended up using 1k resistors. They work well. Of course, YMMV…
I havn’t personally tested multiple resistor values but, I do know that I tried using some DHT-11’s back in the day with no resistor and I was having issues and if I recall right, they were always 2-3 degrees off. Adding a 4.7k made them work much better and more accurate. Using 4.7k is just a habit now but, dont doubt 1k works just as well.
DHT11’s are notoriously inaccurate! In fact, so are these Dallas sensors, but thankfully you can calibrate them using a known value or reading from an accurate source.
I always hear that but, ive had a few that i installed way back when and they’ve been pretty good for me, atleast the temperature has always been within 1deg typically. I dont really use the the humidity for anything except its there as a data point. Ive never checked to see how accurate that is.