This video is an introduction to TaskBomb, my task scheduler app. The video briefly discusses the app's major features and how to automate toggling WiFi and Sync.
A problem that many mobile developers have kicked around at one time or another is how to turn your smartphone into a universal remote. Imagine how great it would be to use your phone to control appliances like televisions, stereos, even air conditioners and space heaters. Many begin by asking a question like "the Droid doesn't have IR built in, does it?" No it doesn't, but as I'll explain it wouldn't even be the best solution if it did.
What follows is an overview of how I'd like to see IR control implemented using smartphones and tablets.
Why IR built into the phone isn't enough
As someone interested in home automation, simply building IR into the phone doesn't do it for me. Sure I'd love having a laugh with my mates at the pub by changing the station on the telly with my mobile, but that's about it. Also I'm not even British.
While most of the implementation I advocate in this article could be repurposed for this kind of built-in use (as I explain at the very end) for every other use case it'd be better to have a standalone IR unit controlled wirelessly, a wireless IR blaster.
- Line of site issues are inherent in IR remotes, but not wireless ones. You have to be in the same room for starters, which is already quite limiting; you also need the correct angle and no obstructions.
- With built-in IR it would be impossible to control multiple appliances, unless they happen to be right next to each other.
WiFi vs. RF
So doing it wirelessly is a slam-dunk, but should we use WiFi or RF? I say WiFi. RF is what we use for radio-controlled cars and garage door openers, and in some ways it's the natural choice for this application. It has some disadvantages though:
- Transmitting RF would require an additional piece of hardware for your phone or tablet.
- RF is not as reliable and is prone to interference.
- WiFi using TCP can be very reliable. Application programmers can handle errors however they want, trying again in 30 seconds for example.
- RF is not readily integrated with modern computer and network infrastructure. Imagine having a few WiFi IR blasters, each with its own IP address. You could scan the network to find them, connect to them via a web interface, and control settings like signal amplification and the device's name. WiFi devices on a home network could also be exposed to the internet and controlled when away from home. All of this is not possible with RF.
- With RF you need to pair transmitters with receivers by frequency so things don't get mixed up. This complicates things significantly.
So what are we transmitting?
Since I've decided on using WiFi, I'm inclined to transmit some kind of digital audio format. This may sound strange, and I won't go too much into why this works, but it's pretty easy to capture IR signals as audio and later convert them back into IR. See this tutorial if you want to learn more about how this works and how to build it.
Using this kind of general representation for the signals means there's no hassle of worrying about different IR protocols. Using digital audio specifically has some more benefits:
- Availability of programming libraries for manipulating digital audio. I built a crude infrared to WAV converter in Java in a weekend. I've been thinking of polishing it a bit and open-sourcing it.
- One can find many resources for assembling the WiFi receiver since it's similar to a multi-room music system, with a few differences. The required amount of buffering memory is much less (IR signals will be only a few KB) and instead of speakers you'd use IR LEDs.
- If you did decide you wanted IR built in to your phone, you could build or buy one of those little attachments (for example this or this) that hooks into the audio jack and use the same converter software for both the built-in and wireless forms.
TaskBomb is my task-scheduling / automation app for Android. It can theoretically do anything your Android device can do. It gets a little trickier in practice, but it's being rapidly improved. There's already enough functionality to build one great alarm clock. My personal alarm includes waking up to streaming radio (or a backup if that fails), having the volume gently increase, and switching to a playlist of nostalgic songs to get me out of bed if I still haven't after 10 minutes. 
With the announcement of Android@Home and the Android Open Accessory API this app comes just at the right time. TaskBomb's unique scheduling system is well-suited for automating things around the house. Imagine a space heater that begins making your bedroom toasty and warm 15 minutes before you wake up to your favorite internet radio station. Meanwhile your curtains slowly open to let the sun fall on your face. You hit the snooze button on your Android phone to delay the music for another 9 minutes while you lay back in the sun like a happy cat. The possibilities are endless.
1. The nostalgic songs thing works by the way. It gets my heart racing and before I know it I'm wide awake. I try to only use it when I really need it, like the Philadelphia Flyers and Kate Smith. If you try this method, here's a song you might want to add to your playlist.