📜 ⬆️ ⬇️

"Smart Home" with their own hands

Imagine the picture: you enter home, the light automatically turns on and a pleasant female (masculine, however - as someone) voice greets you. You casually throw the phrase in the direction of the microphone: "Home, turn on my computer." After a few seconds, you hear the familiar rustle of the coolers of your native iron horse.

Fantasy? Under habrakat I want to share my success in building such a system at home.

Future now


All of us have ever seen such pictures in foreign science fiction films and dreamed: "Someday we will have that too." I hasten to please you - a semblance of what you see can be realized now and without huge costs.

A small excursion in what is now called "smart home". This is what Wikipedia tells us:
')
“A smart home (English digital home) is a residential, automated home of a modern type, organized for the convenience of people living with high-tech devices. By “smart home” one should understand a system that should be able to recognize specific situations occurring in a building and react to them accordingly: one of the systems can control the behavior of others according to previously developed algorithms. The main feature of an intelligent building is the integration of individual subsystems into a single controlled complex.

An important feature and property of the “Smart Home” that distinguishes it from other ways of organizing living space is that it is the most progressive concept of human interaction with living space, when a person sets the desired situation with one team, and automatically sets and monitors the operation modes of all engineering systems and electrical appliances.

In this case, eliminating the need to use multiple remote controls when watching TV, dozens of switches when controlling the lighting, individual units when controlling ventilation and heating systems, video surveillance and alarm systems, gates and other things. In a home equipped with the “Smart Home” system, it is enough to select one of the scenarios with a single click on the wall key (or the remote control, touch panel, etc.). The house itself will adjust the operation of all systems according to your wishes, time of day, your position in the house, weather, ambient light, etc., to ensure a comfortable state inside the house. ”

In my case, I will tell you how to organize load management (sockets, incandescent lamps, etc) with the help of voice command recognition and voice it all with a good Russian voice.

Technical Details


1-wire



To begin with, we, of course, need to decide on the technology of power management devices. At the moment there are many of these. The most, perhaps, simple, popular and inexpensive to implement, is a 1-wire from the company Maxim / Dallas. 1-wire technology is far from new and has been known for about 10 years. 1-wire is widely used both in everyday life and in industrial systems.

Advantages of 1-wire


As you know, there are no pluses without minuses. Here they are:


It is seen that the advantages of technology are much more than the minuses. Let us dwell on the mandatory requirement for the presence of a network master.

The point is that in terms of organizing data exchange, the devices are passive circuit elements. 1-wire components cannot send data to the network without a special request. Thus, devices cannot communicate with each other without an “active” host. Network elements are always slave. Master in the network 1-wire only one. It is he who initiates, monitors and controls the operation of the network and devices connected to the network. Depending on the software used, the 1-wire line master can work differently with his clients, but only he can eventually poll the state of a specific item and also send a request to receive any information from this item. For example, if we need to display the temperature value from a variety of sensors in real time, the network master will cycle through these sensors in turn. Only one device can respond to the network master. The master can be the MK (microcontroller), which, with the appropriate software, can be directly connected to the 1-wire network to one of its I / O ports. A PC (personal computer) can also act as a master, using special interface elements that allow you to connect 1-wire to a computer’s COM port or computer’s USB port, such as the DS9097 or DS9490.

Actually, the work of the PC as a controller interests us. The special mate element looks like this:

image

As you can see, this is a small adapter that has a USB on one side, and on the other, an RJ-11 connector for connecting 1-wire network elements (we can hang 1-wire elements on a standard telephone cable - cheap and cheerful).

X10



Another technology, called X10, uses a frequency-compressed method for transmitting data in an ordinary apartment grid.

Pros:


Minuses:


X10 will suit lazy and those who do not wish for some reason to pull additional cables. I fell into either category, so my choice was X10 =)

We assume that we have decided on the power management technology.

Going further - video surveillance

After all, sometimes you want to see what is happening at home while you are at work, on vacation, in the country, etc? I have pets and in the long absence I want to look at them and even talk. Goals may be different. What do we need for this?

First of all - the computer. It will be the core, the head of our "smart home" system. It is to him that we will connect the power management of our home devices via the 1-wire or X10 network wizard, and we will also connect video surveillance cameras to it. In my case, I chose the usual simple web-cameras of average quality. Everything will be connected via USB. The restriction on the cable length of 5 m, costing me in the form of buying long active USB cables, where possible, and a bundle of cables through USB hubs with external power (maybe someone will offer another solution - I will be glad to hear). I ended up with 4 webcams for all rooms of the apartment.

We learn the computer to understand us and to talk

For me, "smart home" in the first place - this is interactivity. To do this, we will teach him to talk and understand us in turn.
My research has shown that a decent level of speech recognition at the moment can only give Google. I think everyone is familiar with his wonderful voice search and translator, which can greatly simplify the life of a mobile device owner. Craftsmen figured out what, where and how to send to get the text from the sound file.
The same with the synthesis - I did not bother much and used the same Google. In my opinion, the synthesized speech is at a fairly good level.

Combine

The most convenient interface for managing a smart home and a bundle of software I found the web interface. The software will be coordinated by a specially written perl daemon.

Summing up


In this small article, I looked at the minimum necessary, from my point of view, components of our “smart home”. There is no technical implementation - only a brief theoretical overview. In the following articles I will describe each component of the system in a step-by-step manner, its technical and software implementation.

Materials used



upd: Part 2. Video surveillance

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


All Articles