Home automation systems. Smart home system

Improving your home and making it more comfortable is common to any person. Regardless of whether he lives in a small studio apartment or in country house several floors which are surrounded by hectares of private land.

Modern technologies make it possible to create fully automated houses and transfer many functions for managing life support systems to automated devices, and in some cases, completely automate processes when human intervention is not required at all.


What is the difference between home automation and a smart home?

Many property owners consider any automatic or semi-automatic device that performs the functions of turning on/off any device or is considered an element of a “smart home”. This is far from true. And even the possibility remote control using individual functions using the Internet does not make the house “smart”.

A truly “smart” home is a comprehensive intelligent automation of control of the entire complex of life support systems based on the artificial intelligence of a computerized control system and operating in a completely autonomous mode. Human intervention is required only when emergency situations or in the programming process.

Therefore, numerous companies that install home automation elements do not always objectively and reliably convey the meaning of innovations to the potential user-customer.

It is not always explained that the vast majority of electrical appliances included in a “smart home” do not need automation, since they already have built-in functions:

  • Refrigerators are fully automatic devices that operate according to a strict program;
  • Air conditioners do not require outside intervention to maintain a set temperature;
  • Washing machines have a delayed start timer;
  • Lighting on/off systems are easily controlled by relays with photodiodes that respond to light levels and so on.

The creation of specialized channels for controlling life support systems—the “smart home” itself—is only necessary in cases where the living space operates in a completely autonomous mode. These include country houses(cottages), where the only benefit of civilization is an access road.

It is in them that all the advantages of remote control and monitoring can be fully realized.


Apartment automation

An apartment in an apartment building is just a cell included in a well-functioning system utilities buildings. She rarely needs the full operation of smart home automation equipment. The owner does not have to worry about heating, lighting, or ventilation. The water supply system, in general, is beyond the ability to influence its availability in any way. In the event of a shutdown of hot water supply for the period of preventive repairs, those who have the financial means install storage or flow-through boilers that operate in automatic mode and do not need outside management.

Any arbitrary interference with one’s own hands in the operation of communal life support networks is completely unwelcome by management companies. Therefore, it is possible to implement the concept of a “smart home” in an apartment building on a very limited scale:

  • Install several remotely controlled sockets to which to connect devices, a timer to turn on/off lighting, or an old-fashioned iron that does not have a shutdown relay for overheating or time, or other non-automatic electrical appliance.
  • Forcibly interfere with the operation of an automatic air conditioner or electric heated floor by completely turning them off, or, on the contrary, turning them on.
  • Automate closing/opening curtains or blinds on windows.
  • Turn on/off the audiovisual control system.
Attention! With the installation of hidden video cameras or microphones, even in own home you need to be extremely careful. All devices, without exception, that do not have a sensor indicating operation, or that are disguised as other objects in the Russian Federation are prohibited for use. Their acquisition is already a crime, which in the most unfavorable case can result in a real prison term.

Therefore, when selecting components to equip your home (apartment), remember that the vast majority of Chinese-made gadgets are prohibited for sale on the territory of the Russian Federation, and their possession is a criminal offense.

Security and fire alarm are usually not included in the list of elements of a “smart home”, since they work regardless of the owner’s wishes while in the on state. And when they are turned off, they lose any meaning.


Automation of a private home

Majority country houses are built within designated areas for individual housing construction and, according to the requirements of landscaping, have an electrical and gas supply. Some villages are more comfortable and have central water supply and sewerage systems.

All this makes it easier to maintain suburban real estate, without completely freeing you from the worry of maintaining comfortable conditions indoors and outdoors.

Private house can be fully equipped with an intelligent control system according to the “smart home” concept.

Even at the design stage, automation elements related to:

  1. With power supply (from an autonomous electric generator).
  2. Temperature regulation by controlling a gas/liquid fuel water heating boiler.
  3. Control of the water supply system (for borehole/well water supply).
  4. Air temperature control system various rooms(residential, utility, economic).
  5. A system for regulating indoor and outdoor lighting of a personal plot.
  6. Management of irrigation and feeding systems for farm animals.
  7. A system of visual monitoring inside and outside the premises and viewing the local area.
  8. It is possible to implement emergency shutdown of gas and electricity supply systems in the event of emergency situations.

For some owners who are away from home most of the time, a “smart home” is a home automation system that is an urgent need.


Choosing a smart home control system

Modern systems allow you to control electrical devices connected to the control module: sensors, thermostats, electric valves using wireless technologies. There is no need to lay wires and cables inside the walls or baseboards of the room, to trench walls and disrupt existing communications or decoration.

The most common is the control path via Wi-Fi channel. The inconvenience is that this function is designed to transmit significant amounts of information and is not adapted for most smart home devices that work with short commands: “turn on/off”, “add/decrease”, “up/down”, etc.

  • Z-Wave– a specialized smart home control protocol operating at a frequency of 869 MHz and having high protection from outside influences and interference.
  • ZigBee– a similar specialized protocol, specifically designed for the operation of devices in a smart home kit, but using a different frequency of 2400–2485 MHz.

