Close

Does this project spark your interest?

Become a member to follow this project and don't miss any updates

Sci-fi grade Home Automation

A system that ties some home automation with various APIs and hardware hacks.

3.6k 5 62 19

This project was created on 03/12/2014 and last updated 2 months ago.

Description
The goal of the sci-fi grade home automation system is to address a couple things I don't like existing systems:

Commercial systems tend to focus on three things: lights, cameras and thermostats. There's nothing wrong with that, but it is a very small scope compared to what modern technology can do. I usually don't need to see a real-time video of my apartment wall, and outlet switches are only moderately convenient, not life-changing.

I decided to make something inspired by Corning's "A Day made of Glass" videos. That system focused on displaying interesting information, and it was awesome. Existing systems don't do that, for reasons I don't really understand.

The other problem I wanted to address was the cost. In addition to being overpriced, commercial systems tend to do as much as possible to lock you into their platform. This system combats both problems by being open-source and being designed from the ground up to integrate with multiple low-cost platforms.
Details

The system can be broken down into several large sections, which are detailed in the design document below:

The central server talks with the nodes either over Wi-Fi or off-the-shelf RF interfaces. Most of the core software runs here. It contains:

A web interface and database (really an ASP.NET page with a static dictionary, but it works the same way)

A windows service that mediates all of the various communications

Speech recognition using SAPI and some microphones hidden behind the couch

It talks to two Arduinos over USB. Those handle the outlet switches, RF, and living room blinds.

An AutoHotkey (I know, right?) script that triggers the morning and evening routines.

Other nodes are the TVs, a couple old androids running the unity app, and a spark core that deals with detecting the switch state.

The system communicates with our Fitbits over the API (for getting sleep data, health data, and other user vitals).

Components
  • 1 × Arduino Mega I'm using the Seeduino model, but it really doesn't matter. It acts as the base station
  • 1 × Arduino Nano (per switch, outlet detector node, or blind minder) This provides communication with the base over basic RF
  • 1 × RF Transmitter (Per switch or outlet detector node) I used https://www.sparkfun.com/products/10535.
  • 1 × RF Receiver (per base station and blind minder) I used https://www.sparkfun.com/products/10533. If you want meshing, you need one of these for each node that you want to be able to re-transmit as well
  • 1 × IR Detector (per IR node) These are cheap and can be trivially attached to any node with an arduino and a transmitter. I used a bunch because they come in packs of ten
  • 1 × Wireless outlet controller (per controlled outlet) I used http://www.amazon.com/Etekcity%C2%AE-Self-learning-Programmable-Christmas-Batteries/dp/B00ENY9TFQ . The separate on/off switches are important because it removes the step of checking to see if the light is on for a toggle
  • 2 × 5V wall wart (per outlet detector) One of these serves as power for the transmitter and processor, one serves as the power detector
  • 1 × Server This can be any old computer. The only requirement is that it be able to connect with the Arduino over USB
  • 1 × Microphone (per speech recognition node) I have these on a bunch of computers, each of which runs the SAPI software in the background. This gives good coverage of the apartment without significant investment
  • 1 × TV (for the FitBit dashboard node) Self explanatory. Anything will work, but I prefer wall-mounted in the bedroom

See all components

