📜 ⬆️ ⬇️

Smart home architecture - with Black Swift and not only

Hi, Habr!

If earlier we looked at the projects of the “smart home” with interest, but somewhat from the outside, now, after Black Swift entered the public field, we ourselves began to receive questions and suggestions on using it as a base for the “smart home” - and of course I could not help but pay special attention to this topic.

The result upset me, and I would like to talk about it.
')
Projects of the “smart home” are now born (and dying) like mushrooms - but, unfortunately, in most cases they are not due to the awareness of the shortcomings of existing solutions, but by the very fact that there are technological platforms on which something can be built. This is clearly seen by Habr: as one or another solution is popularized, a wave of next “wireless sockets” on it passes. So it was with the NRF24LE1, now the same wave is coming from the ESP8266. Some promising projects in their life have time to change two or three platforms - depending on the current fashion and the presence of someone who can solder something on one of them.

All this is often too similar to finding lost keys where it is lighter, as well as hammering screws with a hammer simply because there were a hammer and screws at hand at the same time.

I will not touch any serious problems of “smart houses”, but I will talk about why and what technologies should be considered as a basis - not to explain in the comments for the fiftieth time why I do not consider embedding Wi-Fi in each outlet Neither necessary nor reasonable decision.

Oh yeah, I almost forgot KDPV. Here is:



It is not about “smart home”, but about the fact that Black Swift can be found on the MWC at the stand of Imagination Technologies. And now let's talk about “smart home”.

The natural aspiration of a person who saw Black Swift, EL-M150, ESP8266 for the first time in his life, or some other similar solution, is to shove him everywhere. After all, it would seem that it is simpler - since in any smartphone there is Wi-Fi, then by connecting all the lights, sockets and switches to Wi-Fi in the house, we will get that “smart home”, which for many looks like a smartphone application that allows flashing light bulb in the chandelier. About the same fate befalls and Bluetooth-modules, albeit with a lower frequency.

It turns out this is about the scheme:



However, it quickly becomes obvious that it does not solve the task of creating a “smart home” because all this set of devices does not have a unifying element - they just got access to the network. Unfortunately, for some reason, the user does not want to memorize the IP addresses of all twenty-three light bulbs in his apartment, and what to do on this network to the remotes is completely incomprehensible.

Technically, you can build a distributed system in which the devices themselves will detect each other and learn about each other’s status and capabilities, and the smartphone application will also get information about all the devices currently available from the network and show them in a beautiful interface. It is tempting, flexible, but difficult - especially if questions start that it would be nice to have access from the outside, and a browser-based web interface ...

Therefore, a central controller appears in the system in a natural way, on which all existing devices are registered, and it already provides a web interface, scripts, and command transmission between devices, and women with games of chance:



Stop! But after all, we used Wi-Fi to bring all the devices into an accessible and understandable data transfer medium in one step - and in this scheme it is already more than one step, because access to Wi-Fi sockets and a kettle does not play any more role for anyone except the central controller. That is, Wi-Fi begins to lose its main advantage.

At the same time, Wi-Fi has quite serious drawbacks:



In general, you can continue, but it is already quite obvious that Wi-Fi in such a scheme becomes a strange choice for intra-system communication. And all of them, in general, grow from the fact that Wi-Fi is a network designed for the constant presence of devices in it and large amounts of transmitted data. It was never designed by anyone, taking into account the peculiarities of the operation of the light switch, which needs to be transmitted three bytes ten times a day.

At the same time, it cannot be said that there are no other radio frequency solutions - firstly, the NRF24LE1 mode, operating in the 2.4 GHz band, arrived and passed not so long ago. I must say at once that we tried them in the role we were discussing and almost instantly became disillusioned - the range of stable communication in real conditions is regrettable for them. Secondly, there is simply a bunch of classics on the 433.92 and 868 MHz bands - the same TI CC1101 or single-chip solutions of the type CC430F6137, having both a radio frequency module and a processor core. In these bands, a license for using transmitters up to 10 mW is not needed, these solutions are quite good with the communication range, and the only drawback is the antenna dimensions — a quarter of the wavelength for 433.92 MHz is still 16.5 cm. These solutions are easily purchased both in the form of modules and in the form of the chips themselves.

Everything is good with them and with efficiency - we do not need constant maintenance of the presence on the air with such systems (moreover, at 868 MHz there are legal restrictions), and in a dream they consume a maximum of a unit of microamps, waking up only for data transmission. Accordingly, for the control panel immediately become a reality 1-2 years of work on the CR2032.

But at the same time, there is a place for Wi-Fi - you just need to understand exactly where it is:



So, we have a central controller that provides the logic of the system and the interface to the outside world - Wi-Fi or Ethernet (obviously, connected to a Wi-Fi router). It has a wired and / or wireless interface for communicating with the subordinate elements of the “smart home” - a specific choice is determined by specific conditions, although if you get into a slightly different topic, the wireless interface has a great advantage: it does not require repairs to be installed. No, as long as you are focusing on the traditional Russian market of "elite assemblers", taking from 300 thousand rubles for only one project of a "smart home" for a two-room shop on Biryulyovo-commodity, this is not a problem. But as soon as you want to enter a more massive segment, or, God forbid, the B2B market, customer persuasion for overhaul may not be so easy.

Moreover, although in principle such a controller can be built a lot on what, using Black Swift provides compactness - in the case of, for example, one wireless interface, all electronics easily retract into a DIN-rail housing the size of a standard RCD 35.5 mm wide.

Executive devices in such a scheme are simple and cheap, and most importantly - they provide you with clear communication quality and power consumption, which makes normal battery power possible (less than a year of work, I insistently ask you not to consider normal power). And the kopek microcontroller in them (integrated with the radio module or separate, the same PIC) fully provides all their capabilities, because no complex network protocols from a dimmer or wall switch are required.

At the same time, it is not necessary to completely eliminate Wi-Fi from communications within the system - you just need to understand when you need it. Let's say we want to integrate there any household appliances or climatic equipment, which has a number of features:



In this case, there is no practical sense to unambiguously bind to a specific specific radio interface - it is easier to put powerful “brains” inside with Wi-Fi, as a result of which the equipment can be used as part of various “smart houses” or without it.

At the same time, notice that I didn’t have a box labeled “flat” around the whole block diagram - in practice it can be used on different scales from the room (each room has its own controller, while due to its dimensions it can fit in the standard 68- mm socket socket) to a large cottage, it all depends on the specific requirements of a particular project. The system is easily scaled to large buildings - put several controllers in different parts of the building, the benefit is not KNX with its $ 3k per box, and let them communicate with themselves via normal Ethernet or Wi-Fi, the benefit of the brains in them for such communication more than enough.

However, I already went to talk about other topics related to the “smart home”, but traditionally forgotten in the vast majority of projects - scalability, integration into the system of various equipment, different levels of management ... In 99 projects out of 100, alas, the authors do not even try think in scale larger than your own apartment.

But this is the next stage. In the meantime, please stop trying to shove every Wi-Fi or Bluetooth light bulb into each outlet. They are not needed there. And do not hammer in the screws.

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


All Articles