Until now, widespread automation of residential buildings in the Russian Federation is stalled due to high prices for equipment and installation, adjustment and maintenance of equipment. After all, it must work around the clock, 24 hours a week without any failures. Otherwise, faulty smart home equipment can itself become a source of emergencies - fire, flooding of the premises, defrosting of heating systems.

First of all, the economic effect of introducing automation systems is calculated. To roughly estimate the efficiency and payback period of investments, it would be useful to re-read the instructions for the electrical appliances in the house. Most owners use only the basic, most common functions, without bothering to program the full functionality of a TV, air conditioner or water heating boiler.

It is quite possible that the “new” opportunities that seem to you, which will open up after installing the “smart home” system, have already been incorporated and implemented in your existing equipment, and moreover. high level than “turn on/off” or “add/decrease”.

Calculate whether the ability to remotely adjust the air temperature in different rooms is so critical? This function pays off only for owners of country houses, when during the absence of the owners the temperature drops to an acceptable minimum, and by the time the owners arrive it rises to a comfortable residential temperature.

Most of the functions implemented in a “smart home” are interesting only for the first time after their installation. The possibility of remote visual control satisfies only the curiosity of the owner of the premises, without in any way interfering with the actions of intruders who have entered the house. Much more efficient system centralized security. Using the automatic opening/closing function of curtains in the bedroom or the ability to adjust the volume of music in the next room is so questionable that it may only be of interest to true fans of continuous communication with a mobile device, instead of physical movement of the hand.

Probably because the functionality offered within a smart home is small and irrelevant for most, home automation is not particularly popular.

The smart home system is designed for maximum comfort in an apartment or private house. Full or partial automation of the house will allow you to forget about large bills for electricity and heating, make household appliances work without the participation of the owner and increase the efficiency of the security system. The ability to control the entire house from one panel or even remotely guarantees comfort in your home. When returning home, you can be sure that the room is warm, hot bath, and the robot vacuum cleaner cleaned without reminders. All these and many other functions are available in the smart home system.

Automation capabilities

A unique home automation system allows not only achieve comfort, but also save costs on public utilities. The light turns on only when a person appears, and the heating works at full power only at a programmed time or in the presence of the owner - this is not all that a “smart home” can do.

Main advantages of automation:

  1. The room will always have a microclimate that is ideal for the homeowner. Air temperature, humidity and other parameters are maintained constantly or adjusted in each room at a certain time. This allows you to forget about discomfort after waking up or irritation upon returning from work.
  2. Every object is under control, and you can even control it from long distance. By customizing the system for yourself, you can get hot coffee and toast in the morning without any effort, enjoy the sauna immediately after returning from work without waiting for it to heat up, and heat the water in the pool without leaving home.
  3. If any malfunction occurs, the system will not allow the object to turn on and will send data about the breakdown to the owner. This avoids short circuits and other troubles.

The constantly improving production process allows you to install the system in a house or apartment without major repairs. The entire wiring system will now be replaced by switches with radio sensors, which transmit information to the control center.

Costs for the smart home system

You can install a smart home system in any room: in an apartment, in a country house, in a private house or even in an office. By automating the place where you need to be most often, you can save a lot of time and not be distracted from important matters by small things, like making coffee.

Costs depend on many factors:

  • type of system and equipment used;
  • way to control a “smart home”;
  • the number of household appliances and other features of the premises;
  • housing area and the presence of local area.

It is logical that automation of a private house will cost its owner much more than installing a system in small apartment. This is due to the fact that your home often contains more equipment, and the heating system is individual.

Additional costs associated with maintenance of the local area:

  • video surveillance is often necessary; security extends not only to front door and windows, and over the entire area of ​​the site;
  • garden care and watering of plants are required;
  • a bathhouse or swimming pool connected to the system also requires additional costs.

Automation has more advantages, and all expenses are recouped by small bills from resource supply organizations and saving time that can be spent doing what you love.

What are the expenses?

The cost of the finished system depends on the capabilities and imagination of the home owner. The final price consists of the following:

  1. The cost of the selected equipment. People's needs for home and office automation are constantly increasing, so manufacturers are trying to develop and release new products. The owner of a house or apartment must initially decide whether he will be satisfied with not the most modern, but budget equipment or would you like to furnish your home according to last word technology.
  2. Ready-made system model or individual selection. Ready-made systems include a limited range of capabilities that are needed in each room. If you want to automate your house down to the smallest detail, you will need individual design, for which you will have to pay extra.
  3. Installation of equipment. Older and cheaper options require cable installation, so it is better to install them during the renovation process. Otherwise, after automation at home you will have to re-glue the wallpaper. Modern equipment operates using radio transmitters and does not require cable installation.
  4. Installation software. The difficulty depends on the chosen control method. Budget options, controlled using different remote controls, are not as expensive as ensuring your comfort with a single touch panel or via a computer.

It is also possible additional costs related to non-standard placement utility networks, which will have to be bypassed during the installation process.

A simple smart home option allows for independent installation, and the costs will be significantly lower. This option has one drawback - it will not be able to control all processes in the house, but only the main ones: light, heating, closing curtains at night. This is a minimum set; some manufacturers offer a wider range. Turnkey installation requires confidence in your skills, attentiveness and accuracy, therefore, if there is the slightest doubt about the result, you should entrust the work to specialists.

The result of automation

