Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

First Steps to a Smart Sauna

DZone's Guide to

First Steps to a Smart Sauna

Here we explore how to connect sensors to a sauna and its associated plumbing as well as to Tibbo's AggreGate platform for messaging and data visualization.

· IoT Zone ·
Free Resource

In my previous article, I promised to describe certain projects where our solution was implemented. To begin with, let’s look at one of our inner DIY projects.

I made an attempt to automate a sauna. During major repairs, I decided to provide heating to the sauna so that it would not freeze in winter and consequently be warmed more quickly. Thanks to heating, we can exclude dew and unwanted condensation inside the sauna. Thus, the wood is preserved for much longer. However, there is only one problem: additional heating should be paid for. In the following paragraphs, I will explain how to minimize heating expenses and automate the whole process.

Image title

So, there is a private house with a heating contour (contour 1) going from a gas boiler. The sauna is situated not far from it (6 meters at maximum). It was decided to connect the sauna to the house heating contour. Several meters from the sauna, a number of temperature sensors were set on a heating pipe (contour 2), i.e. in possible freezing areas. Contour 2 was not meant to work all the time and at full capacity. To manage this process, a thermostat was designed and assembled on the spot. After the temperature sensors had been connected to the device, it started analyzing sensor data, checking threshold values, and switching the relay on/off. In its turn, the relay turned on/off contour 2's recirculating pump. The thermostat was controlled via ModBus protocol (Ethernet), and AggreGate was chosen as the monitoring system.

Now, let’s look at more details.

Plumbing

Underground, at a depth of 3 feet, I placed four pipes: two pipes for heating and two pipes for hot/cold water.

Image title

I also placed a power cable and a UTP-5 twisted pair for LAN. I laid a wire with temperature sensors to the return pipe, under insulation, and fixed them to the pipe. I chose DS18b20 series sensors because they use the 1-Wire protocol and can be set on a single line, which is what I did.

Image title

Image title

Temperature sensor on the pipe:

Image title

The sensor was firmly fixed in hermetically-sealed heat shrink:

Image title

Thus, we got the following sensors: one sensor in the boiler house, another sensor at the boiler house exit, two sensors underground (were put out of curiosity rather than by necessity because the temperature is rather stable underground), one more sensor underground right near the sauna, several sensors along the inside sauna wall, one more outside, and three sensors in the steam room (below, above, and in the middle). The total number of sensors is up to 20.

About the Thermostat

I assembled this device on the fly in my free time within a couple of months. I made the scheme/wiring in Proteus, coded the firmware in AVR Studio, and made a board with the help of an iron and a laser printer. This is what I got:

Image title

Image title

Image title

Image title

Basic elements: ATmega128 processor, Ethernet→SPI converter (by Arduino), display, keyboard, 20 DS18B20 sensors, and 2 AM201 temperature/humidity sensors.

The device constantly polls the connected DS18B20 and AM201 sensors. All values are brought into registers. Relay on/off thresholds for all sensors are also stored in the registers. Access to the registers is possible via ModBus protocol. All settings can be changed both by using a keyboard and via ModBus registers.

Right away, let me answer the question as to why I made it all and, in fact, reinvented the wheel. I just wanted to make it by myself to broaden my mind. Moreover, an off-the-shelf solution would come at a much higher price.

Monitoring

I implemented AggreGate SCADA/HMI as a monitoring system. After installation, I launched it and connected it to the device.

Image title

Then checked for data to be loaded:

Image title

Everything was OK.

After that, I plotted temperature charts. If you do not know where to click, you’ll need some time to figure it out. I’ll show you what to do.

In the register list, right-click on the “Temperature outside” register field and choose “Create chart” in the context menu:

Image title

Variable/register context menu

The next step is to choose “Chart by history and/or real-time changes”:

Image title

Data source choice

Press ОK:

Image title

Chart type and parameter choice

In the expression field, type {tOut}/16 , as all temperature valuese stored in the device registers are being already multiplied by 16:

Image title
5. That’s all. The chart is ready. Configure the other ones in the same way.

Outdoor temperature for a month:

Image title

Temperature for the entire contour in summer when the boiler is off:

Image title

Temperature for the entire contour in winter:

Image title

Image title

Low amplitude sinusoidal oscillations are smooth contour temperature changes while the boiler is regularly turned on/off. Large ravines are boiler switches to the indoor boiler heating. At this time, the heating system cools off. In theory, it may occur that somebody would turn on hot water for a long time, and the boiler would heat it. Consequently, the temperature of the heating contour may considerably decrease. It may be critical for the sauna — pipes can freeze in some areas within 20-30 minutes of downtime at -30 degrees С.

AggreGate can detect this problem. I added an alert to the minimum temperature value:

Image title

Image title

In case of such an alert, SMS would be sent:

Image title

SMS messages are sent via SMPP protocol. In case of Internet connection failure, you can connect a GSM modem to AggreGate and send alert messages via it.

Actually, the thermostat device does not fulfill its primary function. The indoor boiler circulating pump capacity is enough for contour 2, so there is no need to set another pump. It would be better to set a non-return valve that would close during voltage supply and open when the temperature reaches the minimum. I did not have such a valve, so I just lowered the discharge head on contour 2 for the time being (for already two winters).

The system has been successfully operating for more than two years now. Next, I intend to create a device for the air extraction system control in the sauna, which would be based on set humidity values.

Topics:
iot ,home automation ,tibbo aggregate ,alerts ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}