How to make a smart home

I constantly have a question about what to do with the next smart home or the next automation, which sensor to buy or which device, and it seems that almost everything that can be done has already been done, there is Zigbee, there is Wi-Fi, there is Z-wave, there is a new Matter format, but in general, for all time I have already concluded that something new appears every year. Five years ago, when I started building a smart home, the sensors themselves, which can now be bought for 500 rubles, were very expensive and, accordingly, it was unclear which was better, to buy branded expensive sensors or to do the job myself, Moreover, even branded ones were mainly Xiaomi, Tuya were still not so developed and popular, and other sensors were generally unavailable.

As an option, of course, I first started doing everything on Arduino, I bought my first board and started buying the cheapest sensors, these are temperature and humidity sensors, I tried to do some automation on them, do some parameter collection, and after that I also bought more relays that were also connected to Arduino, studied the option of working at a radio frequency of 433 megahertz, and it was quite interesting, you could try to connect, for example, smart sockets that also worked at a radio frequency, they were controlled from a remote control or it was possible to transmit commands from the smart home system via a transmitter and turn them on, but there was always a problem with them that there was no feedback and it was necessary to understand in some alternative way whether they were working, whether they turned on or not, and it was not even possible to buy any switches, because those that are currently on sale were not available, they were not available, and I also bought wireless switches that operated at 433MHz.

Then the esp8266 microcontroller board appeared, but of course it was there before, but I got my hands on it, it began to be supported in the ArduinoIDE programming environment, and in general, it was possible to normally understand how Arduino works, do the same on this microcontroller, of course, its advantage is that it works with Wi-FiFi directly, that is, you do not need to buy any additional modules. Previously, these boards were used, they were called ESP-01, they were used mainly as a defective control board, not a full-fledged microcontroller, but simply as a Wi-Fi transmitter, it was connected to an Arduino and it was possible to connect to Wi-Fi through this transmitter and connect to a smart home.

Then, when we already learned how to program them and a normal environment appeared, I already tried to do a lot on it, I also bought more relays that come in one ESP-01 shield and even have an ESP-01, which generally has only four useful outputs, it was already possible to do some kind of automation. but when a full-fledged esp8266 board appeared, which already has quite a lot of legs, it's about 12 that can be used, then it was already possible to try some other use cases, for example, I connected this board to all kinds of digital displays, output information, I tried to make a smart home system based on this board, that is, how to use the server so that data is stored on it, well, of course, not accumulatively, because there is not enough memory, but at least the last value could be saved, I made the option so that the dashboard, a website in fact, to which it was possible to connect, and it showed data from the microcontroller itself without an Internet connection, all the latest current values, and it was also possible to control the values on this microcontroller through this website, and accordingly, he sent an on or off signal to the house system or to a specific control device.

Of course, I also used a Raspberry in parallel, by that time I had already bought it and started studying and using it, but I did not deploy any smart home systems, the only first system I started using was the OpenHAB system, which was still version 2, it did not allow very much in terms of joins or integration, but at least it worked quite stably and it was also possible to do automation on it, output sensors, connect to this system, and in principle it was possible to make a dashboard, or even a management page, so to speak, there was also an option to make a dashboard, the HABpanel module was called, on which you could visually make different pages, so to speak dashboards, on which you could turn on and off all kinds of devices, display sensor values, and in general it was very convenient to use it as a dashboard, the data on it was updated very quickly, but OpenHAB itself initially I always worked through the cloud, which was, of course, a significant plus in relation to all other smart home system options.

But the esp8266 board itself and, in principle, its further development had already appeared by that time, it was an ESP32, they were not very reliable, they worked at a Wi-Fi frequency of 2.4 Ghz, the range itself was very busy, and these controllers lost communication all the time, and the protocol itself was not correct enough, it worked with some errors and the router I could lose contact with this microcontroller and not restore it, and even now, when I use it, it constantly prevents me from making any decisions on this microcontroller, for example, I had a CO2 sensor that I connected to this esp8266 microcontroller, but he periodically lost contact with the smart home system, with Wi-Fi, and I had to reconnect him every time, monitor his condition, his connection, which of course is not very convenient, and even if he switched, he did it very often, and sometimes the data did not come, also I have on the basis of this microcontroller. the gateway to the 433 megahertz radio frequency is still working, but the connection is also lost periodically, of course, it is restored quickly enough, but it can switch several times per minute or every minute, and at some moments it happens that when you press, for example, on a wireless switch, the signal does not go through, and of course these constant errors are certainly inconvenient.

Then another solution appeared, it was also quite popular before that, and it was tried a lot, but I also got my hands on this technology, this is NRF technology, it's also on the 2.4GHz radio frequency, in principle, there are a lot of devices on this part, because the frequency itself is free to use, and Bluetooth on this These transmitters that appeared at this frequency of 2.4 GHz also work, they were also a very interesting solution, they were used precisely as a transmitter, that is, they were not fully programmed on this microcontroller, but it could be used as a transmitter. I also bought several such boards and tried to make a connection between a Raspberry and one of the devices, but in general, the technology itself may even be interesting. It supports quite long data transmission packets, it has the ability to monitor the transmission quality, that is, if the signal did not pass, then the board itself could repeat several times. and the connection itself can work reliably enough, this technology is the same as that of Zigbee, and you could even try to make some kind of mesh network, I tried when one device receives information from others and can also relay this information further to the server, but this board had a big problem, very high sensitivity to power, I even bought 3.3V stabilizers separately, but in principle it also did not help, and I very quickly abandoned this idea. More recently, an Arduino board has appeared, which is integrated with this NRF chip and you can transfer information using this protocol directly from the Arduino with a special library, but this Arduino also lacks stability, even though everything is powered by a single board and all the necessary power bindings are made on the board, but it still takes a signal. it's very bad, and already in another room he starts to disappear and sometimes the information doesn't go through.

But even then Zigbee solutions appeared and became very available, wireless switches on Zigbee began to appear, wired switches on Zigbee began to appear, and it was much easier to switch to using this format, there were no sticks at first and it was necessary to buy gateways, but then they became available, the technology of flashing them And the settings have also become quite accessible and have already started using Zigbee as the main protocol for a smart home.

Automation in a smart home should be useful and create additional comfort, but sometimes everything goes wrong… The reasons for this, and how to configure everything, see on my channel.

You may also watch

Article By Alex

If you have any ideas on how to improve automation, make it more reliable, fast and useful, then you can leave a comment below. I will try to implement the proposals and tell you in the following videos.