My Smart Thermostat Runs Boiler, Mini-split, And Window A/c

About the project

The project will start, control, and protect a wood-fired boiler, modulating according to outdoor temperature. It will control a mini-split to provide heat or cooling. It also controls a window A/C. Statistics are rendered on Blynk graphs. Control via Blynk and Node-Red dashboard.

Giant Board SBC Contest WinnerGiant Board SBC contest winner

Project info

Difficulty: Difficult

Platforms: AdafruitBlynkIBMNodeMCU

Estimated time: 1 day

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Groboards Giantboard Groboards Giantboard Central controller x 1
NodeMCU v2-Lua based ESP8266 development kit NodeMCU v2-Lua based ESP8266 development kit Heat valve controller & water heater monitor x 1
Witty ESP-12F Witty ESP-12F Mini-split controller x 1
Wemos D1 Mini Pro Wemos D1 Mini Pro Window A/C -- external antenna selected for best WiFi reception x 1
High current (30A) relay High current (30A) relay Window A/C compressor x 1
Relay board, four channel Relay board, four channel Boiler, heat valve, and window A/C x 3
Groboards WiFi Featherwing Groboards WiFi Featherwing x 1
Temperature Sensor Waterproof (DS18B20) Temperature Sensor Waterproof (DS18B20) 3x boiler, 2x window A/C, 1x water heater x 6
ESP-01 ESP-01 Attic fan controller x 1
Outlet Outlet Boiler, attic fan x 2
Box fan Box fan Attic fan x 1
Outlet box Outlet box Boiler, attic fan x 1
Vera Hub Vera Hub To read Z-Wave thermostat x 1
Eko Boiler Eko Boiler x 1
Mini-split Mini-split x 1
Window A/C Window A/C x 1

View all

Software apps and online services

Blynk Blynk
Node-Red Node-Red
MQTT server MQTT server
Alarm.com subscription Alarm.com subscription Automatically control your temperature anywhere in the world!

Hand tools and fabrication machines

Soldering iron Soldering iron x 1
Connecting wire Connecting wire x 1

Story

Background

Wood is the most renewable and plentiful energy source in some places. But burning it can produce lots of smoke and ash. Enter a gasification boiler. It bakes the wood and burns the gases for very little smoke or ash. It's like carburetors versus fuel injection. Of course, a wood fire isn't so easy to turn on and off, and boiler must never overheat because they could explode. A mechanical thermostat, costing about $100, was the typical answer to the problem. But a post by David Hunt started me on a cheaper, "smarter" path.

On a cold, clear morning, the boiler runs at maximum capacity, resulting in little more than steam coming from the combustion.

Theory

A Node-Red server monitors and controls devices based on current status, thermostat control, manulauser input, and user-defined options.

Overview

The Giantboard is like the quarterback, or the conductor of symphony. These are the players:

The Alarm.com smart thermostat is the simple user interface. It allows schedules, and allows remote access anywhere in the world with the Alarm.com app. Node Red communicates on Z-Wave to the thermostat by way of a Vera Hub.

The ductless minisplit is the versatile, agile player. It can heat, cool, or simply circulate air.

The Eko boiler is the heavy lifter. Dirty, dusty, hot, and cantankerous. But very, very good at generating heat. Plumbing of the heating system is beyond the scope of this article.

The other players are the box fan (laid in the attic access hatch) and the window air conditioner.

What Node Red Does

The thermostat's setpoints, heat/cool mode, system fan mode, temperature, and humidity is collected by Node Red. A calculation is performed to determine what temperature it "feels" like inside. It can control the systems based on actual temperature or feel like temperature. A decision is made for what system is required for the load, and the command sent via MQTT or Blynk. Outdoor weather is collected, and during cooling cycles when the house attic ventilation fan would be called for, if it is hotter outside, or feels hotter outside, the ventilation fan is not permitted to run.

The boiler control gets a separate flow due to its complexity. Several rules have to be observed:

1. The pump should run only when the boiler has enough heat.

2. The pump should run if the boiler is near freezing to prevent a catastrophe.

3. The valve should open if the boiler is hot enough when there is a call for heat.

4. If the boiler is overheating, the pump and valve must operate to dump the extra heat in the house. The boiler must also be disabled until it cools down.

5. If the boiler temperature has started to drop when the boiler is running and after the first (two) dips in temperature of cold water from the valve opening to the heating load, the fire is going out. Turn off the boiler and alert the user.

6. If the boiler cools off too much, it's harder to restart. Disable the combustion fan and turn off the pump.

7. When the fire is burned down to embers, it can be impossible to restart with full fan. It can take hours with a low fan. A periodically engaged fan will cause it to start very quickly. The Blynk app provides the user with a choice of which mode when loading. A reminder is sent every 15 minutes to keep the user conscious of the process.

8. If the outdoor temperature is very low, the boiler should run at its hottest. But at milder temperatures, that would be a waste of energy. If the boiler is allowed to run too cool, creosote builds up quickly in the firebox. Creosote eats away at the internals, causing leaks. Weather data is continually monitored to automatically adjust the boiler operating temperature. It's a rudimentary form of the outdoor reset feature on many boilers and furnaces.

9. The boiler needs loaded twice a day if its running, or once a day if its mostly idle. Alert the user, as appropriate.

10. When it is time to load the boiler, the automatic control is disabled. A relay is also turned on to provide light and an exhaust fan to removed smoke released during loading.

