10 December 2010

Cellphone remote control, just an idea

A very close family member has asked me how it would be possible to switch on (electric) heating in a remote location. Through a phone call, of course, I replied. Requirements are pretty simple: I would have to close a relay, maybe open it back.

The location has a landline, but I have not found useful references online on how to interface with it (is that considered a pre-Internet era technology?!). So, let's go mobile.

Take a cellphone that allows to customize the ring tone depending on the caller:
  • associate a fixed tone sound to one calling number: this will be the "ON" triggering event;
  • associate a different fixed tone sound to another calling number as "OFF" triggering event;
  • associate a third, no-sound, ringtone to all other numbers (default).
So if you want to switch ON and OFF, you'll need two different numbers to originate the call, both with Caller-ID enabled. Not a big deal. You could even block all other incoming calls, if the phone allows it.

Next, build some simple hardware to detect those two tones and throw them into a simple set/reset system that drives the relay. Or make it with a microcontroller. The latter solution would allow some feedback on the relay state if the cellphone can be configured to auto-answer a call: let the circuit emit two different sounds depending on the relay state (or Morse code!). Maybe don't let it beep forever, so neighbors won't get annoyed.

Note that this "interface" can be arranged without harming a cellphone, because the audio coupling can occur over the air (yes, the location is quiet and empty).

Let me look for some sound recognition sample code for AVRs... :-)