Remote Cellular Switch

From AD7ZJ Wiki
Revision as of 08:14, 21 December 2014 by Elijah (talk | contribs)
Jump to navigation Jump to search
DIY GSM Remote Switch

My airplane is equipped with an oil sump heater which can be turned on an hour or so before flight to warm up the oil, leading to quicker lubrication at startup and hence less engine wear. Leaving it on 24/7 doesn't seem to be a good idea though, so there is the problem of getting it turned on before flight long enough to warm things up. That's what this little gadget is for. By sending an SMS to its phone number, the preheater can be turned on for a specified amount of time or at some point in the future.

I based this on a raspberry PI. They have plenty of GPIO and a 3.3v level RS-232 port which is perfect for communicating with most of the GSM modem chips out there. After I started I found this little guy which plugs right into a raspberry PI no extra wiring necessary: http://imall.iteadstudio.com/raspberry-pi-gsm-add-on.html

The SIM900 has a pretty simple interface using the standard 'AT' commands. I wrote a pretty short Python program to set the SIM900 up and then react to the messages. The best way I found to do it is put the module in a sort of 'asynchronous' mode so incoming text messages are output as soon as they come in. It replies to valid commands with a confirmation message. The following commands are supported:

  • On switchID [time] duration
  • Off [switchID]

Currently there are two switchIDs, 1 and 2. Duration is in minutes and the time format is hh:mm. Use 24hr time. If no time is specified the switch turns on immediately. If no switch ID is specified in the 'off' command, all switches get turned off.