Automation of your house or apartment will allow free up a lot of time, do not be distracted by household chores and enjoy complete rest after work. The costs required to purchase and install equipment will quickly be recouped by a significantly reduced amount in bills. Own comfort and confidence that all equipment, lighting and heating devices They work exclusively in accordance with the wishes of the owner and will not allow you to doubt the correctness of the decision made.

The main reason that home automation systems have not yet become so popular is the emphasis on lighting that is usually placed when promoting them. After all, flashing lights (like LEDs on Arduino) without getting up from the couch is pampering, which has no practical significance and pushes people away from serious thoughts about implementing and using home automation systems in their homes and apartments. Nobody needs to blink the light (which is usually what 90% of the functionality is for), but for example, controlling the heating individually in each room is convenient and saves energy = money. Sky-high prices for the components of ready-made home automation systems for sale, together with the prices for their integration, only add fuel to the fire. I hasten to assure you that the most expensive component we will have is the 20 dollar Arduino Mega. If we consider the issue as a whole, I see only the following list of tasks that make practical sense to automate centrally:
> climate control temperature (heating/air conditioning) and humidity (humidifier/dehumidifier),
> control of natural light (blinds, shutters, awnings)
> and management of watering of lawns, flower beds and lawns around the house (if there are any and they still need to be watered).
Of the decentralized systems, it is convenient to have a local (without central control, 1-2 sensors that directly control the backlight) triggered by motion (presence) sensors, low-power LED backlight stairs (sometimes floors) and parts of tables in the kitchen that are shaded from conventional ceiling lighting wall cabinets and shelves. This same illumination, in combination with those listed above, is indispensable at night when you need, without waking up anyone, and especially yourself, to get into the kitchen (and cut something off there and eat without sharing with anyone) or to another establishment without stumbling about thoughtfully scattered children's toys. It also makes sense to turn on the main lighting with motion sensors ONLY in technical rooms: closets, storage rooms, garage, laundry rooms, etc. Motion sensors and centralized systems not practical to use for basic lighting in residential areas. External and decorative holiday lighting at home is most conveniently turned on from cheap ready-made units with lighting sensors and/or timers. Real security systems connected to response services (not just sensors and web cameras scattered around the house) usually do not make sense to mix with smart home systems for many reasons.

So let's start with the most relevant. The ideal object is heating that can be controlled, for example: electric (batteries on wheels in a socket and wall batteries) and centralized or not very heating of a private house. In my example, we will consider working with the Thermo Pump system (Heat Pump in North America) with oil heating via direct connection to the existing Control Unit (thermostat) and additional devices. In the first version of the system, I used X10 protocol devices and sockets. But unfortunately, they performed poorly, due to the slow interface and very loud clicks when switching, which woke up everyone at home. Subsequently, I converted the system to radio sockets, which turned out to be much simpler and quieter than x10. These outlets are available in a huge range of radio frequencies and voltages. All this is applicable to a huge variety of other systems. It all started when my friend and my neighbor unobtrusively dripped water on my head. huge role miracle of the wonderful - Arduino in modern society and that I, as a person who knows how and loves to hold a soldering iron, am simply obliged to become infected with this Arduino mania as soon as possible. I brushed it off in every possible way and said that the area of ​​​​practical (not robotic toys) application of her home is very doubtful and making sequentially lit LED strips for illuminating the steps of a staircase based on a powerful microcontroller (instead of one shift register and generator) is just a cannon and the rest is self-indulgence . But still, they managed to plant the seed of Arduino in my head and, like all seeds, with the arrival of spring and the approach of summer, a sprout began to break through. I don't like hobby projects for the sake of projects themselves. Some practical side must be present, especially since resource ($ and time) intensive projects for family man must also have a high WAF (Wife acceptance factor) or, as my Dad says, it can be easily legalized.

And as always, laziness was the engine of progress. We sat a little after noon on the veranda, the sun was pleasantly hot, and at the same time our little son was sleeping in the bedroom on the top floor, and judging by the Chinese thermometer for 2 dollars (which we still had to get to and look at without waking up our son) the temperature was over 26. So now we need to go into the living room and turn on the central air conditioning, and then we also need to turn it off so that it doesn’t turn on every time the temperature rises a little. It’s especially unpleasant to do this at night in the summer; when you’re frozen under a light blanket, you have to jump up and, again, without waking up everyone in the household, run into the living room to the remote control and turn off this achievement of the last century. That’s when I realized that it was time to stop such disgrace and call a friend with the words “Where is your vaunted Ardunya, Give her here now, we’ll see what she’s capable of!” I’ll say right away that I didn’t choose it at all and didn’t think that it would turn out to be so useless (for example, in working with strings) and even out of anger and powerlessness to fight it, I almost moved to STM32 in the middle of the project. In the end, he still stayed with her, but first things first.