Alerts are sent to the email address associated with the user's phone number, eliminating the expense of direct text messaging. Statistics and options are reported to the Node Red Dashboard, where some commands may also be issued.

Blynk has much better charts for analysis that the Node Red Dashboard. Common commands can be issued there, too.

The boiler graph has a black line showing the boiler's target setpoint. If there's no call for heat, the black line tracks the domestic hot water temperature. The red, yellow, and blue lines track water out, in, and return from load, respectively. The bottom graph shows (from top to bottom)  the operation of the valve to the load (house), the boiler high output mode, the pump, and the boiler minimum/idle. In the following graph, the thermostat has called for heat. The shock of cold water dropped the boiler temperature too low, so the pump cut out. As the temperature ramped up, the pump circulated water to gently ease up the temperature. (Thermal expansion and contraction cycles are not good for boilers.) Finally, the load valve opens, the boiler is hot enough, and the high mode cuts out until cool water from the house hits again and the boiler is able to keep up.

Putting the pieces together

Note that this project deals with mains voltage, which can kill you if you don't understand what is happening.

Groboard

This is simply installing the headers and plugging in the WiFi board and power. I did not have the headers, so I had to find the schematic and bring the correct pins over manually.

Boiler controller

This is assembled by connecting four relays to the pins specified in the code. Their purposes are: boiler power (idle mode), boiler high, pump, and exhaust fan. A standard DS18B20 circuit is used to attach three temp sensors to the specified one wire pin.

A/C controller

This again is a matter of connecting relays and power. A high current relay is used to run the compressor. Three more relays on a four relay board are used for: fan manual/auto, fan low/[next relay, and fan med/hi.

Ductless controller

This circuit is a simple IR controller, just as is described here.

Attic ventilation box fan

This is a ESP-01 connected to a relay board wired into a typical outlet, into which the fan then connects.

Programming the Giantboard

These are the basic steps I used to get Node Red up and running on the Giantboard. 

1. Setup

https://groboards.com/docs/getting-started/how-to-boot-and-login/

Connect to board on Mac: https://pbxbook.com/other/mac-tty.html

2. Enable Wifi

https://groboards.com/docs/u-boot-overlays/using-the-wifi-featherwing-on-the-giant-board/

3. Enable SSH

I had trouble with my usb cable staying connected, and my other usb cables didn’t transfer data for some reason. I wanted to power the board with a reliable usb, and connect over the network.

https://phoenixnap.com/kb/how-to-enable-ssh-on-debian

4. Install MQTT (thanks to Ahmad Radhy for next four steps)

Running out of disk space on “sudo apt get”. Had to grow the 2nd partition; used gparted live cd and SD card reader.

did “sudo apt upgrade” after “sudo apt update” to upgrade all old packages

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-debian-9sudo

This did not work at first. Had to uninstall:

https://askubuntu.com/questions/1092829/how-do-i-remove-mqtt-mosquitto-broker

Then reinstall:

https://maker.pro/raspberry-pi/tutorial/how-to-install-the-mosquitto-mqtt-broker-on-a-raspberry-pi

Also see: https://askubuntu.com/questions/815091/how-do-i-start-mosquitto-mqtt-broker-on-startup-in-ubuntu-16-04

5. Install curl

  1. sudo apt install curl

https://www.cyberciti.biz/faq/howto-install-curl-command-on-debian-linux-using-apt-get/

6. Install nodejs, npm, NodeRed

  1. bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
  2. sudo systemctl enable nodered.service

https://nodered.org/docs/getting-started/raspberrypi

https://www.instructables.com/id/Install-Nodejs-and-Npm-on-Raspberry-Pi/

7. Disable automatic updates (run under superuser)

https://askubuntu.com/questions/1059971/disable-updates-from-command-line-in-ubuntu-16-04

8. Finally, it is simply a matter of importing the javascript into Node Red.

An email address and password is required for outgoing notifications.

An API key must be obtained from Openweather to get weather data.

Pictures

    Groboard

    Attic ventilation fan

   

Blynk screen showing indoor temp, indoor "feels like", and outdoor temp. Black line shows setpoint when thermostat calls for heat or cool. No one was home in the morning, so the security system put the temperature in the away schedule. When my phone moved close to the house, the normal schedule was resumed automatically.

   

Window A/C controller. Note this version was testing the compressor with a small relay. This idea was scrapped because the current was too high and posed a safety issue.

Future Improvements

The Giantboard can replace the boiler controller. It would be possible to add a fingerprint reader, since it can be hard to unlock the combination lock on the shed when it is very cold. Note that using a Giantboard for this project saved the expense of a different computer system.

It would be helpful to control ceiling fans whenever the system calls for heat/cool, and manually as well. A variable speed controller board with a snubber would provide fine-tuned control over the fans.

It's impractical to run a wood boiler all summer for hot water, but a company has commercialized concealed attic piping for just this purpose. Node Red could circulate water in these pipes when energy was available.

Borrowing algorithms for industrial systems known as process-integral-derivative,  Node Red could constantly adjust separate systems to balance against current conditions. This technique has been the focus of a detailed research paper.

Edits: 9/15/20: Remove WiFi and Blynk credentials

Schematics, diagrams and documents

Boiler controller

Temperature Sensor

Used on both boiler and window A/C (for performance monitoring of aging unit).

Window A/C

Code

Mini split

Boiler controller

ESP-01 for attic fan

Window A/C

Heat valve & water heater monitor

Node Red

Credits

Leave your feedback...