<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>LoRa on Making Clean Tech</title><link>https://nunrg.eu/tags/lora/</link><description>Recent content in LoRa on Making Clean Tech</description><generator>Hugo -- 0.136.5</generator><language>en-us</language><copyright>2024 Franci Kopač</copyright><lastBuildDate>Sun, 09 Feb 2025 09:45:43 +0100</lastBuildDate><atom:link href="https://nunrg.eu/tags/lora/index.xml" rel="self" type="application/rss+xml"/><item><title>Hardware for Talking Through 800 Years Old Walls Using LoRa</title><link>https://nunrg.eu/posts/lora_hardware/</link><pubDate>Sun, 09 Feb 2025 09:45:43 +0100</pubDate><guid>https://nunrg.eu/posts/lora_hardware/</guid><description>The hardware behind a LoRa link that works through 800-year-old walls: modules, enclosures, power and wiring for a heritage retrofit.</description><content:encoded><![CDATA[<p>You can support me by <a href="https://medium.com/@francikopa/hardware-for-talking-through-800-years-old-walls-using-lora-8bfcc990dcaf">reading this article on Medium</a></p>
<h2 id="part-2-the-hardware-you-need-to-control-a-distributed-heating-system-through-meter-thick-walls-you-are-not-allowed-to-drill">Part 2: The Hardware you Need to Control a Distributed Heating System Through Meter-thick Walls You are Not Allowed to Drill</h2>
<p>In <a href="https://nunrg.eu/posts/lora_basics/">part 1 of this series</a> we talked about how to retrofit a temperature control system into an 800-years-old heritage-protected monastery without drilling and running new cables. The solution turned out to be the <a href="https://en.wikipedia.org/wiki/LoRa">LoRa (Long Range)</a> radio transmission technology that trades transmission speed for extreme transmission range, enabling us to wirelessly talk to stations behind several thick walls over 100 meters away.</p>
<h2 id="the-constraints">The Constraints</h2>
<ul>
<li>No changes to the heritage protected building were allowed.</li>
<li>Retrofit budget was limited, ruling out changes to existing cabling.</li>
<li>It needed to be retrofitted to existing underfloor heating piping and valves.</li>
<li>It needed remote per-room temperature control.</li>
</ul>
<h2 id="the-hardware-structure">The Hardware Structure</h2>
<p>Let&rsquo;s refresh our memory and look at the proposed system structure:
<figure>
    <img src="/images/lora/structure.png" alt="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">
    <figcaption>System Structure</figcaption>
  </figure>
  </p>
<h3 id="the-hardware-parts">The Hardware Parts</h3>
<p>Note: I listed all the hardware parts I used with links to the manufacturer web pages. These are just for your information and I&rsquo;m not earning any income through these.</p>
<h4 id="temperature-control-stations">Temperature Control Stations</h4>
<p>Most of the rooms of the monastery have a large central table containing the electrical installation, and underfloor heating piping with valves, but some had only a small cubicle. I was going to have to install the control stations for these rooms there.</p>
<p>The designer chose to build these tables and cubicles from thick iron plate with laser/plasma cut decorations on the sides. It looks wonderful and they are extremely durable, but it meant I could not hide the entire control station inside — the iron plates were effectively a Faraday cage and prevented any radio communication inside. This meant I had to use control stations made from two parts — the radio communication part on the outside wall, and the power supply box with relays on the inside.</p>
<p>After fruitlessly searching for a suitable off-the-shelf product I decided to build these myself from individual modules:</p>
<h5 id="the-wireless-station">The Wireless Station</h5>
<p>The wireless station was the heart of the station, containing:</p>
<figure>
    <img src="/images/lora/wstationinside.png" alt="LoRa wireless station with cover removed and numbered parts">
    <figcaption>The Inside of the Wireless Station</figcaption>
  </figure>
  
<ol>
<li><a href="https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html">A Seeeduino XIAO motherboard</a>, providing connectivity for everything else and a small OLED display for installation and diagnostic purposes, and holding:</li>
<li><a href="https://www.seeedstudio.com/Seeeduino-XIAO-Pre-Soldered-p-4747.html">A Seeeduino XIAO microcontroller board</a>, the heart of the control station. It controls the relays and the display, reads the data from the temperature/humidity sensor, and handles the communication with the LoRa board.</li>
<li>A <a href="https://www.seeedstudio.com/Grove-LoRa-E5-STM32WLE5JC-p-4867.html">Grove LoRa-E5 transceiver board</a>, handling all the wireless tasks.</li>
<li>A <a href="https://www.seeedstudio.com/Grove-AHT20-I2C-Industrial-grade-temperature-and-humidity-sensor-p-4497.html">Grove AHT20 I2C board</a> used to sense the humidity and temperature.</li>
<li>The <a href="https://www.seeedstudio.com/External-Antenna-868MHz-L195mm-black-folding-antena-With-Male-SMA-J-p-5045.html">LoRa antenna</a> for the transceiver board. The transceiver actually has it&rsquo;s own little antenna, but that was not enough, so I used a proper antenna, screwed to an <a href="https://www.seeedstudio.com/UF-L-SMA-K-1-13-120mm-p-5046.html">SMA connector with a pigtail cable and an I-PEX connector</a> for the transceiver board.</li>
<li>The wiring block.</li>
</ol>
<p>I had to design a housing for it as well, which I 3D-printed out of flame retardant PETG. It has some holes for the sensors and the diagnostic display. Given that it was installed in a public space, I designed it to be extra sturdy and it also features a holder making it harder to unscrew or break off the antenna.</p>
<figure>
    <img src="/images/lora/wstation-outside.jpg" alt="LoRa wireless station with cover">
    <figcaption>The Finished Wireless Station</figcaption>
  </figure>
  
