Temperature Logging

Microcontroller hardware and custom code

Introduction

The first temperature sensor is in the hot water tank, mounted in the unused return boss mid-way up the tank. This lets us see what temperature the immersion is maintaining, and how water-usage affects the tank temperature. The sensor is wired back to a wifi-enabled microcontroller, which connects to the main wifi hub.

Network Topology

The temperature sensor feed values back to the ESP8266, which feed them to Router A. Router A passes the values on to the server, which logs them in Home Assistant.

Power Supply

Power is provided by the same power supply as the energy logging system.

ESP8266

Open source, of course, the wifi-enabled microcontroller used is an ESP8266. It is a very small microcontroller with built-in wifi, but can support up to 50 sensors using the OneWire protocol.

The ESP8266 runs my own custom code. In basic terms, the code is repeatedly:

  1. Reading temperature
  2. Broadcasting data

Again, the broadcast of data between the ESP8266 and Home Assistant uses the MQTT protocol. This is an open source protocol, meaning that the system is now open source from one end to the other, and protected from vendor lock-in.

Temperature Sensor

The ESP8266 uses the OneWire protocol, which means many sensors can be wired to the same terminals. This setup uses the DS18B20 which has ±0.5°C Accuracy from -10°C to +85°C. It is fitted into the tank with this stainless steel thermowell.