Sunday, March 16, 2014

House: Automation Overview

There will undoubtedly be a large volume of posts about automation, as I figure out various sensors, filtering algorithms, control systems, etc., but I'll start with an overview of the ideas I'm playing with.

When in Doubt, Connect It

To begin with, my default assumption is that it's better to connect everything, even if I can't think of a reason to connect it right now. That means embed every possible sensor and enable control of every possible device -- or, at a minimum, ensure that the wiring is in place to make it possible to connect everything later if it's too expensive or time-consuming to do it up front.

Sensor examples:
  • Closure sensors on every door and window, inside and outside.
  • Temperature, humidity and light sensors in every room, perhaps multiple places in each room.
  • Microphone(s) in every room (I need to think hard about the privacy aspects there; but part of the idea is to enable a nice custom-designed intercom system).
  • Camera(s) in "public" rooms and outside.
  • Weather station outside -- temperature, humidity, barometric pressure, rain gauge, wind speed and direction, etc.
  • "Presence sensors" in every room. I use scare quotes because I haven't yet decided what kinds of actual sensors make the most sense, I'm playing with infrared motion sensors, microwave doppler radar motion sensors, ultrasonic ranging sensors and photoelectric sensors... and that's just what I've found so far. The goal is to know if people are in each room and, ideally, how many. If possible, it'd be really awesome to know who, but that seems more difficult without making people carry some device (like, maybe, a cellphone).
  • Flow meters on water lines.
  • Flow meters and temperature sensors on radiant heat loops.
  • Current sensors on electrical circuits.
  • Light switches.
Examples things to control:
  • Heating / cooling system
  • Windows
  • Blinds
  • Lights
  • Outlets
  • Water valves
  • Ceiling-mounted speaker system
Further, on the control aspect, every device should be individually controllable. I can't imagine why, for example, I'd want to send an audio signal to the ceiling speaker in one corner of a room and a different signal to the speaker in another corner of the room, but it should be possible. Actually, I can think of several reasons now that I consider it.

Data Wiring Strategy

I first started thinking that I wanted to run control and sensor lines from every device to one central location, the basement utility room. As my ideas about what I want to control/measure have expanded, though, I've realized that's just too much. It would be a huge bundle of wires, especially since I'm planning to use cat 5 everywhere, on the theory that it's cheap and it provides eight 24 AWG strands, four twisted pairs, to each location.

I don't think anything I have planned will benefit from the interference reduction provided by the twisting, but the stuff is cheap.

So, instead I think I'm going to do the wiring on a per-room basis. I'll run all of the wires for a given room to a single location (perhaps two locations for big rooms) and put a multi-gang light switch box there — that's the sort of box which holds multiple light switches together. Light switch boxes are common (and therefore cheap) and you can also get cheap and attractive blank face plates for them. Using large ones should provide plenty of room.

At each such concentration point I'll use a microcontroller (probably just a standard Arduino board with a shift register shield) to collect all the signals and to send all the control messages. Speaker wiring will have to be separate, of course, but it will go to the same point, perhaps to a separate box.

From each concentration point I'll run four cat-5 lines down to the utility room in the basement. One should be enough to provide power and connectivity to the control board, but redundancy is good.

In the utility room I'll put the central control system. It will need to be a beefier, more capable device than is easily achievable with Arduino-style microcontrollers, so I'm leaning towards a Raspberry Pi. That seems like the ideal device for a controller -- low power and simple enough to be highly reliable, with no moving parts (fans, spinning disks, etc.), but a real Linux system with Ethernet for network connectivity and a moderately powerful CPU.

Automation Ideas

So that's the infrastructure. What to do with it? Here are a few ideas I have now; more will undoubtedly come to me.


The goal is never to have to touch a light switch. There should be light switches in case there's a need to override the automation system's decisions, but most of the time the lights should come on ahead of you and turn off behind you completely automatically as you walk around the house — and obviously they should only turn on when it's dark enough to require them.

The key to making this work is presence detection. The system needs to be able to figure out where people are and where they are not, and to do so reliably. Passive infrared (PIR) motion detectors are used for lots of systems like this, but the common approach just turns on the light when a moving heat source (a person) is detected and then turn it off after some adjustable period of time. That's simple, but leads to lights turning off when people are stationary, and to lights being left on unnecessarily for the timer duration when people have left.

Another idea I'm toying with is having the system automatically use lower lighting levels after bedtime. So if you get up and walk around in the middle of the night, lights will still come on but they'll be fewer, or dimmer, so as not to be blinding. It should also be trivial to make lights come on automatically in the morning, as part of an alarm system.

Climate Control

