All posts tagged Automation

NFC is much more than just a visually impressive way to tap phones and share files. Or from Apple’s perspective, to perform payment transactions, which they claim isn’t appealing so they didn’t include NFC in the iphone 5.

What NFC truly is, is an awesome way to make existing bluetooth device pairing not suck, and to bridge the gap between the virtual and physical world.

NFC is a way to add another level of automation to my world. I currently do things such as tap to connect/disconnect to my home stereo and my car for handsfree calling.

You might be asking, why not use bluetooth auto connect? First off imagine it’s a new device you’ve never used before, boom one tap and you never had to go through the annoying pairing process. A prime use case is having a party with many friends who have NFC on their phone and ideally a good taste in music. Anyone can easily connect and disconnect their phone from the home sound system and play their tunes. Once again why I can’t believe iphone 5 doesn’t have it. But airplay over ATV is good if you’re an Apple exclusive group.

Second, with auto connect, if you’re in range, you’re connected whether you want to be or not. Now suddenly I’m connected to my stereo when I don’t want to be. The addition of physical control that’s gained with NFC tapping is the key here. I have bluetooth in my living room, my car and my garage. I don’t want hassles of the past where I’d be in my workshop, want tunes only to find I’m left with silence.

Let’s discuss what NFC is and is not:

  • NFC is like RFID in the sense that you can read a small amount of data from it by tapping it to a reader.
  • NFC is unlike RFID, which isn’t secure and can be read using specialized equipment from quite some distance.
  • RFID continually emits a radio frequency whether you’re in the act of using it or not.
  • NFC however only emmits singals when it is in the act of being used.This is possible because the NFC tag literally requires power from the device reading it (such as a phone) in the form of magnetic induction. So in other words, when a reader provides power by way of magnetic induction, the NFC tag is active and readable (even writeable). When there is no magnetic induction, the NFC tag might as well be a regular old sticker.
  • NFC tags use 3DES encryption.
  • NFC is writable 100,000’s of times by the same devices that can be used to read it. No special equipment required.

Now don’t quote me on these security comparisons. I’ve read much to say NFC isn’t that secure, but when you read the specifics of both protocols, NFC clearly sounds like a more solid and interesting solution.

NFC is not a transport protocol such as what Bluetooth or WIFI is. BUT an NFC tag can contain the connection information for a device to automatically connect to a Bluetooth or Wifi access point.

You can see in my video, what I’ve done was:

  • Purchase some NFC tags off the internet. (They’re cheap).
  • Used my smart phone to write some data to the tag.
  • Configured my smart phone to execute some actions when reading the tag.
  • Done. Very simple.

When purchasing NFC tags it is very important that you understand the 4(or more) unique NFC Tag types. Some have different storage sizes. Some are read only.
Some cannot be made read only. Some, specifically MiFare Classic 1k’s will not work with BlackBerry’s as they actually aren’t a standardized protocol and from what I read there’s some funkiness with licensing around them.

See this article explaining NFC Tag Types:

Another thing to consider is what are you trying to do. You can program NFC tags with boring things like website addresses, email addresses, a custom string of data. You can also program them with actual Wifi and Bluetooth connection/authentication details. “Tap here to joint his hotspot”, for example. You can also program the tags using scripting software, which assign an ID to the tag, and uses that ID to execute macros on your smart phone. Depending on what type of data you want to put on the tag, it will dictate what type of tag and byte size you need.

Some uses, such as sticking one to a piece of electronic equipment will require a MiFare Anti-Metal sticker to prevent interference. What’s a good use case here you might wonder? If you have a phone and a tablet, but only one data plan, put a mifare anti-metal on your tablet. Script your phone to turn on its mobile hotspot when that tag is read. Now all you have to do it touch your NFC enabled phone, to your non-NFC tablet and boom you have internet access.

For more examples of neat ways to use NFC I recommend this link:

See this article explaining how NFC technology works:
Where to Buy NFC Stickers? I got mine from here:

First thing’s first, I have an atom based in-dash car PC as demonstrated here. What’s going on here, is when I come home, my car will detect my home WIFI connection. When this happens, and I turn my car off, instead of simply going to sleep, it will connect to my home computer and perform an rsync of all new mp3’s from my computer to my car. When this is done, my car PC will then go to sleep. I have a safety in place which will automatically stop the rsync and go to sleep after 20 minutes. That way if something goes wrong such as poor wifi signal causing crawling speeds, my carpc doesn’t stay on all night and drain my car battery.

Now the key here is how to execute these actions. On linux, or at least on ubuntu, there is a script called /etc/acpi/ This script gets run when you push the computer’s power button, a.k.a when I turn my car off.

IF you use linux, then using the actions I described below, it’s a pretty trivial task to write these actions into yourself. And it’s probably better to rather than to reuse my case specific code.


  • When run, query if the SSID of your home network is present
  • IF not, then sleep
  • IF so, then connect to this network
  • Mount a network share to your MP3 folder
  • Use sleep, or at, a timestamp comparison, or some other method to count down from X minutes.
  • Perform an rsync with the arguments of your choosing
  • Then sleep

A home automation App that I am developing in HTML5

Update with additional info

This slideshow requires JavaScript.

The plan for this app is to not only have an access anywhere, dynamic webUI, but to have an application on my phone, tablet(s) that feel native. Of course I’ll be using HTML5 with Jquery, I’ll also be using Webworks for the phone/tablet app.

Demonstrated in these videos:

  • Thermostat, capable of adjusting temperature and mode.
  • Fireplace control, mostly to be able turn off if paranoid.
  • Generic House Timer, which activates x10 door chimes. Good for various uses.
  • And of course lights. Currently I’m using a heavily modified version of iPHC(iPhone Home Controller). I will be writing this lights portion from scratch to suit my needs better.

Tools like this rely heavily on backend scripts I have running on my Linux server at home. However the concepts behind these scripts are very simple using the CLI interface on an x10 CM15a. The software/daemon I chose to use is Mochad.
In conclusion I’d like to drop a little disclaimer here. The UI is obviously a work in progress and I’m focusing on functionality first. Cleaning it up and making is look pro is an easier task.

Another video that’s a little blurry.