To make it easier to understand why everything was done this way and how you can spread my experience and achievements on your bread, let’s start with a description of what I have/had at hand:
1) A private house in Canada (I would like to say that it is mine, but of course it belongs to the bank and no matter how absurd it may sound, having it fully paid off at current rates is not even profitable) built in 1959, as they call them here, Split Level those house It's two stories high, but half of it is shifted vertically relative to the other half by half a floor.
2) Arduino Uno(later, due to the small number of I/O for X10 and radio, Mega was required)
3) expensive and native Ethernet Shield. I was unable to launch something and find an adequate library for the ENC28J60
4) Desire, time and some money.
As is customary here, the bedrooms are on the top floor and for me it turns out to be half a floor above the living room where the ominous control panel for the heating and cooling system is located, screwed to the wall. Here such systems are called HVAC (heating, ventilation, and air conditioning) but in fact it is an ordinary huge (tens of thousands of BTUs or they measure them here in tons of something) split air conditioner with an external heat exchanger and compressor located on the street and inside the heat exchanger is built into a central ventilation system, which with a one and a half kilowatt fan takes air from the floor level of the living room and drives it through two heat exchangers (one to the air conditioner, the other from the fuel oil or gas burner) and drives it through a system of boxes into each room. The convenience and the very name of the heat pump is due to the fact that this device can drive freon in both directions and, accordingly, not only cool but also heat the air in the house. It should be noted that it can heat it more or less efficiently only if it is warm enough outside, more than 0 or -5 (depending on the model and design). If it’s cold, the heat pump won’t work, and that’s exactly what a tank of fuel oil or gas is needed for.