It's already very easy and cheap to get a Wifi-enabled thermostat that provides sophisticated temperature scheduling and remote control. What I want to do is to go a step further and automate use of exterior weather changes to make the system more efficient and more accurate.

The biggest component of that is windows. Windows should be open whenever the outside temperature is closer to the goal than the inside temperature, and whenever other ambient conditions don't indicate that opening windows is a bad idea, for example if it's raining or windy. Another element is blinds, especially for the great room. During hot summer days, when the sun is at an angle that puts a lot of light and heat into the room, we want to lower the shades to block that. For that matter, if the sun ever reaches an angle that makes sitting in the room unpleasant, the shades should be lowered to block that as well. (Note that interior vs exterior shades is an open question: Exterior shades are much more effective at blocking heat, but are more expensive and require more maintenance. Interior shades have to let the light into the room then reflect it out, so aren't as effective. But if they're white they should still be pretty good.)

Sound System & Intercom

I'd like to see if I can make music, or other audio (audiobooks, actually), follow me around the house. Rather than sending the same signal to the entire house, which is both wasteful and potentially annoying to people, if I can devise a way for the house to know where I (and others) are at, and arrange to direct the audio appropriately, a given person's music, book, radio station, etc., can play in whatever room they're in.

The two key technology problems to solve are (1) locating people and (2) routing audio. For (1), I'm thinking iBeacons in each room with Bluetooth Low Energy-equipped smartphones detecting the nearest beacon and informing the system. This means the audio will actually follow the phones, not the people, but that seems acceptable.

Related, I'd like to build a smart intercom system that can address either specific rooms or specific people (if they happen to have a phone so their location is known). Using a small control panel in each room (probably mounted into the face plate covering the room's control box), it should be possible to select a room or a person and then use the microphones and speakers in both rooms. Alternatively (or in addition) a smartphone app can be used to establish one end of the connection with the room microphone and speakers as the other. Of course... if both parties have phones, you could also just make a phone call, but that's no fun.

I'm also interested in seeing if I can build a whole-house, always-listening interface to Google Now, or similar. I love how I can say "OK Google Now" any time my phone is nearby and then give it commands, ask it to search for things, etc. Something like that which works any time, anywhere in the house would be awesome.

Water and Energy Efficiency

Measuring water and electricity usage in detail should provide a lot of information that can be used to help optimize the system. Given that we'll be getting water from a well, not paying for metered usage, water efficiency may seem to be unimportant but I'd still like to see what's going on.

Hall-effect flow meters on the Pex lines coming out of the water manifold will provide good water usage measurement, and on a per-faucet basis. CT sensors on the lines out of the main electrical box will provide fairly detailed energy measurement.

Water valves could be added at the manifold to automatically turn water on and off, too. The only application I've come up with so far for that, though, is to turn off the hot water if my kids are showering for too long :-)

If you don't know what I mean by "water manifold", it's one of these. This new style of residential plumbing uses a home-run or star topology. Every faucet in the house has a line running directly to the utility room.

Door and Window Closure

For exterior doors and windows, the system can monitor closure state, to let me know, for example, if everything is locked up when I'm away, or at night. Another clever idea given to me by Charles Hardy is to mount sensors in the deadbolt receivers, so the system knows when the deadbolts are engaged. I spent some time looking for switches that would work without finding anything, but then I hit on the idea of just putting a pair of small springs in each receiver, arranged so the springs cannot touch one another, but will both touch the deadbolt when engaged. That will create a nice switch that closes when the bolt is thrown

For interior closure sensors I don't want to use the big, blocky devices normally used for security systems, but I found there are some small, inexpensive devices that are designed to be embedded in door frames.

These are 3/8" in diameter, so you just need to drill a small hole in the door frame to hold the sensor (a reed switch) and wire that up, and another small hole in the door into which you glue the magnet. When the two come within 3/4" of one another the switch will close indicating door closure. They cost about $2 each.


  1. Enjoyed reading the above article, in fact everything is explained here, the article is very interesting and effective. Thanks, and good luck for the upcoming articles. roxtec cable glands

  2. Regardless of what on line casino you select, checking sure factors first all the time makes things straightforward. So, here are are|listed beneath are} some necessary factors you should to} think about for on line 우리카지노 casino games. No want to attend as you enter net site}, deposit some cash, and start playing. There is no restrict on how a lot have the ability to|you presumably can} bet; if you have what it takes, bet greater and earn extra. However, that is the only portal with the lowest favorable odds, so watch out when enjoying in} an enormous hand. To help the gamers, BetOnline has a sportsbook the place they maintain the listing of updated odds.


My collection is complete(ish)!

I drive an electric car, a Tesla Model S. Generally, I never worry about how or where to charge it. It has a large battery and a long range,...