You can support me by reading this article on Medium

Part 1: How to control a distributed heating system through meter-thick walls you are not allowed to drill?

A very old restored monastery window
The monastery window, attribution: Matevz1400, CC BY-SA 4.0, via Wikimedia Commons

A couple of years ago a friend had a problem: He is in charge of an 800-year-old monastery building now used as a conference center and an event venue. This majestic building was thoroughly renovated about 10 years ago, but the otherwise excellent new heat-pump-based underfloor heating system was missing the provisions for temperature control in individual rooms. Heating all the rooms all the time was wasteful and there was no way to set the temperature higher (e.g. in the conference hall) or lower (for custodial or temporarily unused spaces). Fortunately, the system already included the necessary underfloor heating loop valves, we just needed to find a way to control them.

The building spans about 100 meters with a square footprint and has very thick walls (meter or more). It is of course heritage protected as well, so drilling for new cabling was out of the question. We also really did not want to change the existing cabling; the long cable runs would be both expensive and time-consuming. We had to go wireless.

But there was a big problem: Wireless communication over more than 100 meters of distance and through meter-thick walls is too much for most of the known technologies, like WiFi, Zigbee, Bluetooth, etc. There is also the issue of licensing. What to do?

LoRa

The solution was to use LoRa (Long Range) technology. It is a low-cost, long-range wireless communication technology that uses frequency bands from 400 to 900MHz. The LoRa protocol is much slower (kilobits instead of megabytes) than e.g. WiFi, but this is offset by the fact that it will work over distances of several kilometers in the open. Or, in our case, over 100 meters and through several thick walls. It also does not require a radio license (but you do have to check for legal limits in your area like permissible frequency bands, transmit powers, and duty cycles).

Timing

LoRa transfers data at low speeds, between 0.3 to 50 kbits/s. This is not enough to visit websites, control a robot, or listen to music, but plenty for a heating control system that needs at least several minutes to respond to changing inputs. This is why LoRa is used for monitoring and control of remote systems like weather stations, reservoirs, and even satellites. There are many systems out there that only need to send or receive a few tens of bytes every few minutes or hours.

Complexity

The LoRa protocol is complex to implement from the ground up, but you can buy off-the-shelf gateways and sensor stations, e.g. from RAK. If you want to build custom systems, there are comprehensive software stacks and hardware modules available for all major micro-controller families, e.g. from Seeed. All this makes it possible to build a basic prototype quite quickly.

An IoT Solution or a Closed System?

LoRa is a popular IoT solution and there are internet-connected public LoRa networks all over the world, many requiring a low-cost subscription. This makes it a great solution for mobile stations, e.g. location monitoring for machinery etc., or smaller systems where you don’t want to set up a gateway yourself.

In our case, we had to install a LoRa gateway because of the difficult environment (a public network was available, but the signal would not reach the inside stations). We also have over 20 stations, so the gateway was not a big expense. And there is the issue of control system safety and reliability, both easier to achieve using own gateway.

Control System

System structure

So what does the structure of the whole system look like?

Structure of a control system showing a LoRa gateway in the center, connected to an application server, the temperature sensor stations, and the control stations
System Structure

Application Server

The application server is the heart of the whole system. It runs on a Raspberry Pi, runs Home Assistant, and is connected to the MQTT server in the LoRa gateway.

Home Assistant

The Home Assistant logo

Home Assistant is an open-source home automation platform that runs on Python. It provides many different components, including a web-based front end with authentication and integrations for climate control, MQTT, backups, data logging, and more. It provides a GUI for our whole system.

Connection To the Sensors and Control Stations

The LoRa gateway makes it possible to talk to all the LoRa sensors and control stations using MQTT. Each underfloor heating valve is represented as an MQTT switch in Home Assistant, while the temperature/humidity/air quality sensors are represented as MQTT sensors. The actual temperature control is done using Home Assistant’s Climate integration as simple thermostats reading the MQTT temperature sensors and controlling the MQTT switches for underfloor heating valves.

Data Logging

The system includes temperature, humidity, and air quality sensors. Their values are all logged inside the Home Assistant system and stored in a database.

Conclusion

This article is an outline of the control system solution and I will be going into more detail in the following articles, where I will be talking about the control station design, the LoRa gateway config, and the Home Assistant config.

LoRa turns out to be an excellent solution for retrofitting monitoring and control into existing distributed systems, giving us the option to avoid expensive cabling and making it easier to respect the heritage protection rules.

Home Assistant was designed for home automation by enthusiasts but grew into a lovely solution for diverse automation needs, including small and medium-sized HVAC and related systems. It needs some attention as the ecosystem grows and changes, but one update a year with maybe some config updates doesn’t take a lot of time. It gives you a gorgeously looking GUI and all the features you need for control and data logging.

One of the larger challenges of decarbonization is the legacy systems. These will often use energy inefficiently (heating everything all the time is an excellent example) and lack things like temperature control, which is important for comfort. Sometimes, it makes sense to rebuild them completely, e.g. to replace fossil-fuel-based systems, but some legacy systems really only need some additional control. In these cases, using LoRa can be a comparatively simple and extremely low-cost solution with incredible ROI.

If you found this article useful, you can buy me a beer here.