I installed two DS18B20s on a pi almost a year ago. They have worked great until the last couple months. I am doing a bit of a stress test on them and have been polling them every second for almost a year. One day I checked them and both of their temperatures were way over what they should be. I thought it was strange so I rebooted the pi and they still read very high. I didn't look into it at the time but about the next day I checked and they were reading normally. They read normally for over a month. Now they are doing it again so I looked at the data coming in and indeed they are about double the actual temperature. I'm just wondering if this is a failure mode or if something else could be going on. I'm going to replace them as soon as new ones come in. Has anyone else experienced this? Any ideas on fixing them?

  • Experienced what? You haven't told us the temperatures being returned or the ambient temperature.
    – joan
    Commented Apr 16, 2019 at 17:17
  • The temperatures are double the actual temperature. So if the ambient is 21c then the return is 42c Commented Apr 16, 2019 at 17:46
  • It sounds like the design is on the edge. How long are the leads. Check the clock timing.
    – Gil
    Commented Feb 1, 2023 at 1:55

1 Answer 1


DS18B20s are cheap sensors that are useful for setting up and testing. They are prone to failure after extended use. If you are fine with simply replacing them with new ones then do this - they are cheap and a few bucks worth will keep you going for years.

Otherwise, if you want longer-term reliability (and more accuracy) then invest in a higher quality sensor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.