DS18B20 stops reporting after 5 hours

Hello there, I am having really strange issues with DS18B20 sensor connected to nodemcuv2 via ESPHome. Dallas sensor stops reporting after 5 hours?
I have it connected to 3.3V, GND and D2 (GPIO5) with 4.7K resistor board. cable is original 30cm extended additionally with 40 cm more. Sensor is placed in “sensor probe pocket” in water heater, together with another sensor from water heater, they are next to each other and touching. Temperature is about 50-55 °C.

My code: esphome: name: vanvex2 platform: ESP8266 board: nodemcuv2# Enable l - Pastebin.com
After 5 hours, it reports NaN state, and provide this error:

How do I solve this? It works during the first 5 hours, but then stops. There are no changes or actions hapenning when this happens.

What’s the power supply, could it be fading over time. You could also drop the resistor from 4.7k to 3k
to see if it just needs a little more juice.

Please try adding force_update to your sensor config like below.

sensor:
  - platform: dallas
    address: 0x1D00000003640728
    name: "Brugsvand, top"
    force_update: true

Power supply is original MeanWell HDR-15-5, 5V 2.4A Mean Well HDR-15-5

I will try to see if i can find 3k resistor.

Unfortunately that did not help (adding force_update). Actually now the sensor does not work at all despite restart. Wiring is correct. Maybe i should try another GPIO pin.

You can also use two 4.7k in parallel.

1 Like

Check if this is the circuit.
image

yes, this is the circuit. I tried another GPIO pin, and also insulating the probe metal part to stop any inteference from heaters ground (probe was touching heaters chassis). Still drops out after few hours.
Now I am just hacking my way out by automating ESP to restart whenever sensor becomes unavailable.

Unfortunately the resistor board is very unaccessible in my setup, so changing resistor value is my last resort. I still believe it might be software issue.

Has it ever worked correctly? It could be faulty. The other thing is check the input voltage, if you can power it with 5v rather than lower the resistor. 3.3v degrades quickly even @ just 70cm.

It has never worked correctly for more than several hours. Input voltage is 5.1V to ESP8266. and 3.31V on 3.3V pin to DS18B20.
Actually I had wired it with 5v to begin with, the behaviour was the same. So I think lowering resistor will not help.

So far i also tried:

  • adding 2.2uF electrolytic capacitor
  • Swapping GPIO pins
  • Insulating probe to avoid interference with heaters chassis ground

I might suspect faulty sensor now. It is just SO weird that after hardware reset it works for several hours, and then stops, like it is software issue.

Can it be interference from my sensor wire crossing other sensors in water heater that are NTC sensors?

I’d lean towards faulty. That it happens after x hours repeatably sounds like something is failing after being powered up for a while. I have close to a dozen dallas and, for me at least, they have just worked without any issue.

I have determined it not to being faulty by swapping two dallas sensors. Now I have tried to replace whole length of cable with shielded cat5e cable in desperate hope to reduce any possible interference from the water heater’s compressor, connected shield to GND in ESP end. Didn’t help.
Now I have tied ESP and water heaters secondary power supply DC negatives together, and now it’s running fine for 11 hours. let’s see.
It seems ridiculous to do all these things for a sensor, but I don’t give up apparently.

I am having a similar issue. I am using Tasmota and I was using a Sonoff S31 successfully for 2 months. Now with the cold weather I seem to be having issues. The Sonoff drops out, but works fine if the sensor is disconnected. I had a ESP-12S (ESP32 dev board) lying around and am using that for monitoring the same sensor and it is having the same behavior… Where you able to resolve your issue?

Hi
After 3 years I wouldn’t expect to get a response. Better to open up a new thread. This is also on the ESHome section and not the Tasmota. O.K. as a possible response I would suggest trying deep sleep or restarting the device say once an hour.