I started my project and ambitions small, so let’s figure out how this HVAC is made and how to control it. In fact, it turns out that the devil is not so scary. One of the conveniences is the liquid standardization of everything domestic and not very much in America, this allows you to cross hedgehogs with snakes according to an open, simple (sometimes too) and well-known (usually ancient, common) protocol/standard. In our case, the system itself (burner fan, heat exchangers can be bought from one manufacturer, air conditioner from a second, a humidifier from a third, and the Control Unit for all of this from a fourth. To be honest, I don’t know if similar devices are also called/controlled in Europe, but I think that everything is either licked or very similar As far as I understand, such systems already exist in Russia and they are transported anywhere/cheaper, so you have a high chance of encountering just such a system. Let's look at the diagram of a typical system connection before we start getting into the system.

As we see, almost everything is clear at first glance. The only thing that needs to be clarified is that the control unit is powered and the heat pump itself is controlled by 24 volts. which are supplied from the input transformer R and C. Line C is common and is always connected. Accordingly, when R (short circuit) is applied to Y, O, W or G, the corresponding one is turned on. block. We will build on this. So if they include it, then why are we worse? Let's make it ours new system will complement the existing one. Those controls can be carried out from the old remote control and controller as before, but only when necessary, Arduino can turn off old system from the control and take the furrows into your own hands and then give them back. We install the relays.


Moreover, we place them so that without power and generally disconnected, they retain the same design. R-0 disables the standard control module and transfers control to our Arduino. R-1-4 served required voltage to the appropriate line. This control voltage R is supplied to each relay green wire. Of course, it’s good to control, but the system is serious and if we accidentally or not turn on something wrong or in the wrong combination. For example, the heat exchanger will heat up and the fan will not circulate air and remove heat from it; it can overheat and lead to a fire, but we don’t need this at all. To avoid such situations, let's make triple protection. And so the first bastion will be voltage sensors on each line S1-4 (there should be 4 of them).


They consist of a diode, two resistors (divider) and a small electrolyte. This could be a hinged assembly like in the photo. As a result, we can use Arduino to know whether there is actually voltage on each of the control lines or not. Accordingly, if the current state of the control lines (Y, O, W, G) does not correspond to what it should be, we display an error code and turn off the system. The next bastion is our additional temperature sensor in the heat exchanger chamber (plenum sensor). If it is too hot or cold there (close to 0C), then we again display the code and turn off the system. Obviously, it is impossible to power the relay directly from the Arduino outputs, so you must either pile a transistor on each relay or buy a ready-made module with several relays and transistors on one board. I buy 99% of my components on eBay. For example, eBay is full of these 8 channel modules (8 Channel Electronic Relay Module) for about $9. or you can buy 4+2 (since in fact we only need 5 and one spare)

I used Chinese digital DHT22 as temperature and humidity sensors which have proven themselves well. They only need three wires +5, GNd and Data. The wires can be long enough without loss of accuracy and signal. One sensor is thrown outside into the shade and under a canopy from direct hit moisture. One sensor in the house.
In a house that's been built many years ago, the biggest challenge is usually running new wires, so I tried to make the most of the current wiring. There are several libraries for DHT22. I had problems with all of them except this one. I placed the internal DHT22 next to the wall control panel. If your house, like mine, once had an HVAC control system, then you should have a 6-wire cable running from the control unit to the place where the remote control with the indicator and buttons hangs. Modern remote controls (like mine) require only 2 wires. Thus, we have 4 already laid wires at our disposal. In them we run +5V, GND, Data for the internal DHT22 and to the last Serial(UART) Tx from Arduino to display information on the display.

As a display, I used a small (2.5 cm) OLED screen with a serial interface.
YES, it is a little expensive, but there are several unique differences from similar ones available: The presence of a Serial (UART) interface, which allows you to use only one wire to connect it, the presence of five digital pins on the screen controller (where we will connect an RGB LED to additionally display the system status) and finally, compactness combined with contrast and excellent readability both in bright light and at night, and it does not illuminate the entire corridor at night like any LCD with the backlight constantly on.

Next, the problem arose of how to place temperature sensors in each room, without additional wires, power and radio modules. As a sensor, I chose a digital DS18B20, (having good accuracy +- 0.5C) which requires only two wires (ground and signal). You can hang many of them in parallel on these 2 wires (each has its own unique MAC address). But even stretching two wires in all rooms is hellish work. Then it dawned on me. After all, a telephone cable is laid in all rooms and it is 4-core and in the best case, 2 wires are used for the telephone (usually red and green) and the rest (yellow and black) go through all the places I need and remain free. Thus, without cutting the wires, but only exposing the necessary two, I soldered DS18B20 to them in each room.
The total length of the wires turned out to be quite large, and if the signal wire was supported (at +5V) with the recommended 4.7 kOhm, then in my case the sensors were practically unreadable and I reduced the supporting resistance by half to 2.3 kOhm and everything worked fine.

Then I got confused with the pressure sensor and settled on the expensive BMP085 but it has an I2C interface, which again saves legs and the number of wires. Since it can still read the temperature, I placed it in the basement, where it was closest and easiest to pull new wires (as many as 4). I tried to use standard telephone cables and connectors (RJ11) as much as possible so that the design was disassembled and repairable - suitable for replacement.
When connecting this barometer to the same I2C bus as the RTC (non-volatile clock module), some not very clear problems arose. They interfered with each other and until I set a short delay before reading the barometer, everything worked unstable. Since short temporary power outages are not that uncommon, and the RTC module It costs a penny, I added it for non-volatile time. mainly needed when using x10. Using it, I wanted to automatically synchronize it with NTP via the Internet (since we already have it), but somehow I couldn’t cross the webduino server and NTP. As a result, the NTP time (Unix epoch) is sent to the Arduino (and updated by the RTC) every time any settings or modes are changed in the web interface. Which has its drawbacks since it is taken by JavaScript from the time on the current computer or mobile device and is not always accurate and in the correct time zone.

I send commands to my Arduino radio sockets on the air using a penny ($2) transmitter module. There are a dime a dozen of them on eBay (search for “RF transmitter 315 Mhz..”) and in any store. The only thing you need to do is choose the right radio frequency that matches your outlets. Unfortunately, my sockets were not supported correctly by the standard RCswitch library. in the library description there is a list of supported chips, but don’t be upset if yours is not on the list, it worked for me after analyzing the ether manually and without the library. Much has been written about similar sockets and working with the library. In particular here: http://habrahabr.ru/post/213425 http://habrahabr.ru/post/212215 I used 110V sockets
. Despite the fact that radio control requires a non-standard solution, it is the simplest and budget solution task at hand. Namely, turn on and off electric batteries or any other device (not necessarily resistive) by time or manually and sometimes turn on and off the outside lights. Insteon, Zwave and others have many sometimes unnecessary additional functions but they are an order of magnitude more expensive and have problems with the openness of the interface so that Arduino can send simple commands to devices. The only problem with the x10, Insteon and other outlets is that they click very loudly when switching. This is especially annoying on a quiet night. One more nuance: x10 was sharpened and popular in North America and accordingly under 110 Volts. Here everyone chooses for themselves. Or pay a lot for:
Z-Wave - there are no ready-made sockets, there are strangely shaped relay modules that also click but are quieter and they have to be hidden somewhere, somehow in the walls, then walled up, it is not clear how to service them - change/repair them. But USB modules appeared for sending commands. But for this you still need a microcomputer (maybe a router will do) with the correct OS drivers, etc.;
Insteon - there are sockets, but they also click disgustingly like x10 and, as far as I understand, there is no open module for sending commands and the system is again designed for 110V;
It's up to you to bother with integration and sending commands to this network or to pay 5-10 times less for each radio device and, if necessary, tweak the code for it. Like any other thing, everything for 110V costs less. Of course, there are also extreme ways, such as the idea described by several authors here, the idea of ​​entangling the entire apartment (house) with a pair (and in fact a bundle) of hammer wires and manually assembling each control and controlled device from scratch using the 1-Wire protocol. Some have gone even further and are developing their own protocols...

Also, as a kiter, I screwed on an anemometer (wind speed sensor). To measure it, I used a cup sensor I had on hand with a reed switch closing 1 kOhm between two contacts when the cups rotated. The program uses an interrupt and measures the number of times +5V is applied (transition from 0 to 1) to the digital input (connected to 5 kOhms at the same +5V). This value multiplied by a coefficient suitable for your sensor and the wind speed in knots is obtained from the number of short circuits in one second. Also, for each hour the maximum and minimum value speed (gusts) and the maximum per hour is displayed. The web displays the current and maximum. Each sensor must be calibrated individually and the correct coefficient must be selected. To control the garage door, I used a spare radio remote control from it and, using an additional relay (sixth), emulated pressing a button on the remote control (by opening the remote control and soldering the buttons into the contacts).

The communication protocol of a standard thermopump control unit with its remote control (usually 2 wires) is usually closed and our arduino cannot know what mode and settings are set in the standard control unit, but with the help of our sensors we can know what mode the HVAC is in now, and although they also have There is a temperature sensor in the heat exchanger; additional protection using Arduino will not hurt. I am often asked: Isn’t it scary for me to trust Arduino to control such a responsible system in my home? My code is open and transparent. I understand what is happening and can always catch and correct inaccuracies (if any remain after six months of using the system). And most importantly, I can add any functions that I need. In the same box there is most likely a less powerful controller and of course there is nothing that can be changed or added. Without an Arduino, adding again limited functions such as access from the Internet to a standard control unit costs a new box of hundreds of dollars. It all started Not because I wanted to save money and I needed functions that were convenient for me and that I couldn’t buy from equipment manufacturers at any price. But of course, if you take into account the cost of the man-hours spent by me, and even by you if you simply decide to do something similar based on my and other developments, for this project it is of course cheaper to buy a ready-made one but say goodbye to flexibility and the necessary functions. It’s like installing FreeBSD and painstakingly digging through the flea market of knowledge on the Internet for a long time and for every reason and manually from the command line tweaking it for yourself in comparison with Mac OS, a beautiful ready-made but limited one based on the same BSD. The main one is turning on heating/cooling to the desired temperature not forever or according to a schedule, but only for an hour or 2-4. It sounds simple and convenient, but it is not present in standard control units.

If you want to control only a thermal pump without RF, RTC, barometer and other hassles, Uno has enough memory and legs (I did just that in the first phase of my project). The full version cannot do without Mega. Let's take a look at the resulting functionality and interface.

The interface itself is made within just one html page using Ajax technology for data exchange with the Arduino web server (webduino) and is based on the JQuery Mobile libraries. Therefore, to work, you need several image files and the libraries themselves, which can be replaced with links.

In the upper left corner, we see the moon, this means that according to the day and night settings (in the first line of the blue block) it is now night mode. If it's daytime there will be sun there. Next we see our house. In the house there are a lot of temperatures in each room and in the center the temperature in tenths is the temperature in the living room on the main level. In green at the bottom of the house we see the relative humidity inside the house. To the right of it is a snowflake, this is an indicator that the air conditioner is now working. At this point, the remaining operating modes (heating with a thermopump or AUX or x10) are displayed with different icons. If the icon is muted (translucent), it means the system is in this mode but not active. Those. for example, in air conditioning mode up to a temperature of 21 degrees, but since it is now 20 degrees the air conditioner is not active. If two modes are operating simultaneously, for example heating x10 and heating with a thermopump, then two icons will flash sequentially. To the left and right of the house we see rays, when pressed they become bright and when pressed again they dim again. This is the inclusion of external lighting near the house. I have outside lights in the backyard and front of the house. Control is transmitted via x10 and the numbers of the corresponding devices are written in html (JS) code, Arduina only sends commands to the device numbers transmitted to it from HTML. To the right of the house we see an automatic garage door. which opens and closes when you press it. Above to the right of the house we see the current (averaged over 1-2 minutes) or maximum per hour wind speed in knots. The wind speed value is highlighted in different colors from blue to red depending on the speed and in accordance with the internationally accepted colors of the Beaufort scale. On the top right we see the temperature outside and below the current atmospheric pressure. The pink background for the pressure value is a graph of its relative change over the last 24 hours (x-time, y- relative value pressure). Under pressure green relative humidity on the street.

Now consider a group of white selectors and the SET button. Use the left selector to select the desired temperature/mode. Right for how long to enable this mode. If the mode is active, the labels will change slightly, as in this example
If the heating mode is active, then the button will additionally be tinted red and if cooling mode is blue. To turn it off, you need to leave the temperature and the selected mode on the left and the remaining minutes on the right, and then the SET button will change to OFF and pressing it will turn off the mode. Cooling or heating mode is selected automatically depending on the outside temperature. If the street temperature is less than the value of the heat_temp constant described in the html(JS) file, then only heating will be offered, otherwise only cooling.

Now let's look at the blue x10 block. Clicking on the first line opens general settings: ON - All sockets are always on (for example in summer), OFF all sockets are always turned off (for example if you are on vacation), Split - individual settings of groups and rooms come into force. Next, you can choose from what hour the day begins and from what time the night begins. To save the settings, do not forget to click the Apply button below. further, each line reflects a group of rooms which can consist of one or more rooms. I made a grouping by floors in my house. Some floors have only one room and some have more. For each group we can set the ON mode - all sockets in this group are always on, OFF all sockets in this group are always off (for example, you need to turn on the vacuum cleaner and if the battery is running at the same time, it will blow the fuse), Split (available only for groups with more than one room) - individual settings of rooms within the group come into effect, Day - maintain the specified temperature only during the day (always off at night), Day&Night - maintain the specified temperature for the day and a different temperature at night. All of the above are available for each room with the exception of Split. For the changes to take effect, do not forget to click Apply below.

The very last line is to set the Override mode. This mode was made to force the sockets in the selected room or lamp to turn on for a while. For example, you need to heat up the room as much as possible for a certain period in order for the child to have a massage there and after an hour continue to maintain the usual temperature in it. Or turn on the light outside for half an hour. On the left you select the room on the right for how long to turn on the mode and press the Override button. If you need to turn off the mode ahead of schedule, select OFF on the right and click Override. All information is updated every upd_interval (constant from the html file) seconds. Default = 60 seconds. When all information is updated upper part The page with the house is blinking.

I would also like to talk about the concept of combining sockets (pool). Let's say you have one large room One battery alone is not able to heat it at -5, or it will take a very long time to heat up. You can install a second RF socket with the same code/address and plug a second battery into it and they will both always turn on. What's relatively warm temperature will cause these two or more batteries to click and switch on and off frequently. There is another option: you combine these batteries into a pool in the Arduino code x10pools=(0,0,0,0,0,12,0,0,13,0,0,0,0,0,0,0,0) . Zero means that there is no pool for a given socket address; the number means the address of a child socket of the pool. The child is turned on if it is colder outside than poolt (constant from the html file) or the gap between the desired temperature in the room and the current one is greater than delta_temp * poolf (constants from the html file). I would like to say more about delta_temp (constant from the html file) this is Temperature Delta. It is needed so that the modes do not often turn on or off, since the sensor readings may jump a little +-. The heating turns on if the current temperature is less than (desired - delta_temp) and turns off if it is more than (desired + delta_temp). The default is 0.5 Deg C.

Now let's look at the issue of security. Of course, you can’t leave control of your home accessible to everyone. Since our system consists of a client (JS Ajax html page) and a server (Arduino), you can organize different levels of security. For example, you can put an HTML page on your computer, phone, tablet, etc. (without exposing it to public hosting) and then only you (from devices that have this file) will be able to open this control panel for your home systems. The Arduino web server is based on the internal IP and therefore if you do not forward it to the router outside world, then the Arduino itself can only be reached from your internal network. Access to the HTML page itself can be password protected on the Web server where you want to post it. It is also fashionable to raise the HTTPS server in relation to it. The simplest and, in my opinion, quite reliable is public hosting of the page, but the page itself does not connect anywhere when launched unless the Arduino server address is passed to it as a parameter (pre-configured Dinamic DNS and Port Foewarding). It looks like this: in the browser, enter the following link: http://myhosting.com/index.html?http://myhome.slyip.net:8081/hvac. If an attacker accidentally stumbles upon your client page, he will not be able to do anything with it without knowing the address of the Arduino server. This is the simplest and most convenient compromise option that I currently use. Yes, I also don’t like this whole design with a poor (slow, not supporting HTTPS, etc.) Arduino Web Shield server, in addition to which I also have to host the client page with the icon somewhere separately. And as soon as I receive the famous TP-LINK TL-WR703N from China
a router that in the blink of an eye turns into a wifi bridged web server with a Serial (UART) interface to Arduine, I will immediately screw it to the Arduine (or it to it) and throw out this shield and disconnect the wire. Thus, it will turn out even more than what I wanted so unsuccessfully to achieve from the STM32 controller, namely, that everything would be in one device (not a separate client page and a separate executive server) and a normal web server on which a decent degree of convenience, speed and security can be implemented.






B for last

No more searching for the remote control or getting up from the couch to adjust the blinds. Home Automation Controller will solve all these problems. Installing an automation system improves the living system by replacing some body movements with a remote control, which in the hands of the owner is capable of fulfilling almost all wishes regarding control. The smart home system takes control of everything home equipment and with one click on the control panel it performs on, off and other functions.

Home Automation – Smart Home

Every year, the smart home program is gaining more and more popularity, and hardworking specialists are trying to improve it and make it easy to manage. helps to remotely control curtains, lights, air conditioning and other equipment. Also, the control panel can be located either on the wall in the form of a touch panel or located in a device, for example, an iPod, iPad and others.

Controlling your home using a remote control is something that is necessary in every home. It’s so nice to wake up not to the annoying sound of an alarm clock and the sun shining brightly in your eyes, but to the sounds of nature, while in a room slowly filling with light. All daily activities can begin with your favorite music, you just need to make the appropriate adjustments to the control system. With a smart automated complex, you no longer need to run around turning off lights and other devices; when you leave the house, you just need to press the touch panel of the control system and everything will be done for you.

Smart home automation systems

This system simplifies life by providing the ability to control the house using a special remote control. Automated home control allows you to:

  • set certain lighting modes;
  • give a certain position to curtains, blinds;
  • turn on and off air conditioning, heat supply and other equipment.

Everything you need is now at hand, within reach. The control is carried out via a touch panel, which is capable of performing the specified work of any device every day at a certain time. Thus, you can adjust the lighting or set the operating time of the air conditioner. Devices that run on the Android platform and manufactured by Apple can be used as a remote control.

Advantages home automation systems weight. They are not only about the convenience of managing the house, because such a system allows you to save on electricity. Due to the fact that lighting and other devices will work at the specified time and for as long as required for a comfortable stay at home, you can forget about constant overpayments. All necessary adjustments are easily introduced, so the system can be adjusted to minimize resource consumption. Installed system warnings, will be able to notify in case of problems or indicate possible failures.

Films often show a living space that seems to live its own life. Light bulbs light up with a wave of your hand, curtains open, and music plays after a certain word. All this equipment is an intelligent home system, and we propose to consider how to make a smart home with your own hands, what is needed for this, and also what is the diagram of such a system.

Smart home - what is it?

Smart home Home automation is a residential extension of building automation. Home automation can include centralized control of lighting, HVAC (heating, ventilation and air conditioning), home appliances, gate openers, door openers, GSM and other systems to provide improved convenience, comfort, energy efficiency and security. It should be noted that for some categories of the population (elderly, disabled people) this event may become necessary.

Photo – Smart home distribution ideas
Photo – Simple smart home

With the latest introduction of SMART technologies into our lives, many can no longer imagine their lives without automatic installations, software equipment, we need wireless Internet, household appliances.

Home automation refers to the use of computer and information technology for management household appliances and their functions. It can range from simple remote lighting control to complex computer/micro-controller based networks with varying degrees of intelligence and automation. Home automation should mainly be as simple as possible.


Photo – Smart door lock

Advantages of using a smart home in an apartment based on PIC or WAVE:

  1. Economical expenditure of time on daily setup of various mechanisms, receiving calls, sending mail;
  2. The use of gaseous or liquid fuels, and later the use of electricity, allowed for increased automation in heating systems, reducing the labor required to manually refill the heater and furnace.
  3. The development of thermostats has made it possible to adjust more automated control heating and later cooling;
  4. This is how industrial facilities and residential premises are often protected;
  5. As the number of controlled devices in a home increases, their interconnection increases. For example, a furnace can send notifications when it needs cleaning, or a refrigerator when it needs servicing.
  6. IN simple installations, smart can turn on the light when a person enters the room. Also, depending on the time of day, the TV can tune to the desired channels, set the air temperature, and lighting.

A smart home can provide an access interface to household appliances or automation to provide control and monitoring on your smartphone, through a server, mini Smart for iPhone, iPod touch, as well as using a laptop computer (special soft: AVR Studio is required).


Photo – Home control via tablet

Video: Schneider Electric smart home system

Smart home elements

Home automation elements include sensors (e.g. temperature, daylight or motion detection), controllers and actuators such as motorized valves, switches, motors and others.


Photo – House control diagram

This heating, ventilation and air conditioning, HVAC can control temperature and humidity, for example, an internet control thermostat allows the homeowner to remotely control the building's heating and air conditioning systems, the system can automatically open and close windows, turn on radiators and boilers, and heated floors.

Lighting

These lighting control mechanisms can be used to control household lights and appliances. This also includes a natural lighting system, the operation of blinds or curtains.

Photo – Smart home diagram

Audio-visual

  • Remote control presence effect (This is the most modern technology, which is used to increase security). It involves turning on the lights and playing music.
  • Presence simulation
  • Temperature regulation
  • Brightness adjustment (electric lamps, street lighting)
  • Security (alarm, blinds).

How to make a smart home

You can make an intelligent system with your own hands, the most budget option– this is setting up control of lighting in the house or turning on the computer.


Photo – Smart home control option

To make a lamp that will light up on its own, you will need to connect special equipment to it. There are several options for solving this problem:

  1. Install an acoustic relay (1 or x10-wire);
  2. Attach the dimmer;
  3. Connect a motion sensor.

The easiest way to work is with a sensor. It is sold in any online store, you can buy a duct device, or you can develop your own according to your parameters. The only note is that you cannot install an incandescent lamp with such a device, it may not withstand the load and explode; it is better to work with an LED one.


Photo – Smart home concept

Another “smart” silent option is a dimmer. Here you will need to touch the lamp, depending on the number of touches, the speaking device will change brightness. This is very convenient to use on a lamp in a bedroom or children's room.

To set up temperature control and regulation, we need a multi-channel system. Central scheme temperature and humidity control consists of:

  • Sensors (ds1820) that measure the physical state of liquid and air.
  • Controllers (rfm12), which can be simple physical components or complex devices special purpose or embedded computers.
  • Lunex drives that respond to controller signals.

Most modern way– this is to buy all the components of a smart home, wires, thermostats. Then install devices in each room, one thermostat for the radiator and one for the boiler. You will also need a controlled unit, or the “brain” of the entire system. It is recommended to install it on the heating inlet pipe.


Photo – Smart home system

The easiest way to install a video surveillance and alarm system. Fundamental provisions for installing security systems:

  1. You need to connect sensors on the windows, doorways, electricians will be the most productive there;
  2. The most difficult thing is to select a board; the smart home controller, the operation of mediocre parts, and the signal level depend on it;
  3. Many experts believe that indicators should be mounted at floor level. About 20 cm from the baseboard, this increases efficiency;
  4. It is advisable to establish constant monitoring and establish a digital system of contact with the security service. Often responsible owners set special program to your personal computer, which allows you to control the operation of the system from anywhere where there is Internet (this is what Elena Tesla and her book: “Smart Home: How to Do It Yourself” advises to do; there are also other solutions there). You can enable SMS notifications.

A smart home is very convenient way make your life easier, often the whole system purchased in full (Arduino, KNX, Linux).

The cost of each system is individual. The most popular brands are the following: beckhoff, gira, lpt, redeye, Smart Switch IOT screen, teleco. We recommend that before building such housing, you consult with specialists; they will help you calculate the load level and calculate the power consumption.


Photo – Light control via phone

To get ideas, you can scroll through V.N. Gololobov’s “Smart Home” with your own hands, DJVU or PDF, look at our photos and video instructions, read the advice of famous masters.