I’ve been looking for a temperature sensor for my PI3 home thermostat. I’m to the point where my app is stable and running for over 20 days with the only issues relating to the temperature sensors. I have dual DHT22 sensors and those will freeze up occasionally, for which the power needs to be reset. I will try to handle this reset in code, but because this controls my home HVAC system, I would like to get sensors that will not freeze up and have greater reliability. Recommendations from someone with a current PI3 thermostat being used to control their HVAC would be appreciated. I would like to be able to rely on the sensors.

  • $\begingroup$ Pick one I think. $\endgroup$
    – Bence Kaulics
    Commented Aug 11, 2018 at 20:44
  • $\begingroup$ I’ve been through the DHT11’s, DHT22’s, I have a MCP9808 that I will soon program and test. It’s just been a do loop trying to get one that will keep working so far. Which one of those do you recommend? $\endgroup$
    – Jesse
    Commented Aug 11, 2018 at 21:06
  • $\begingroup$ I think any of them will be OK as most of them designed by well-known manufacturers unlike DHT. I think that MCP will be good enough. $\endgroup$
    – Bence Kaulics
    Commented Aug 11, 2018 at 21:18
  • $\begingroup$ Not sure this is on-topic here, I thought I was still on IoT! $\endgroup$ Commented Sep 13, 2018 at 9:27

2 Answers 2


Try a DS18B20. They are readily and cheaply available packaged in water proof, stainless steel enclosures.

I use lots of them and they operate very reliably in field conditions that are often extreme. Some have been operating continuously for 18 months.

Be aware though that they are a 5v unit (I use them on arduinos that then connect through to a RPI).

I get best results with the 3x wire config (+5v, GND, signal) with different pull up resistors on the signal depending on cable length and how many are on a single signal bus (you can have many on a single signal).

Libraries are readily available for arduinos and I recall also finding libraries for RPI a while back.

This looks sensible: https://www.modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi

Example of the stainless steel enclosed component: https://www.altronics.com.au/p/z6386-stainless-steel-housing-waterproof-ds18b20-temperature-probe/

Extended discussion on solutions for an anomonly using these sensors in industrial conditions FYI (problem not with the sensor): https://iot.stackexchange.com/questions/2859/ds18b20-oscillating-rapidly/2929#2929

  • $\begingroup$ agreed. I used about 6 of these in my house in parallel in 3 wire mode for about 5 years, and never noticed any lockups (interfaced from an mbed device connected to USB on a Pi). Make sure you get the high resolution version if you want sensible hysterysis. $\endgroup$ Commented Sep 13, 2018 at 9:05

You've fallen into the trap of using a low cost first generation device because it got picked up by the hobbyist community. Whilst this is a great source of early-adopter information, it can be quite sticky, and not too concerned about reliability.

Finding the genuine 'safe' operating conditions for this sort of device can be hard since reliability was probably never a high priority for the original design, so you can expect to see dramatically better performance from a different part.

If you need remote sensors, the digital wiring will be your greatest concern - you need something which is resilient to EMI and potentially has a built-in watchdog at the sensor end.

If your sensors are local, analogue inputs might be more reliable than digital, but you can also think about building in some 'fault recovery' logic for the cases where your sensors fail and cease to return plausible data.


Your Answer

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