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.

4 46 13
Enjoy this project?
Share on twitter   Share on Facebook

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

Description
I like the idea of home automation, but it's generally a bit limited if it's a standalone system. In science fiction movies, the home not only controls the lights and thermostat, but deals with a broad range of tech to get that integrated feeling.

I also really like the "Tron" look and feel, so I'm building everything in the system to look like it was lifted from there.

Some key features are:

Light control
Integration with existing switches (without ruining your apartment)
Dashboards (using the Chromecast API, showing fitness and sleep data from FitBit)
Voice control (using Microsoft SAPI)
Sonic screwdriver control (using IR receivers in the walls)
Web interface
Shiny mobile app

All of this is in the GitHub Repo at https://github.com/MachinesInMotion/HomeAutoRepo

Bonus: Stable 6-monitor mount for $10 in parts, tron-style mood lighting, and multicolored shadows from a white lamp
Details

The system can be broken down into several large sections, which are described below.

The central server talks with the nodes either over Wi-Fi or, for the simpler nodes, over simple RF. Most of the core software runs here. It contains:

A web interface

Speech recognition using SAPI and some microphones hidden behind the couch

The ghetto router (an Arduino that reads wireless packets from the light switches and writes to the light controllers)

Additionally, the server doubles as a media center and gaming PC, with a touchscreen, mouse, keyboard, and wireless XBox controller receiver.

The mobile interface is implemented in Unity, and inspired by the interfaces used by Flynn in Tron Legacy.

Light switches are integrated with the system in two ways. Most of the light switches will be left as they are (we rent), but their associated outlets will be read, and their states will be sent to the server. Some of them need a bit more functionality (mostly IR input, which will be explained later), and the prototype switch works, but I'll be saving those for when we have a place we can actually modify.

The system communicates with our Fitbits over the API (for getting sleep data, health data, and other user vitals). This data is collated on a custom dashboard and sent to the TV in the bedroom via the Chromecast in the morning (to show sleep data) and at night (to show activity data). The TV is turned on and off by an Arduino-controlled RF blaster at specified times.

Lights are controlled by standard wireless outlet switches. I couldn't be bothered to reverse-engineer the protocol, so I just used the more brute-force method of wiring the remote control directly into the Arduino.

The coffee maker is on the road to a light brain transplant, and the microcontroller will take wireless input from the server and make coffee as requested from the buttons on the front, the mobile app, or the web interface. This will not be in revision 1, because I'm scared of breaking the poor thing, but it's worth mentioning because it works with the idea of a truly smart house.

The sonic screwdriver talks to the server via the various RF detectors hidden around the house, and has both context-sensitive (depending on where the screwdriver is pointed) and global (all lights, etc) effects based on the gesture used.

Bonus hacks:

The monitor mount is a sheet of thin whiteboard that I curved and bolted to the top of my cheap IKEA desk. The curve is held at the bottom by angle brackets, and at the top by an old piece of wire. It has held all six monitors securely in place

The bedside lamp is just a collection of old CCFLs from my case modding days that are tied together and wired to a wall wart concealed in the base. One of the blues is switched off to create a warmer light.

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
  • Post-Mortem

    3 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.

  • GitHub Repo is here!

    3 months ago • 0 comments

    After much laziness, here is all of the code for this project in one easy GitHub Repository. it's likely that I missed some things, but I'll be going back and checking that soon. Right now, I'm working on the system that opens the blinds in the morning.

    https://github.com/MachinesInMotion/HomeAutoRepo

  • Enclosures Pt 1

    3 months ago • 0 comments

    Got the printer set up and made some enclosures. I'll let the pictures speak for themselves:

    Base Station:


    Outlet sensor:


View all 8 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)

    My prototype looks gross, so I won't show it here, but a new case is high on my to-do list.

  • 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 a month 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 2 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 3 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 3 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]