Remote monitoring and climate control in a country house

    What do we have:
    • Two-storey townhouse designed for year-round use
    • Centralized power supply (as always in country houses, very unstable)
    • Central cold water supply
    • Centralized gas supply
    • Gas heating boiler Protherm Gepard


    What do we want to get
    • Possibility of remote monitoring of the microclimate in the house (so that the soul was calm in case of a long absence)
    • The ability to remotely control this very microclimate (reduce the heating temperature in order to save gas, increase the temperature before returning home)
    • Ability to remotely take readings of resource meters to be paid (gas, water and electricity meter)
    • The cost of installed equipment should be economical
    • The cost of operating the system should be minimal


    I began to consider options from the last paragraph (“minimum operating costs”). For and so you have to pay for cleaning the territory, water, gas and electricity. Accordingly, for the purposes of remote monitoring and control, there are two main solutions:

    1. Management and monitoring implemented with the help of SMS-messages
      Positive aspects
      • Fairly good noise immunity (in case of unstable coverage, SMS delivery attempts will be made automatically by means of a telecom operator and / or subscriber unit)
      • The ability to monitor and control from any mobile phone
      • Availability of ready-made solutions (from a description of possible implementations to commercially available off-the-shelf devices)
      Negative sides
      • Fairly high cost of data exchange (even in the case of using prepaid SMS packages)
      • Limited size of the information package (if it is necessary to exchange large amounts of data, the exchange rate drops, and the cost of traffic increases significantly)
    2. Management and monitoring implemented through the Internet.
      Positive aspects
      • Low (and in some cases zero ) data exchange costs
      • Significantly larger possible size of the information package
      • The ability to exchange relatively large amounts of data, which improves the resolution of monitoring systems
      • A small number of ready-made solutions (most of which, moreover, require a permanent public IP address to provide access to the device from the outside world)
      Negative sides
      • Internet monitoring and control required
      • Due to the features of the Mobile Internet service, our operators (there is no way to get a static public IP address for a mobile device at reasonable prices) must have a server on which information will be collected from remote devices
      • In case of unstable coverage, the task of guaranteed data delivery lies with the software

    After studying the solutions found on the Internet, I realized that none of them suits me (even from the point of view of operating costs. Not to mention the cost of the equipment itself). Therefore, we will do everything from scratch. Okay, not really from scratch: I have a free server that is available on the Internet in 24x7 mode. Well, that’s it.

    Implementation: transferring data and control commands


    After analyzing the proposals of the "Big Three" (both for individuals and M2M), I settled on Megafon’s mobile Internet with the option “Internet tablet” . In it, unlike MTS, there are no restrictions on the use of "only on tablets", and 20 MB of daily included free traffic for telemetry is more than enough. Since I use the device for my own needs as an individual, no explicitly described conditions and restrictions of the operator are violated.
    So, in the online store a USB modem was purchased from the operator, the tariff plan was accordingly changed and the required option was connected.

    Implementation: Managing Controller


    It must be miniature, stable, not requiring external cooling, allow the installation of the Linux OS (to make the most of ready-made solutions, and not reinvent the wheel for every occasion), have a number of programmable inputs / outputs and at least one USB port, supporting host mode (for connecting a USB modem).
    The cheapest option was to use Banana PI , although you can take its functional prototype Raspberry Pi . Just Banana at that moment was available for less money.
    Here's what happened in the end (without a gas boiler interface)
    Control Controller with GPRS Modem

    Implementation: Sensors


    I wanted to have information about the microclimate in the whole house (2 floors), respectively, 5 digital DS18B20 thermometers were purchased . Their location: wall on the 1st floor (air temperature on the 1st floor), battery on the 1st floor (coolant temperature on the 1st floor), wall on the 2nd floor and battery on the 2nd floor (air and coolant on the 2nd floor), one sensor is taken out further away from windows and doors (in order to receive information about the real temperature on the street). All sensors are hung on one two-wire (in my case also shielded) bus. My cable length turned out to be just over 20 meters, while all the sensors work stably and without failures.
    To account for gas flow (I’m lucky - I have a gas meter with a built-in magnet), a hall sensor was used (for details, seerelevant article ).
    To expand the functionality to the built-in weather station, an atmospheric pressure sensor was also purchased .
    For future development (implementation of heating algorithms using the concept of "dew point"), a relative humidity sensor was purchased, but it is not yet used.

    Implementation: boiler control (theory)


    Oh this cauldron! Well, yes, I started by observing the microclimate, and as a result, I also wanted to manage it. My boiler supports two types of control: “on / off” (if “turned on” - we will heat water to the temperature set on the boiler console. If “turned off” - we will not heat anything) and digital via eBus . The latter is a (German) development for controlling home climate equipment, but the specific implementation is very dependent on the manufacturer of the equipment. For my boiler, I found only one original thermostat-controller on sale , but it works exclusively in stand-alone mode, which, in fact, is no more useful than controlling the boiler through its console.
    After some study of the information available on the Internet, it was possible to dig up some fragments of the control protocol obtained by enthusiasts through reverse engineering. I did not act as harshly as the author of this article , but still, as a result, I managed not only to talk heart-to-heart with the boiler, but also to force him to carry out my commands as if the original temperature controller issued them. Nevertheless, many thanks to the pioneers , looking at which I realized that nothing is impossible in this life!

    Implementation: boiler control (practice)


    So, we will control the boiler via eBus. Ready-made adapters for the bus cost insane money (yes, besides, they are available only “on order.” And winter was approaching, the system must be started!), So I had to remember my youth (and my passion for radio) and develop my own pairing scheme. With galvanic isolation (because the memory of a computer burned out due to a faulty power supply was still fresh, and I didn’t really smile at the gas boiler in my hands before the winter). The circuit is so far assembled on a breadboard, but has already proven its stable performance.
    Interface block on breadboard
    EBus interface

    Implementation: Software


    Original development (both the server part and the “controller firmware”). For the data visualization system (for now) a free monitoring system Zabbix is ​​used , but it is still planned to make a specialized application. In general, the software supports the modular organization of the hardware: what is installed in the controller will be serviced. You need a weather station (installed the appropriate module) - get information about atmospheric pressure. You need to control a gas boiler (installed a module with a relay or an eBus interface) - you can control it (otherwise just watch the situation in the house). You have your own Internet channel - then you do not need a USB modem, just connect the device to your router using an ethernet cable.

    results


    On New Year's holidays, my wife and I left far enough from our house, but we had the opportunity to monitor his condition at any time. And, if necessary, change the microclimate parameters (several times this had to be used with a significant change in the external air temperature, below -15C). In any case, the heating system did not freeze (despite repeated interruptions in the village’s power supply), the flowers growing in the house did not freeze, and we did not burn so much gas for heating. By the way, the gas meter values ​​from the point of view of the program and real for two months of operation coincided completely, therefore gas payments can be completed without even visiting your home.
    General view of the working device
    General view of the device layout
    (below is a voltage stabilizer for a gas boiler, you can ignore it)

    How it looks on a computer


    Monitoring without connecting to a gas boiler
    Temperature graph in the house and beyond
    Despite an autonomous connection, it is possible to verify that the boiler is working according to a sawtooth graph of the coolant temperature in the heating batteries. A trifle, but nice!

    Gas flow sensor (see previous publication )
    Gas consumption graph (cumulative)
    So far, everything is displayed on an accrual basis, but this graph will be changed to a graph of gas flow rate versus time.

    Weather station: outside temperature
    Outside temperature graph
    Well, it's just interesting for me to know what to wear when leaving the house.

    Weather station: atmospheric pressure
    Atmospheric pressure graph
    Ek flatters it and collapses! While we observe, but it will be possible to somehow fasten and to predict the weather.

    Monitoring with gas boiler control

    For control at the moment, it is possible to set the desired target temperature of the coolant (its output and return). On the graph, goals are indicated by dashed lines. According to them, the boiler independently determines the operation algorithm (the interval between switching on the burner and the pump), focusing on the data of its own temperature sensors.

    Reliability and safety


    The operating system in the control controller operates in read-only mode, so the device is not afraid of unexpected power outages. Similarly, the gas boiler is controlled in such a way that in case of a violation of the control circuits (the controller is de-energized, the interface cable is turned off, or the cable is broken), the boiler automatically switches to the standard operating mode with control from its console. Data exchange algorithms are optimized for “very poor communication channels” (for the device to work, at least “occasionally occurring” EDGE connections are sufficient, as I personally made sure when installing the controller in the Biserovo settlement of the Moscow region - there is simply no Megafon coverage there).
    Currently, the device collects information from sensors with a frequency of once per minute, and the exchange with the server is done every 15 minutes. In this mode, the maximum resolution of monitoring will be 1 minute, and the maximum possible delay in receiving information is 15 minutes. At the same time, the supply of free daily traffic is 15Mb out of 20MB provided in accordance with the tariff option.
    The second type of control (via SMS) can be used when it is necessary to obtain information or change the operating mode “here and now” (ie if we do not want to wait 15 minutes before the next session with the server).

    Future plans


    • “House conservation” mode: automatic maintenance of a temperature regime that would prevent mold (the temperature in the house should be above the “dew point”) and / or prevent freezing of the heating system (if water is used as a heat carrier, instead of antifreeze)
    • The mode of maintaining the required temperature on a given floor with optimization of the boiler from the point of view of gas consumption
    • Accounting for electricity consumption
    • Water metering
    • Control of hazardous situations (gas leak, excess of CO level, water leak, etc.)
    • Adding an autonomous power supply system for the device in case of stationary power failure (although, of course, in this mode the gas boiler will not be able to work)
    • Anything else?


    Small marketing research


    And finally, a little marketing research. The above development was done exclusively "for myself", but taking into account the interest in it of our friends and neighbors, the option of creating an industrial version of such a controller is considered.
    • At present, the device does not have its own indicators and keyboard for control. Management and monitoring are possible through the Internet (main mode) and via SMS (additional mode). Do I need to make any indication system (display) and autonomous control (buttons), taking into account the fact that this will increase the cost of the hardware?
    • In the case of Internet control, an external server is required. This server can work with an unlimited number of remote devices and, accordingly, individual consumers. But hosting and maintaining a 24x7 server cannot be free. Are you ready to pay any subscription fee for this service? If so, what monthly size do you consider acceptable for yourself?
    • A question arising from the previous one: are you not afraid to manage your home through a cloud platform? Well, yes, there are several levels of protection, there is the possibility of battery life. Even if the controller completely fails, then this will not lead to any fatal consequences. But still, if you think about it?
    • For the industrial version, you will have to develop and manufacture a printed circuit board and device case. Are you ready to pay pre-order for the device described above with the condition of delivery of the finished product 2-3 months after payment?
    • The final device will be in a boxed version, but to install temperature sensors, you need to stretch the wire (its length depends on the controlled room), install sockets for sensors on it, connect the wire to the gas boiler (through the standard connector, but still ...). Those. perform some simple installation work. Are you ready to make them yourself, or prefer to get a turnkey system?

    Also popular now: