📜 ⬆️ ⬇️

Smart Home and MySensors: Part 0

In the first part, I talked a little about my experience in creating devices based on the MySensors system. I must admit, the description was not complete - without a beginning and without end.

This time we will be engaged in "beginning", it means it will be Part 0.

Smart House
Strictly speaking, “smart” will be any home that, with the help of automation, makes it easier for its inhabitants to live. And it doesn't matter at all whether electricity, witchcraft or a system of ropes and levers are used.

On the other hand, under the concept of "Smart Home" everyone understands something different. It all started with a desire to automate outdoor blinds. More precisely, with the reluctance to run around the house and manage them separately. I had already chosen and almost bought (relatively) simple timers, but something stopped me. In the end, HomeMatic radio-controlled controllers were installed.
')
Gradually, the system grew. Added control of light, heating, sensors opening windows and doors, humidity, temperature, movement, light. Along with all this, my opinion on what “Smart Home” should do was changing. Well, it's like an appetite that comes with eating.

In my current presentation, the system should be as inconspicuous as possible, should help and support the user, virtually “push buttons” at the very moment at which he would have done it himself.

Of course, the basis of everything is the hardware. But installing sensors and collecting data on their own is a rather boring exercise, much more interesting is their use for implementing various control scenarios.

Simple example: blinds.
It seems that everything is very simple: in the morning to open, in the evening the opposite.
What time? - Best of all, on the basis of outdoor lighting data - calculations depending on the time of year do not take into account weather conditions. And take into account the maximum and minimum time - of course, depending on the day of the week, holidays and the fact of vacation.
And how close is it to close? - In the bedroom I leave a small gap open - so that it is not completely dark.
And if the window is open? - It means not to close completely, for the inflow of fresh air, but for the first floor you need to warn the forgetful inhabitant.
And if it is a balcony and the door is open? - Do not close the blinds at all, so as not to lock the person outside (in my case, the blinds are lowered by 30 cm - as a reminder).
And if it is getting dark outside, but the threshold has not yet been reached, but have the lights been turned on in the room? - Solve again, but according to another threshold of illumination.
And dazzle protection with low-standing sun (depending on the intensity and position of the sun), protection of the room from heat (considering the intensity of the sun and air temperature), on the first floor you can also take into account the sensor movement under the window.

Perhaps you can still come up with many other scenarios, but this is enough to show how many possibilities are hidden in what would seem such a simple thing as blinds.

But at the beginning of everything is still "iron" ...

I roughly divide the entire technical part of the system into actuators (actuators), sensorics and user interface devices (input, output, visualization).

The topic of this article is my first experience with MySensors. There will not be an exhaustive description of the system and its capabilities, they can be found on the home page .

Gateway
No matter what components each specific system consists of, one device is almost always needed — a gateway for communicating with a control computer. No, of course you can do without him, but it will not be particularly interesting.

Naturally, the first thing I collected was the gateway. As always, for starters on the breadboard.

image

Not really neat, but it worked. And even worked in test mode for several weeks (in parallel, I collected a couple more sensors).

The original description is, by the way, here: www.mysensors.org/build/serial_gateway

So, as everything worked very well, I decided to assemble as it should be. For one copy to develop a printed circuit board was too, therefore limited to the standard prototyping of getinaksa.

The concept is very simple.

image

And here is the end result.

image

Well, respectively, "insides":

image

The device was installed permanently and the first prototype of the motion sensor was sunk into the wall in the corridor on the first floor. Everything worked without problems.

The second sensor went to its place on the second floor. And here the problems started. Due to the reinforced concrete ceiling, the reception at the installation site was rather occasional.

Although MySensors devices can be configured to work in repeater mode, this didn’t help me then - I only had two sensors and they didn’t see each other.

All this didn’t really surprise me - the same problems have already arisen in relation to WLAN. For this, an additional WLAN-Router was already on the second floor. Just what you need to connect an Ethernet Gateway (http://www.mysensors.org/build/ethernet_gateway).

I collected it on the basis of ENC28J60, still lying around idle.

image

Unfortunately, this version proved to be not very stable - every day it hung at least once. I sin on the memory leak in the library for ENC28J60. Watchdog was activated as a “solution”. Crude of course, but effective. By the way, I discovered that Bootloader Pro Mini does not support Watchdog. When activated, arduino hung in an infinite, reset-cycle. Fortunately for this there is a simple solution - install Optiboot .

The first prototypes of specific devices
As a conclusion, I would like to show some photos of the prototype devices that preceded the motion sensor described in the first article.

Already at the first acquaintance with the library, it turned out that there are ready-made examples for almost all available sensory modules. And that they are very easy to combine with each other.

Gathered here such a "monster".

image

There are temperature sensors, humidity (by the way, do not use DHT11 - the last shit, take DHT22), movement, light and distance. Worked without problems. With relay it was also easy, but I quickly disassembled it as superfluous.

I wanted to do something really useful. And so, as most of all I lack the motion sensors, it began with them.

image

Collected almost from "pasture".

image

image

image

image

image

At this point today. Oh yes, my source can be found here: github.com/hexenmeister/MySensors_MyDevices

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


All Articles