Smart home control panel. iPhone in the wall
I started automating my home about 2 years ago, mainly using Z-Wave wireless technology, but for the sake of fun I assembled several devices myself on the microcontroller ATtiny2313 and Raspberry Pi. When I decided that I would make a smart home, I set three tasks that the smart home had to solve, the first was to save energy, the second was to provide comfort, and the third was to display real-time information about the state of the home.
At the moment, we have managed to implement the following:
- Automatic on and off lights in the corridors
- Controlling an iPhone TV with the Raspberry Pi and IR
- Weather station with temperature and humidity sensors
- IRobot vacuum cleaner that will soon join WiFi
But the third task of displaying information was not completely solved. In the kitchen and in the room, I have weather stations showing temperature and humidity, to see where the light is on, you need to open the application on the iPad, to find out traffic jams, you need to open another application. I use all this information every day, and it would be logical to get it from one place, so I decided to make the information panel installed stationary in a convenient place.
Having conceived the panel, I knew what functions it should have, this:
- Display temperature outside
- House temperature display
- Display of humidity in the house
- Traffic Information
- Power off
- Button DISABLE ALL
At first, I planned to use an Android 7-inch tablet as a panel, and as OpenRemote software, which was just designed for this . But later he decided to make a panel of improvised means. At hand was an old man iPhone 4, which, as it turned out later, coped with the role of the control panel perfectly, despite the small screen.
So, after choosing the panel, the main question arose, how to mount the iPhone into the wall, google found several ready-made solutions, each of which cost around 600 ~ 800 euros. The fixing price exceeded the price of the iPhone itself, I thought it was not reasonable and decided to make the iPhone itself!
To install the iPhone in the wall, you had to understand:
- What to fix the iPhone so that it does not fall out of the wall
- Where to hide the power supply
The solution to the first problem was found in the box from the iPhone itself, the substrate separating the iPhone and accessories with minor modifications perfectly kept the iPhone in the wall.
I sawed out a frame from plexiglass that increases the thickness of the substrate.
I found plastic anti-backlash gaskets for switches, made them ears.
The power supply did not hide in the wall, but decided to move it to the room, the iPhone is conveniently located next to the door to the room. Having bought a 2 meter power cable, I pulled the wire under the door trim, led me into the room through a hole drilled in the door frame and inserted the power supply into a specially prepared outlet there.
I cut the frame out of black glossy paper and pasted it directly onto the wallpaper, of course it would be cool to make such a frame out of black glossy plexiglass, I even prepared an autocad file for cutting plexiglass on the machine, but the price of 1500r cooled me down.
Here's what the finished panel looks like:
After installing the iPhone on the wall, it was the turn to write software, I am a little familiar with programming for iOS, so there were no difficulties in programming. Difficulties arose with the design, for several nights I pored in Photoshop over simple icons and layout of blocks. The result is what you see!
Nevertheless, I like the tiled design.
In the second part I want to talk about the devices that I use and which I control from the panel.
Light control is fully built on Z-Wave wireless technology. The choice fell on her because of the large number of compatible devices, more than 200 companies around the world release Z-Wave devices, which means that I will not have problems in the future with the purchase of equipment. Plus, it’s cheap compared to knx, amx, crestron, on average, the device costs $ 100 and most importantly it is wireless, I do not need to pull any wires between the devices for their interaction.
|Z-Wave.Me Dimmer 300W is a dimmer complete with a key, under the key are two buttons, pressed up - the light came on, pressed down - the light turned off, the key is always in the neutral position. I have 3 such devices installed, one in the room so that you can regulate the light from the phone, one in the hallway and corridor, so that the light turns on at night by 20%, and by day at 100%. These dimmers are set to break the phase, and according to the Soviet tradition, the wiring is so laid that there are no zero, only phases in the switch socket, so I can not use switches with relays.|
|Fibaro Universal Sensor is a binary sensor, if you short to two wiring on it, then a signal will be sent to the Z-Wave network that the sensor has triggered. I have these wiring closes the Astra-515 motion sensor. Thus, I made my Z-Wave motion sensor. I use 2 of these, one in the hallway, the other in the hallway, controlled by Z-Wave.Me Dimmer.|
|Fibaro Dimmer is a micromodule dimmer without a key the size of a crown, I connected a night light to it, and as a control button I use a small doorbell.|
|The Z-Wave.Me Dual Paddle Wall Controller, a battery-powered , two-gang switch, is a conventional switch-shaped remote control that controls the Z-Wave.Me Dimmer (chandelier) and Fibaro Dimmer (night lamp) in the room. Glued near the bed.|
|Everspring power socket is a radio-controlled socket, in the winter I turn on a garland and control it from the Z-Wave.Me Key Fob. Now the lamp is connected to the socket, I turn it on with a single-button battery switch.|
|The Z-Wave.Me Single Paddle Wall Controller Battery Powered Wall Switch controls the Everspring Outlet Module.|
|Fob Z-Wave.Me Key Fob , each button turns on / off the light somewhere.|
|RaZberry expansion board for Raspberry Pi is a board installed in the Raspberry Pi and turns it into a smart home controller, with it I configure communications and interaction scenarios.|
Z-Wave is a mesh network, i.e. Each device can communicate with each device directly without a central controller. For example, a double battery-operated switch that I have glued to a double-sided tape to the wall near the bed controls directly the dimmer in the chandelier and the dimmer in the nightlight.
But in the hallway and in the corridor, where I have installed motion sensors and dimmers, control is carried out using the controller. When triggered, the motion sensor sends a signal to the controller, a script is launched on the controller that checks what time it is, if from 7 to 0, then the light turns on to maximum, if it is night from 0 to 7, then the light turns on by 20%. And of course, the whole world can be controlled from the iPad and see the status of the sensors.
The weather station in the room consists of two parts
The first part: 2 seven-segment indicators of 4 segments operate on an attiny2313 microcontroller with 2 DS18B20 temperature sensors, one sensor in the room, the other outside the window.
The second part: the LCD screen from the old Nokia 6020 is screwed to the Raspberry Pi, according to SPI 9 bit information from the humidity sensor DHT-22 is displayed on it. For Raspberry Pi, I wrote a couple of cgi-bin scripts with which I extract information about humidity and temperature on iPhone using HTTP requests.
If anyone will be interested in the details of how to draw on the Nokia 6020 screen with a PCF8833 16 bit color controller using raspberry, ask, because I had to solve this problem myself and this is a topic for a separate article.
On the same Raspberry there is a board for controlling the TV via IR. It works simply, from the iPhone via WiFi an HTTP command is sent to the Raspberry Pi using the lirc program, the necessary IR command is executed. You can apply this board to any IR technology.
In the next room, the Roomba iRobot 770 vacuum cleaner is completely independent, working on a schedule. The plans are to purchase a RooWiFi WiFi card to it and steer it from the phone or launch it when I'm not at home.
What I came to
Continue to improve my home I think I will be for a long time. To demonstrate what is currently available, I prepared a plan for my apartment in Planner5D, and with the help of Photoshop I placed the Z-Wave devices, indicating what controls what.
I am interested in technology and always strive to improve my skills. I am interested in developing solutions that prove useful. Combining entertainment and practical benefits, I created a really comfortable smart home. Thinking of exploring the AVR microcontrollers and programming for the Raspberry Pi, I developed my own weather station. Carried away by the technologies of smart homes, I made an automatic inclusion of light in the corridor according to a temporary algorithm. The robot vacuum cleaner was purchased for a well-known reason - the love of cleanliness and laziness to clean.
At the moment, having installed the control panel in the hallway, I achieved the desired level of comfort: when I leave home, I turn off the forgotten light and the TV with one button, after a couple of hours the vacuum cleaner starts working, if necessary, I can check from work if the sensors didn’t work in my absence, and when I get home, I will open the front door and the light itself will turn on, without making me break my legs in the dark, making my way to the switch.
The house has become more comfortable, and the systems that work in it save me time, allowing me to spend it on the joy of life!