Monitoring a boiler using Tasmota on ESP8266 and DS18B20 sensors

Introduction

After having written about monitoring and driving an old fuel furnace, next step was to control a fancy thermodynamic boiler.

My boiler is a Remeha Azorra 200E, I wanted to be able to monitor its proper functioning:

  • Measure power consumption;
  • Mesure temperatures of air inlet, water tank and water output.

To achieve this, I used two very different devices:

This post focuses on the WeMos assembly.

Hardware

Bill Of Materials

Since most of the parts are inexpensive, you might already have some available. If not threat yourself with a kit to be ready for more assemblies!

Resistors assortment kit15€ for a set of 500

Part Quantity Approx. Price
Perfboard : Main PCB to put your assembly 1 15€ for a set of 34
PCB 2 pin terminal : Optional direct 5V power input 1 10€ for a set of 50
PCB 3 pin terminal : One per temp sensor 4 14€ for a set of 50
WeMos D1 Mini ESP8266 : The brain 1 5€
DS18B20 : Waterproof temp sensors with 1m wire 3 10€ for a set of 10
Flexible silicone wire rolls : To wire the board 1 12€ for a set of 5 spools of 10 meters
Resistors assortment kit : One 4.7Kohm for data bus of DS18B20 1 5€ for a set of 500

Design

The DS18B20 uses 3 pins along with a very simple wiring :

  • GND : Directly connected to +3.3V of the module;
  • +3.3V : Directly connected to GND of the module;
  • Data : Connected to D7 (my setup, use your own).

The data pin uses a bus protocol allowing multiple sensors on the same pin of the Wemos.

It is therefore possible to use up to 8 DS18x20 devices on a single device. More is possible but unsupported, see the docs : DS18x20 temperature sensor.

The only requirement is to add a 4.7K Ohm between +3.3V and data pin (get a Resistors assortment kit).

Assembly

Board

The assembly is pretty straightforward, the only trick to place the resistor.

I’ve decided to use dedicated terminals for each device to prevent mistakes, even if I’ve planned for 3 DS18B20, I’ve placed a forth extra PCB 3 pin terminal (air outlet, extra tank sensor…). Truth being I only had 3 DS18B20 left.

Note 1 : Ignore markings on the PCB, I’ve layout board so that D7 and 3V3 were aligned with terminals. The extra wiring to distribute GND to all terminals and 5V to the optional power input (if not using USB directly to the Wemos).

Note 2 : I haven’t yet tested boiler mainboard for a 5V supply, I prefer to not fry it.

Boiler sensors

The three sensors are placed such that:

  • First goes into air inlet;
  • Second goes into central tank sensor hole;
  • Last goes under outgoing water pipe insulation.

This is very easy and non-invasive.

Tasmota configuration

Configure template

Go to Configuration > Configure Other > Template

{"NAME":"DS18B20-D7","GPIO":[0,0,0,0,0,0,0,0,0,1312,0,0,0,0],"FLAG":0,"BASE":18}

Configure WiFi

This should already be done using Web Installer configuration, if not go to Configuration > Configure WiFi.

Configure MQTT server and topic

Go to Console

Backlog mqtthost 192.168.0.xxx; mqttport 1883; mqttuser XXXX; mqttpassword XXXX; topic tasmotaBoiler

Enable Home Assistant auto discovery

Go to Console

SetOption19 0

Restart device

Go to Console

Restart 1

Testing the device

Tasmota web UI

After setup, the Tasmota web UI should report the DS18B20 temperature values.

Note : The order of the sensors is based on their physical internal addresses. Just power the board and map within Home Assistant afterward.

Home Assistant

The Tasmota integration helps showing the details of your newly added Tasmota device.

After initial setup in Home Assistant, it is a piece of cake to add the sensors to a dashboard’s view.

Note I have an addition sensors for room temperature : Sonoff SNZB-02 – Temperature / humidity sensor

For full reference, here is my YAML for theses cards.

type: vertical-stack
cards:
  - show_name: true
    show_icon: false
    show_state: true
    type: glance
    entities:
      - entity: sensor.sonde_chaufferie_temperature
        name: Chaufferie
      - entity: sensor.tasmota_boiler_ds18b20_3_temperature
        name: Arrivée air
      - entity: sensor.tasmota_boiler_ds18b20_2_temperature
        name: Ballon
      - entity: sensor.tasmota_boiler_ds18b20_1_temperature
        name: Eau en sortie
    title: Boiler
    columns: 4
    state_color: false
  - type: history-graph
    entities:
      - entity: sensor.sonde_chaufferie_temperature
        name: Chaufferie
      - entity: sensor.tasmota_boiler_ds18b20_3_temperature
        name: Arrivée air
      - entity: sensor.tasmota_boiler_ds18b20_2_temperature
        name: Ballon
      - entity: sensor.tasmota_boiler_ds18b20_1_temperature
        name: Eau en sortie
  - type: history-graph
    entities:
      - entity: sensor.prise_13z_boiler_polledsmartenergysummation
        name: Consommation cumulée

Conclusion

I had some hard time using the ZigBee plugs to monitor power consumption as some devices were not reliable, see Home Assistant – Zigbee device updates : ZHA & ZHA_TOOLKIT OTA.

However adding DS18B20 was very easy using Tasmota and the PCB is also very easy to build since you basically need 3 pins and one resistor.

Next steps / options :

  • Add sensors to measure air outlet;
  • Control air intake to use either outside or inside air based on outdoor temperature;
  • Put device into a nice box;
  • Tap a 5V supply from within the boiler;
  • Control boiler main power to reduce work time, maybe even when air is the hottest.

Post Author: Shut

Leave a Reply

Your email address will not be published. Required fields are marked *