<p>This was mounted on the outside of the iron tables and connected, using a 6-wire cable, to the power supply and relays board inside.</p>
<h5 id="the-power-supply-and-relays-board">The Power Supply and Relays board</h5>
<p>The wireless station, being publicly accessible, was strictly low-voltage (5V powered) for safety and it needed a power supply and relays to control the 230VAC underfloor heating control valves, so I needed to put all the high-voltage parts on a separate board, safely installed inside the table. It contains:</p>
<figure>
    <img src="/images/lora/relay-box.jpg" alt="The relay box for the LoRa wireless station with cover removed">
    <figcaption>The Inside of the Power Supply and Relay Board</figcaption>
  </figure>
  
<ul>
<li>A generic 4-relay board with built-in logic-level relay drivers</li>
<li>A generic 5-watt 230VAC to 5VDC safety switching power supply, powering all the electronics.</li>
<li>A fuse</li>
<li>The low-voltage wiring block (above, for the 6-wire cable coming from the wireless station)</li>
<li>The high-voltage wiring block (below, used to connect the station to 230VAC power and to wire the 230VAC valve actuators)</li>
</ul>
<p>This board is safely tucked inside the table/cubicle and contains some components that get warm, so I designed a lighter housing. The cover has ventilation holes for cooling, but provides touch protection.</p>
<figure>
    <img src="/images/lora/relay-box-cover.jpg" alt="The relay box for the LoRa wireless station with cover">
    <figcaption>The Finished Power Supply and Relay Board</figcaption>
  </figure>
  
<h4 id="wireless-temperature-sensors">Wireless temperature sensors</h4>
<p>After some research, I decided to use an off-the-shelf component, the <a href="https://store.rakwireless.com/products/rak7204-lpwan-environmental-node">RAK WisNode Sense Home (RAK7204)</a>, for the remaining wireless temperature, humidity and air quality sensors.</p>
<figure>
    <img src="/images/lora/RAK7204.jpg" alt="The RAK7204 LoRa wireless air temperature, humidity, and air quality sensor">
    <figcaption>The Wireless Sensor, image credit: RAK Wireless</figcaption>
  </figure>
  
<p>These wireless sensors are an elegant solution, running for anywhere from one to several years (depending on signal quality) on one included lithium primary battery. They also feature an automotive air quality sensor, giving us an additional data to monitor, e.g. for ventilation.</p>
<p>I glued some strong permanent magnets on their backs and simply stuck them to a less visible/reachable metal part in the room I wanted to monitor.</p>
<p>The monastery has quite a few rooms and corridors, so I installed 11 of these in all the places not covered with the control stations.</p>
<h4 id="the-lora-gateway">The LoRa Gateway</h4>
<p>As explained in the <a href="https://nunrg.eu/posts/lora_basics/">part 1 of this series</a>, using a public LoRa network was not an option for several reasons. This required installing a LoRa Gateway.</p>
<p>After some research, I again went for a solution from RAK, the <a href="https://store.rakwireless.com/products/rak7268-8-channel-indoor-lorawan-gateway?variant=42316475924678">WisGate Edge Lite (RAK7268)</a>. It has since been superseded, but the product on the link is mostly the same.</p>
<figure>
    <img src="/images/lora/rak7268.jpg" alt="The RAK7268 v2 LoRa gateway">
    <figcaption>The LoRa Gateway, image credit: RAK Wireless</figcaption>
  </figure>
  
