📜 ⬆️ ⬇️

How not to overpay for Smart Home. Flood protection (anti-leakage)

The article presents a pragmatic approach to creating one of the elements of the Smart Home - economical flood protection (anti-leakage) based on a universal home automation controller.

The main differences from the solutions of this task presented earlier in Habré are the ease of implementation, it is relatively cheap + you don’t have to be a programmer to repeat. True, you still have to solder, but only 2 times.



Introduction


On Habré, as a resource of technically active people, to which the afflicted go for advice and problem solving, there are many articles on the topic of Smart Home.
And often in the comments there are regrets that they say no one has yet given birth at the same time a powerful, easy-to-learn and economical way of implementing the Smart Home for the average man. It is necessary to solder, then code, and often in different languages: for the microcontroller, and for the web, and so on.
And so I took it, I bought spare parts-cubes for cheap and I personally launched it - this is rarely found.
')
So I decided to insert my 5 kopecks, as it seems I just got one of the options for implementing the Smart Home, which can be suitable for many pragmatically inclined consumers.

I will tell on the example of the implementation of flood protection, although already, on the same controller, I have an alarm system, temperature recording and automatic shutdown of the necessary sockets when leaving home.

So, according to my "pyramid of Maslow's needs for the Smart Home" (c) - the importance of signaling and preventing a flood is at the same level as the importance of signaling an intrusion or the appearance of smoke.

Maslow's Pyramid of Needs for a Smart Home



For the scale of the tragedy can be terrifying:


In view of the fact that I recently acquired a universal controller of a smart home and have already implemented more important functionality, I decided that it was time to “lay beds”.

Problem


So, if I wanted to see a water leak, I wanted to receive an alert (sms and / or email) and to automatically shut off the water supply to the apartment. And also be able to open and shut off the water "manually", including remotely via the Internet.

Decision


There are a number of ready-made kits for complete or partial solution of this task, but, firstly, they are, to put it mildly, a little expensive, and secondly, having a universal smart home control controller in hand, you can do it all yourself and be no worse, and even better that everything will be integrated into a single system and will interact exactly as I want, and not as the manufacturer of the system decided. And considering that the most expensive part of the system is already there (the controller), then we get rid of duplication and redundancy.

The current structure of my system is Smart Home. Red highlights components directly involved in the Anti-leakage system.



The desktop layout of the applied part of the anti-leak system looked like this:



I now get hot water by heating in a cold water boiler. Therefore, you need to block only one pipe.

If necessary, it will be possible to simply build up the system and make the overlap of the second pipe simply by adding another valve and connecting it in parallel to the radio relay.

Leakage sensor


The most difficult moment in the entire system.
The trouble is that if questions on the control of intrusion and the appearance of smoke or gas are simply solved by standard sensors, then with the control of water leakage everything is a little different. There is no water leakage sensor in the list of compatible sensors of my universal controller. At least it was not ...

The search on Habr quickly showed the path of least resistance : take a standard wireless reed sensor and, instead of a reed switch, or rather parallel to it, pull the wires with the contacts and close them with water.

This approach has several disadvantages: one of the main ones is the oxidation of non-gilded contacts with time.

Previously, I read on the Internet that there are other ways to detect water leaks, for example, contactless, but low cost, efficiency, and elementary implementation of the above-described variant interrupted the flight of engineering to innovative approaches.

The basis was taken Chinese wireless magnetic contact (reed) sensor MD-209R. In my case, a relatively cheap sensor clone compatible with the PowerCode transmission protocol (from Visonic) was chosen, since this is one of the wireless protocols supported by my controller.

In parallel to the built-in reed switch, I soldered 2 wires, the closure of which actually lead to the sensor triggering.

So, after some simple manipulations with a soldering iron, it turned out this:



Motorized valve


As a valve that blocks the water, you can use any valve that has an electric actuator and the appropriate size of the connection to the pipe.

I tried my model on a Chinese electric valve with a 1/2 inch pipe .



The design of the valve actuator automatically turns off the power to the coil after opening or closing. Thus, there is no need for commands from the controller to relieve voltage through the radio relay after the operation is performed.

Radio relay


To supply power to the drive, I purchased a two-channel radio relay from a list compatible with the controller on ebay. Type YKT-02XX-433



Inside, the chip coder-1527, so beloved by Chinese manufacturers, is installed.

It has 10-amp relays, so, in principle, they can switch almost any household load up to 250V. Limit 2 kW.

To control the electric drive, this is more than enough, since the valve drive is powered by 12 V and consumes only 4 W on the passport, and only during the change of the valve state.

This radio relay can operate in several modes, one of which we just need: interlocking channels. In this mode, when the relay of one channel is turned on, the relay of another channel automatically turns off. Thus, we are “almost in hardware” defending ourselves from simultaneously applying voltage to the “opening” and “closing” of the valve actuator solenoid due to any glitches.

Connection diagram of the valve receiver:



Control



As a “brain” of the system, I applied the NS1000 Nanoserver, the universal controller of the domestic manufacturer of the 1-M Smart Home .

Controller features that are somehow used in this project:
• Supports extra-budgetary wireless sensors and radio relay.
• Run scripts offline (even without internet).
• Notification of events via SMS and e-mail.
• Elementary compilation of "scripts" of the system without writing code.
• Ability to control devices from a smartphone (Android).
• Management through WEB.
• Keeping "logs".

Scenarios


In the process of configuring the controller, you need to consider the following nuance:
The reed switch sends a trigger message when it is open, but we need to close it. Accordingly, in the launch condition of the script, you need to specify not the activation of the sensor, but the deactivation. And not by state, but by change. To alert not repeated cyclically.

Scenario 1 trigger condition: If the Leakage Sensor Channel is turned off.
Script steps:
. Alert "Master, we have a flood!"
. Enable the channel "Valve water close"

And the script to open the valve on a team with a keychain or from a smartphone:
Scenario 2 launch condition: If the Channel “You can open the water valve” is turned on.
Script steps:
. Enable the channel "Water valve open"


In the WEB interface of the cloud service it looks like this:



You do not need to “program” anything for manual control of devices - after adding them to the system, each device control is automatically available from the Personal Account via the WEB interface and from the Android application.

View of the WEB-control panel of the Smart Home via the Internet:



Appearance of Android application



What is the result?


The goal is achieved. When a leakage sensor is triggered, I receive an SMS alert like "Owner, we have a flood!" And the valve automatically closes in less than 30 seconds.
Also, I have the opportunity not to automatically open and close the valve, by pressing buttons on the key fob, from a smartphone or from a browser via the Internet.
The operation of each sensor and device is logged in the log.

At the same time, it was not necessary to write code and self-repetition of this solution is quite accessible for the majority (of course, not counting the installation of valves on the pipes).

Setting up the system, knowing what you want, takes on the strength of 10 minutes. Including sensor and radio relay activation, creation of all scenarios.

It is clear that in the form as it is presented in the photographs, in reality it cannot work for a long time and reliably.
The valve drive power supply unit, the radio relay, and the sensor itself must also be placed in plastic boxes with at least some degree of protection.

Plus, different thoughts are already emerging on the development of the system, for example, duplication of alerts to light signals, periodic “training” of the valve so that it “does not stagnate” and so on. By the way, personally, I have serious doubts about the need for the backup power function of an electro-valve, which some “purchased” anti-leakage kits so boast about.

In other words - the appetite comes with eating.

The good thing is that in order to build up the functionality, you do not need to call "certified" specialists so that they tweak something in the system. All this can be done most easily, thanks to the simplicity of the principles of setting up a universal controller.

A little about prices:


NS-1000 Nanserver - $ 44
The sensor magnetocontact MD-209R - $ 13
Radio relay - $ 10
Valve- $ 15

Total (excluding delivery) = $ 82

Not so cheap. But this is if you do not take into account that the nanserver is used not only for the anti-leakage function. After all, it implements a security and fire alarm system and other features ...



PS


In the process of implementation, having already bought a valve, I discovered that there are electric drives that are installed on conventional ball-cranes with manual control.
An additional and important bonus of this approach - in which case, in a few minutes you can return the manual control valve.
I immediately got sick of cutting in additional stop valves into the water supply system and I ordered such a drive. I am waiting.

Update 2:
While the salt matter, the controller manufacturer announced a leakage sensor.




According to the information , the sensor uses the contactless principle of determining the appearance of water, which in itself is quite unusual. It is also interesting because it is not “sharpened” under the “brand” and can be used not only with the 1M Smart House system, but also with any system operating under the PowerCode protocol. In fact, it transmits a parcel similar to the MD-209R sensor, which I used for my anti-leakage.
The price also seems to be comparable - $ 9.9.

Let's see ...

Source: https://habr.com/ru/post/376023/


All Articles