A year and a half ago, I wrote an article about developing their own tires "CLUNET" for connecting devices in the "smart house". Many asked to tell about what I did in the end, I now try to do.
Tried to draw a diagram of my room with all devices in a network, the image is clickable:
The whole idea rests on three pillars:
- Decentralization — the whole system operates without any main module;
- Simplicity — a minimum of components and easy connectivity;
- Low cost — the cost of the device easy to pack in 100.
With this approach you can easily create and add CLUNET network devices, each responsible for some simple function. All devices have the address, they can exchange packets directly, without the involvement of either the main module, and it is very actively used:
- Packets sent from the remote control receiver will receive the switch and the opener window that allows you to control the light and open the window from any remote control or Nintendo Wii U;
- Motion sensors inform the switch that the room is unoccupied and turn off the lights;
- Display in the hallway always displays the current outside temperature received from the temperature sensors;
- On command from the code panel opens door lock;
- Device with a beeper sounds when he learns about the opening of the lock, pressing a button or calling the intercom.
This list is easily changed and updated to take account of the fact that the firmware of each device can be updated directly via the network. And no, I have no problem with the lack of understanding of their source. All the firmware code turns out very simple.
The only main device that perhaps can only be called a power supply. At the moment I have one of almost all improvised devices, and transactions. Many would likely say: "Yes, you have probably everywhere in the wire!", — this is partly true, but I have no phobia against the wires. Besides a small ribbon cable with power and data line are almost invisible compared to other cables.
Router with CLUNET-adaptermay router in addition to routing traffic performs another role — routing traffic, it is a "window" for devices CLUNET network to the Internet. Or rather — allows Internet and local network to command all devices. For this it is the USB port enabled in your PC.
I am not going to repeat myself, about what I talked in the article about CLUNET Protocol. The idea is simple — the router is based on Linux, and it runs a daemon that accepts incoming connections from the local network or the Internet and provides network access devices, smart home.
In addition, the router is used as a simple web server to control devices through the web interface, in case... well just in case:
Very convenient to use and cron
on the router for a variety of tasks — from opening the window or heat the room according to the schedule to the banal alarm clock. For the latter, I have made a simple web interface and scripts:
There is no alarm clock better than to Wake up from the radio, which is very slow for several minutes increases the volume. The important thing is to turn it off before it can Wake the neighbors.
In response to the packets coming from devices also run different scripts. So logs are maintained for a variety of events calls into the intercom, drawn graphs of temperature (http://clusterrr.com/sensors/t/) and other data, sends a push notification to my phone if suddenly the room door opened, and I was not at home, and so on.
Software for WindowsНа computer is running an application that connects to the daemon on the router and enables you to control everything. In the main window you can monitor all traffic between the device and send any command:
It is possible to observe how the smart home lives a full life, but in practice it is necessary only for debugging. All you can do by clicking on the icon in the notification area:
In addition to many actions there are special shortcuts. Yes, laziness — the engine of progress and it is convenient to open window or turn on the lights and hot keys, without leaving the chair.
But you can't stay on the light control, it is necessary to control and appliances! For this I have used Doo-transmission, which simulates pressing buttons on the remote. By pressing hot keys on screen display remote controls:
Of them can control the receiver, TV, heater and a laser. It's hard to describe how it make life easier. Remotes always have to look for, they are lying everywhere, not only near. Now they're covered with dust.
In addition, this software performs the opposite role — obtains the codes of the buttons from the remote control receiver and simulates a WinLIRC server is a popular program to work with remote-remotes. It supports, for example, MPC-HC, there's a plugin for foobar2000. Thus it is possible to do the opposite — to control computer applications using any remote.
Software for telefonunu as without control it all from your phone from anywhere in the world? App for Android has roughly the same functionality. Basically aktiviti, you can switch between different modes through horizontal swipe.
Planetspace I had the idea to solder a wall-mounted control panel that would hang over the bed to perform with her simple actions — turn on the lights, adjust the volume, control the TV, etc. I would Like to add to the screen to display basic information.
But soon it dawned on me that times are not the same. Much easier to buy cheap Chinese Android tablet and hang it on the wall. Yes, these tablets usually are the brakes and very low quality, but for my purposes this is enough. No sooner said than done.
Had nakodit various desktop widgets:
But it was still not enough convenient, especially when I wanted to do something to the touch. After a while I remembered that in Android there is a great API for voice recognition. It only took half an hour to the tablet and began to do his first voice command. Soon the set of possible commands has greatly increased.
Meet, here's my e-wife:
Needless to say how convenient to open window, without opening the eyes? It is a pity that this drive is very noisy when the window is closed by the timer, not waking up impossible.
A similar service was eventually installed on the phone. It works only when connected to charging. I guess it would be cool to use Google Glass.
Read more about stroytehnologiya will tell you a little about what the device function in my smart home. Attention! Below hell of a lot of farm and wires! Beautiful I do not know how, my hands are growing not from the right place.
Switch smetanichi special, just turns on and off the bulb on the chandelier.
The touch one adds the number of lamps, the other diminishes. It is possible to set the timer off, but his need has disappeared with the advent of wall-mounted tablet. Friends with remote control receiver and motion sensors.
Controller reed switch with Squeaker
This is a very strange device appeared long before I started to make a smart home, and therefore made very clumsy and without housing.
The point is that my room lived the mouse, and in the rest of the apartment — cats. The whole point of the device was to wildly beeping if I forget to close the door, cats in no case should not penetrate the room of the mice. Now the device sends the network packets when the opening and closing of the door. The router writes logs to open and it sends me a push notification if suddenly it's open when I'm not home. My location is on the mobile phone. Besides all this Squeaker is now used for a variety of sound notification — intercom, lock opening, pressing the buttons on the code panel.
Doo-Doo the receiver and transmitter
About them I like already told above. The receiver is at the computer, the transmitter hidden in the closet.
Sensors dvijeniya room are two here such here motion sensor.
Promote turning off lights when no movement for a long time, and even changing my status to "away" on instant messenger apps. In addition they define the movement more and four video cameras.Door lock code panel
When I became the happy owner of a 3D printer, I really wanted to experiment with the mechanics. As a result, I have developed and printed the mechanism of the door lock. The first pancake is always lumpy, and it turned out the wild farm, but it works great. On the external side of the door I did the code panel, it came out better. Better to just watch the video.
Now I still like serious adult uncles!
Temperature sensors and osveshenia not much to tell. The unit is hanging under a window sill and uses a 1-wire temperature sensors, in addition to this experimentally made in the light sensor. I do not know why.
The opener window
you could have a bit to see in the video above. The mechanism of purchase and represents the circuit with the engine. It was nice to know that there are companies that do similar things.
The drive itself is powered by 220V. Left in a box scheme with two relays that supply power. I withdrew from the window one loop, that allowed to open it twice as wide, so you can open fully and a half.
Display corydoradinae when leaving the house I wanted to see the current outside temperature and time. That's all.
And yet there runs Pac-Man, which was painted a few custom characters.
Domainpro my intercom with answering machine, I wrote a separate article: http://habrahabr.ru/post/188906/
Mouse clickimin cell is then transmitted as IR signals information on how much each mouse ran on a wheel. About that, too, was a separate article: http://habrahabr.ru/post/165269/
Alas, now there is only one mouse, he runs is not enough.
Videokamery the room are four IP cameras with rotation mechanism.
They are sent to the remote server a short video when the door opens. Or long, if I was not home. When there is motion they occasionally take photos. In addition to all this camera work as additional motion sensors. If something started to move, they request the link to the router, and that, in turn, sends a broadcast packet to the network.
Zaklucheniye that the article was not too boring. I didn't know how to tell everything so that was interesting, quite a lot of information to present, I tried briefly.
Many people will probably ask me: "Why do you need so many cameras?", "Why do you code?", "Why do you need motion sensors?", "Why are you doing this?"
All these questions I will answer in one image: