DS18B20 freaking out / continuously reporting 85°C

Hi!

So I installed a DS18B20 temperature sensor in my heatpump.

Code is:

esphome:
  name: heatpump-gateway
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "XXXXXXX"

ota:
  password: "XXXXXXX"

wifi:
  ssid: "XXXX"
  password: "XXXXXXX"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "XXXXXXX"
    password: "XXXXXXXXX"

captive_portal:

dallas:
  - pin: 26

sensor:
  - platform: dallas
    address: 0x0B01205F7A417828
    name: "Heatpump Lower Temperature"
  - platform: dallas
    address: 0x5101205F66BBD928
    name: "Heatpump Upper Temperature"

As you can see in the following screen, it continuously repots back 85°C, whilst it also reports the correct values (like switching from correct to wrong all the time):

Any idea why this happens?

Thx

No logs, no issue.

How long are the cables to the sensors?

What value pull-up resistor did you use?

85°C on DS18B20 almost always means powering issues.

1 Like

reported temp 85 degrees in case of DS1820 means that you don’t have a connection with sensor, not that it’s “freaking out”. No sensor connected will return 85. Check length of your cables → power supply to the sensor - do you have parasitic power? It can cause problems. Like tom said: power supply issues or communication issues.

1 Like

Might be a “new” fake ds18b20 with a special feature set?

:100:

I guess if you have posted logs we would have seen that the one wire bus resets after each reading and therefor starts again with the power-up temperature of 85°C

Sry for my late reply to you all.

I wasn’t at home and will check everything in the evening but I don’t think it’s about the length of the cable as I use the same temerature probe on the same ESP32 for the lower temperature of the heatpump.

Maybe it is about some hardware-connection / soldering problem then.

Ok, so it was just a loose cable / a bad contact.
Everything is working now.

Thanks for your support!

For future readers, you can simply filter out the value “85” from the “faulty” sensor. Use ESPHome’s filter_out.

sensor:
  - platform: dallas
    address: 0x1c0000031edd2a28
    name: "Livingroom Temperature"
    filters:
      - filter_out: 85.0

This obviously means that you’ll loose specifically 85C. If you’re actively using this range, it’ll jump from 84.9C straight to 85.1C. Shouldn’t pose a real problem imo.

Not a solution, but a workaround.

1 Like

It goes back to old AVR’s, but i always wondered why manufacturers chose this stupid number for showing (not available) sensor. Way more logical would be one or other limit end, or even “out of the range” number, say, 200 degrees…
I use this sensor for central heating system with pellets, sp 85 degrees is a number which can happen…

You could pick a better sensor for that instead. e.g. a thermocouple.

You’re absolutely right. I might do that at a later stage… luckily temp almost never gets up to 85.

Still, why the heck did the sensor engineers choose a value in the measurement range to initialise to?

Looking at the DS18B20 datasheet it actually describes the 85°C as “power-up” reading :bulb:

:point_down:

Solution to the 85 °C-Problem

There is a simple, undocumented, way to discriminate between the power-up 85 °C-reading and a genuine temperature reading of 85 °C in DS18B20 of Family A [5]: <byte 6> of the scratchpad register. If it is 0x0c, then the 85 °C-reading is a power-up reading, otherwise it is a true temperature measurement.

Might be challenging for users to integrate this into esphome but if a feature request is raised maybe it can end up in the official component which would then could automatically discard this “power-up” readings :rocket: