Friday, December 11, 2009
Christmas Light Control On Your Phone!
About a year ago I bought an ioBridge module from ioBridge. The ioBridge acts as a stand-alone interface between the internet and various sensors and devices. I've used it for a variety of purposes in the past, mostly data logging, but found a new use for it during the holidays. I purchased several mechanical relays which I used to take digital output (1's and 0's) from the ioBridge, and switch an AC current. You can make the relay boards yourself very simply by doing a search on google. ioBridge also offers pre-built relay boards on their website. I won't go into details about the relay boards here. In short, I spliced open an electrical cord, hooked it up to the relay, and plugged a power strip into the electrical cord. It is into the power strip that the christmas lights connect.
Now turning the lights on and off is simply a matter of sending a signal to the channel to which the relay is connected. ioBridge offers an web interface in which you can create simple "widgets" to control/monitor your sensors and devices. They also have API support so that you can use other web-based programming languages to interface with your devices on your own server.
For my purposes, I took advantage of a php proxy script ioBridge offers on their website. The script functions as an easy way to use HTML links to communicate with the ioBridge module. The script is called iobridge-proxy.php and lies in any folder on your host server. Then you can use a hyperlink of the form:
http:\\www.yorserver.com\iobridge-proxy.php?widgetID=#########&state=1
Where in place of the ######### would be the ID number for the widget you created on the ioBridge website for your device. In the example above, I switch the digital output to "1". I could switch it to "0" also.
Now if you have a iPhone, or any other phone with web browsing capability, you can just type in the link in your browser to control your devices.
That's it! Now, I admit it's not the "cheapest" option since the ioBridge runs for $99. However, the ioBridge is a very flexibile platform that you can use to interface with almost any electrical device you can think of, including microcontroller projects.
Subscribe to:
Posts (Atom)