Hot water tank sensors! DS18B20 Waterproof Temperature Sensor setup Raspberry Pi

Hello.
I bought a few DS18B20 Waterproof Temperature Sensors, thinking they would pop onto the arduino inputs (I currently successfully read battery levels from two different battery banks, via analog).
After reading the One Wire (https://www.home-assistant.io/components/sensor.onewire/) instructions my head went a bit dizzy and I bottled it. So I bought a bunch of ANALOG “TMP36GT9Z Analog Low Voltage Precision Temperature Sensor IC”.

Installed on an analog pin of Arduino and the readings were all over the shop. Even when removing the battery sensor inputs…
After a google, this happens a lot apparently with the TMP36. So back to square one.

Any ideas of a simple accurate sensor to read temp of hot water tank?

Or can anyone simplify how I would install the DS18B20 Waterproof Temperature Sensor?
I think that would have to bypass the Arduino and go straight into PI?

Noob here. So still learning!

I use them on a Wemos D1 mini to measure my water tank temp and boiler temps. As they are 1 wire you can connect them in parallel on a single wire if you needed - I do for my boiler feed and return pipes.

They each have their own address that the Wemos will pick up. I use ESPEasy - look Here for a guide to using them with ESPEasy.

As the Wemos has Wifi onboard i use MQTT to pass the readings back to HA.

If you need further help I will be happy to assist :wink:

boiler water

1 Like

Looks exactly what I’m wanting to achieve.
Will take a look at ESPEasy.
Thank you Bert!

1 Like

Managed to get the DS18B20 by booting Noobs version of Raspbian https://www.raspberrypi.org/downloads/. Onto my SD.

Loaded hassio onto it via instructions:
https://nealde.github.io/blog/2017/10/26/how-to-install-hassio-and-pihole/

Loading this way still gives you PI desktop and SSH, VNC, One wire setup, etc via the configuration desktop in PI. Hassio boots and still runs via the designated port…

Then I connected one wire sensor, directly to the PI board and followed the setup instructions here: Sensors - Temperature with the 1-Wire interface and the DS18B20 | The Pi Hut

Didnt bother making the python script at the end. Having the sensor ID was enough for HA:

pi@raspberrypi:/sys/bus/w1/devices $ ls
28-0417c158baff w1_bus_master1

Add it to configuration.yaml and away you go!

```
sensor:
  - platform: onewire
    names:
      GENERATED_ID: FRIENDLY_NAME
```

My config:

```
sensor:
  - platform: onewire
    names:
      28-0417c158baff: Water Temp
```

Was much simpler than I thought!
Happy to help anyone looking to do the same.

2 Likes

Hi there, do you have a guide someone can follow to get this set up? Thanks!

Hello, Sure, do you have any sensors and a wemos / nodemcu yet that you can use to do this ?

@Rural_assist, I appreciate the dedication it takes to learn about running hassio on raspbian just to be able to plug the dallas sensors to your pi gpio. Most folks would probably just add an esp module of some sort with mqtt, or an arduino with ha serial sensor (if the pi was near the water heater). Dealing with raspbian shows a true dedication to minimize hardware. :wink:

1 Like

Hi Neil

Having just moved home, I’m keen to add some sensors to monitor boiler feed and return temperatures. Would you be able to share the setup you’ve adopted?

I run HA in Virtual Machine so any solution will need to be standalone in the physical world and communicate with HA via WiFi. ( I also have Z-Wave but don’t think this is useful in this case.)

Thanks in advance.

Hello and sure. Will be in touch later with my setup.

Hello jonboy,

As mentioned above I use a pair of Dallas DS18B20 temperature sensors connected via a single 3 core wire to a Wemos D1 Mini running ESPEasy

Both sensors are attached to the feed and return pipes directly above my boiler and held there with a jubilee clip on each pipe. These sensors can connect to a single cable as they each have their own unique address which is added to the settings in ESPeasy. The Wemos connects to my home wifi and then to my MQTT broker where the values are displayed.

This can also easy be done using ESPhome and using the API you would not need to use the MQTT broker. I intend to do this eventually but this Wemos runs very well and can easily be updated or configured via the webserver that can be reached via its IP address.

If you need further information or my ESPEasy config settings then just ask :grinning:

Thank you. A whole new world of playing with things opens up. I’m ordering a few D1 Minis and sensors. So when they turn up I may be back asking questions!

1 Like

Below is a useful guide to install ESPHome into hassio (to manage your D1) if you havent done it before…

Add the repository https://github.com/esphome/hassio to your list of sources in the add on page in hassio.

Download the ESPHome add on and away you go.

Then all you need to do plug your new D1 into a USB port of the Home Assistant computer to flash its config (you can then send them over Wifi after).
You add the sensor configurations to the yaml file inside your new node to make a multitude of sensors report to home assistant.

I’d say if you are transmitting over a long distance, for a few extra quid, its worth buying the D1 Pro with external antenna

https://www.amazon.co.uk/Espeedy-WEMOS-ESP8266-Wireless-Antenna/dp/B078RGCPT5?SubscriptionId=AKIAILSHYYTFIVPWUY6Q&tag=duckduckgo-ffab-uk-21&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B078RGCPT5

Full guide:

How accurate would you say this setup is in regard to reported temps?

Very accurate, my boiler has a temperature screen on the front and the feed temp mostly matches it. There is some lag as the reading is taken through a copper pipe so there is some delay heating up and cooling down but there is no way around this without tapping into the water flow which is not a good idea.

1 Like

@BertrumUK
Can you please give some more info about your ESPeasy setup?

Sure, does my post here not give you most of what you need or do you need the config or screenshots as well ?

@BertrumUK , config or screenshots would be greatly appreciated; especially config.

Thank you

Sure, Here are some screenshots of the DS182b20 1 wire sensors. If they are working then their address should show up.

To set up MQTT use OpenHAB MQTT under Config and enter your broker settings.

Note that this version of ESPEasy may look different now - this works so no need for me to update it yet.

Here is a copy of my mqtt sensor in HA

- platform: mqtt  
  state_topic: "/esp01/tempfeed/Temperature"  
  name: "Feed Temperature"  
  unit_of_measurement: "°C"  

Throwing my thanks in for the suggestions in this thread and the examples to get ESPEasy working. These little wemos devices are opening up a new horizon in filling my home with sensors…

Happen to have a link to the sensors? A search reveals a ton of different options.