<p>It only needs network and power. I found that the easiest way to interface with it was using the built-in MQTT server, but we will cover that in the software part of the series.</p>
<p>I installed it in a high place to get the best possible coverage and connected it to the same network switch the application server running Home Assistant was connected to.</p>
<h4 id="the-home-assistant-server">The Home Assistant Server</h4>
<p>The Home Assistant Server is running on a Raspberry Pi 4 SBC. For storage I used an SSD though an USB-SATA interface cable that allows me to store several years worth of data and backups. It is connected to the same switch as the LoRa Gateway.</p>
<h2 id="conclusion">Conclusion</h2>
<p>In <a href="https://nunrg.eu/posts/lora_basics/">part 1 of this series</a> I described this solution in a general way, but this part is my attempt to clarify by showing you the  hardware I used.</p>
<p>As you can see, the off-the-shelf parts are all pretty low-cost components, easy to buy and install. The harder part was to select and integrate the custom wireless control stations, but I was forced to do this due to not finding the right component off the shelf. Still, using the rich plethora of modules available, it is not a big deal to assemble an usable system.</p>
<p>The wireless station design was heavily influenced by the fact it is a one-off project. I took proper care of electrical safety and reliability, but with less than 10 stations built, I did not have to think too much about the manufacturability of it.</p>
<p>The system still runs three years later with the original hardware and has turned out to be very reliable. The only maintenance needed is to replace the wireless sensor batteries as they wear out. In the three years so far, I only had to replace 5 batteries, making this a minimal, once-a-year effort.</p>
<p>The system needs some minimal software maintenance as well, but we will talk about that in part 3.</p>
<p>If you found this article useful, you can buy me a beer <a href="https://paypal.me/FranciKopac?country.x=SI&amp;locale.x=en_US">here</a>.</p>
]]></content:encoded></item><item><title>Wireless Control Through 800 Year Old Walls using LoRA</title><link>https://nunrg.eu/posts/lora_basics/</link><pubDate>Tue, 14 Jan 2025 08:18:04 +0100</pubDate><guid>https://nunrg.eu/posts/lora_basics/</guid><description>How to control a heating system through metre-thick heritage walls using LoRa — a wireless retrofit solution for old buildings.</description><content:encoded><![CDATA[<p>You can support me by <a href="https://medium.com/@francikopa/wireless-control-through-800-year-old-walls-using-lora-967e7168a1dc">reading this article on Medium</a></p>
<h2 id="part-1-how-to-control-a-distributed-heating-system-through-meter-thick-walls-you-are-not-allowed-to-drill">Part 1: How to control a distributed heating system through meter-thick walls you are not allowed to drill?</h2>
<figure>
    <img src="/images/lora/okno.jpg" alt="A very old restored monastery window">
    <figcaption>The monastery window, attribution: Matevz1400, CC BY-SA 4.0, via Wikimedia Commons</figcaption>
  </figure>
  
<p>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.</p>
<p>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.</p>
<p>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?</p>
<h2 id="lora">LoRa</h2>
<p>The solution was to use <a href="https://en.wikipedia.org/wiki/LoRa">LoRa (Long Range) technology</a>. 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).</p>
<h3 id="timing">Timing</h3>
<p>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.</p>
<h3 id="complexity">Complexity</h3>
<p>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 <a href="https://www.rakwireless.com/">RAK</a>. 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 <a href="https://www.seeedstudio.com/lora-solution.html">Seeed</a>. All this makes it possible to build a basic prototype quite quickly.</p>
<h3 id="an-iot-solution-or-a-closed-system">An IoT Solution or a Closed System?</h3>
<p>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&rsquo;t want to set up a gateway yourself.</p>
<p>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.</p>
<h2 id="control-system">Control System</h2>
<h3 id="system-structure">System structure</h3>
<p>So what does the structure of the whole system look like?</p>
<figure>
    <img src="/images/lora/structure.png" alt="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">
    <figcaption>System Structure</figcaption>
  </figure>
  
<h3 id="application-server">Application Server</h3>
<p>The application server is the heart of the whole system. It runs on a <a href="https://www.raspberrypi.com/for-home/">Raspberry Pi</a>, runs Home Assistant, and is connected to the MQTT server in the LoRa gateway.</p>
<h3 id="home-assistant">Home Assistant</h3>
<p><img loading="lazy" src="/images/lora/homeassistant.png" alt="The Home Assistant logo"  />
</p>
<p><a href="https://www.home-assistant.io/">Home Assistant</a> 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.</p>
<h3 id="connection-to-the-sensors-and-control-stations">Connection To the Sensors and Control Stations</h3>
<p>The LoRa gateway makes it possible to talk to all the LoRa sensors and control stations using <a href="https://mqtt.org/">MQTT</a>. 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&rsquo;s <a href="https://www.home-assistant.io/integrations/climate/">Climate integration</a> as simple thermostats reading the MQTT temperature sensors and controlling the MQTT switches for underfloor heating valves.</p>
<h3 id="data-logging">Data Logging</h3>
<p>The system includes temperature, humidity, and air quality sensors. Their values are all <a href="https://www.home-assistant.io/integrations/history/">logged inside the Home Assistant system</a> and <a href="https://www.home-assistant.io/integrations/recorder/">stored in a database</a>.</p>
<h2 id="conclusion">Conclusion</h2>
<p>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.</p>
<p>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.</p>
<p>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&rsquo;t take a lot of time. It gives you a gorgeously looking GUI and all the features you need for control and data logging.</p>
<p>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.</p>
<p>If you found this article useful, you can buy me a beer <a href="https://paypal.me/FranciKopac?country.x=SI&amp;locale.x=en_US">here</a>.</p>
]]></content:encoded></item></channel></rss>