Project logs
  • Finishing up

    2 months ago • 0 comments

    In preparation for the final submission deadline tonight, I wanted to talk about some of the most recent changes I've made to the platform:

    First: I have re-factored the database to pass results back either as a simple string or as JSON, instead of as javascript. This made the code across the board much more legible, and let me make the daemon a lot more sophisticated without a ton of text parsing

    Second: I added TCP bulbs and the blind minder into the final build. The TCP integration is described in the GitHub repository, and the blind minder is in the build log.

    Third: I created an AutoHotkey script to run a proper good morning and good evening routine (along with some new dashboards to go with them). That should also be in the repo.

    Fourth: I cleaned up the interface look and feel to fit more with the modern aesthetic of the rest of the apartment. The Tron nods are more subtle now (except for in the mobile app), but I think the system looks better for it.

    As far as future development goes, I have a bunch of ideas for things to do:

    First and foremost: more control surfaces are a must. I have some old droids to re-purpose into light switches using the app, and another spark core is on the way for an outlet switch in the bedroom

    Second, I would like to clean up the 3-D printed parts with some sanding and re-forging so they look a bit more solid. Right now they look very printed, mostly because they were all done on a mostly-stock Printrbot Simple with lousy calibration, and barely touched up afterwards.

    Third, I would like to look into more systems to talk to. The Phillips Hue seems like a good candidate, and maybe some more traditional (X10, etc) systems would be good fits as well.

    Finally, I want to experiment with more information sources than Reddit and Fitbit. Taking some leaves out of the "A Day Made Of Glass" playbook, calendars, messaging, and other more social data streams could be integrated smoothly to add an extra personal touch.

  • Hackaday Prize Entry

    3 months ago • 0 comments

    I've been quiet on this for a while, but I have decided to enter this into the Hackaday Prize pool, with some significant refinements. My new goals are:

    Replace the laggy light-switch with a touch-panel powered by a Spark Core

    Add more dashboards

    Tie in with some Wi-Fi bulbs to automate the lights I couldn't touch last time

    Add more context sensitivity

    Make the blinds open and close from the system

    Finally make a freaking video

    So far, I have made one major improvement, and that is to create a page that grabs data from reddit and posts it on my tv for a morning briefing (still have a minor character encoding bug in the news feed, but whatever):

  • Post-Mortem

    6 months ago • 0 comments

    The system works, and just in time. I'm sure I will continue to expand this at a later date, and there are definitely a couple areas that need some work. That said, I think the core concept is good, and is useful as a design philosophy for systems like this. 

    The basic idea that drove the entire project was that the integration of many systems could create something useful, and I think that has been shown to be true. The wake-up routine is useful, and shows important sleep data. The light switches allow the system to be accessed in an intuitive way, but also allow the living room lights to be turned off from bed if forgotten. 

    The interface was deigned from the ground up to look like something out of Tron, and I think I succeeded in that respect. The voice commands are more Iron-Man, but I'll let that slide for convenience's sake.

    Notes:

    It wasn't specified in the project logs anywhere, but the sonic screwdriver worked as expected with the replacement switch. The only tricky part was that I needed to configure another Arduino to blast the signals to train the thing because, although it has a USB input, you can't actually program over that, it's just for power. Just keep that in mind if you want to do that.

    A 3D printer isn't strictly necessary for this project, but it helped to make the enclosures look more like I wanted them (Tron-like). If I did it again, I would likely try to use natural PLA in a second extruder to get the trademark circuit lines in the parts, but, alas, I didn't have one.

    It's unfortunate that configuring the Android app is so difficult, but that's how it had to be for the look I was going for. Procedurally drawing that based on a line drawing was going to be too much work, so I took the shortcut of just drawing it out in Inkscape/Filter Forge by hand.

    In this entire project, the hardest part was getting those SparkFun RF transponders to work properly. I ordered antennae specifically designed for 315 MHz, but they didn't make too much of a difference. The packets eventually get through, but the packet loss rate is crazy (easily 75%). That is a good argument for upping the cost of the system by a bit and going with standard Wi-Fi or Bluetooth, but that has its own set of problems. Suggestions on this point are more than welcome.

    Future improvements

    Opening the blinds as part of the wake-up routine (The machinery for this is more or less in place, but needs a bit of extra logic to make it work)

    Making coffee in the mornings (I would have put this in for release 1, but if I broke the coffee machine I would whither and die, and nobody wants to clean that up)

    Bugs:

    There is a 1-5 second delay between flipping a light switch and seeing the result.

    The integrated switches rely on detecting power from a wall socket through a wall wart, which, when combined with the packet loss from the cheap RF kit, causes an unacceptable delay (especially when turning the light off, as you have to wait for the wall wart to turn off completely). The solutions I see are increasing the power of the transmitter and switching to a faster way of detecting outlet current.

    Also, I haven't forgotten about the bonus hacks (though neither of them are as cool as the 6-monitor mount). I'll put those up later today (Can't get good pictures of the lights when it's light out).

    Special thanks to my girlfriend. Her suggestion on how to improve the system, as well as her keen eye for deign, made this system look a thousand times better than it would have (she would be listed as a contributor, but she doesn't have an account here). Also, she should be nominated for sainthood for not killing me after the fiftieth time I broke the lights.

    Also, thank you Colabot. Without your collaboration, I could not submit this project without roping in my already-swamped girlfriend.

View all 10 project logs

Build instructions
  • 1

    Step 1: Source the parts. This shouldn't be hard, they're mostly from Amazon and Sparkfun.

  • 2

    Build the base station using the following simple steps:

    Disassemble the outlet controller remote and throw away the plastic casing

    Solder wires between the +5v line on the Arduino and the positive battery terminal on the remote.

    Do the same with the ground line and the negative battery terminal

    De-solder the buttons from the remote.

    For each button, solder a wire between the non-power side and a pin on the Arduino Mega. In my setup, they are ordered as (starting with pin 2):

    1-on 1-off 2-on 2-off (etc.)

    Plug the wireless receiver into the Arduino. Follow the guidelines at http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wir...

    Attach an antenna (I'm using a 9-inch piece of wire) to the antenna pin of the receiver.

    Finish up by uploading the base station program to the Arduino (after making any needed pin adjustments)

    Images are in the logs below

  • 3

    Set up the server to handle IO with the base station by doing the following:

    Install IIS and the ASP.NET handlers on the server (Yes, I'm a horrible person for not using Node.JS or something like that)

    Copy the web site files (coming soon) into the C:/inetpub/wwwroot folder

    If you're comfortable installing windows services, install the duinodaemon service on the same server. Otherwise, set the duinodaemon console app to run at startup and start it up.

    Set up the server to have a static IP on your local network (If you're not using a droid, you can skip this step, I'll talk about why in a blog post here).

See all instructions

Discussions

conradcn wrote 2 months ago null point

OK, finally posted a video. Thanks to everyone for your patience.

Are you sure? [yes] / [no]

conradcn wrote 4 months ago null point

My game got greenlit, so this project is on hold until that's released. Sorry again for the slowness on the video.

Are you sure? [yes] / [no]

conradcn wrote 5 months ago null point

I apologize for the unforgivably slow progress on the video front. There was a sudden surge of interest in my game on Greenlight (hit #6) and I had to manage that. I'll do what I can to get a video out in the next couple weeks.

Are you sure? [yes] / [no]

conradcn wrote 6 months ago null point

That's a good point. I didn't realize until your comment that this would be really easy to fake. I'll try to get a video posted tonight. No promises though, I have other plans for most of the evening.

Are you sure? [yes] / [no]

davedarko wrote 6 months ago null point

You should make a Video for the reading-lazy people ;) Nevermind the ugliness, when you can show it actually works as expected. I like your case!

Are you sure? [yes] / [no]

Similar projects