I set out to develop a simple android application to turn my phone into a "virtual" garage door remote, with the requirements that the application only successfully function when / if I am within a 1 block quadrant of my home, and be protected by a pin code. Both of these requirements help to prevent accidental opening / closing of my garage both at home, or in some remote location half-way around the world. You will see the end product from the application side in the youtube demo video at the end of this post.
I happen to have an old linux box running as a mail / web server in my garage that also has a serial port. So I said to myself, "self", wouldn't it be cool if I could interface the serial port on the linux box to a relay switch that would enable me to send commands out, via the serial port, to toggle the relay switch on/off, with the goal of mimicking the button press of a garage door pad on your garage wall, and control all of this via my phone?
So, I picked up a cheap serial port relay controller and connected it to my linux box's rs232 port. The controllers are available in a variety of interfaces, such as USB, ethernet, etc, but for me, serial was the way to go due to my existing setup, and ease of programming to the port, etc.
I then wrote a set of serial port communication classes in PHP for sending the necessary commands out the serial port, as outlined in the relay controller's specs, for toggling the relay on/off.
I tie it together by having the android application I wrote first look for the correct PIN code and geolocation, and when correct / within range, present a "virtual remote" on screen. When the remote is pressed, it makes an HTTP call to the webserver in my garage, that when called successfully issues the necessary serial port commands to toggle the relay switch.
The end result? A pretty bad ass virtual garage door opener app I call "OpenSezMe" that allows my phone to double as my opener. When I go on walks, jogs, etc, upon return, I can simply open my garage via my phone for entry back into the house. I know I could install a keypad, but what's the fun it that?
This application is very specific to my needs / setup, so doesn't really have any value for anyone else. I just thought it was pretty cool and figured you guys would too, and, at a minimum, could spur you to come up with something similar, unique to your environment.