Wednesday, December 3, 2008

Iphone as a Universe Controller: Part 1

Why have a universal remote control when you can have a universe controller? I was fortunate enough to get to beta test some of ioBridge's forthcoming hardware. Their hardware lets you connect just about anything to the internet. The possibilites with these things are just about limitless. I am convinced I can control just about anything in my house with this little board and my iPhone. The company has a number of premade "smart boards." The modules also have input/output pins so you can get any of your microcontroller projects online. I wanted to put together a few simple progects based on their smart boards. I got a x10, light sensor, and a servo smart board. I made a little gizmo with each one. In this write up I'm going to talk about the gizmo I made with their servo smart board.  In my next post I'm going to demonstrate how to control you home lights. Then I will post about how the ioBridge module can be used to lock your computer and update your twitter feed automatically when you leave the office. 

I have a dog that stays home alone while I am at school. I thought it would be nice to be able to check up on my dog Cooper during the day, and even better if I could give him a delicious doggie treat. With the ioBridge module, a servo smart board, and some random parts around the house I was able to put together a dog watching, treat giver that is all controlled with my iPhone over the internet. The whole project took about an hour and because of iobridge's simple internet interface no programing was required. 

Here is a video (youtube link) of the finished project. Below the video are my detailed instruction about the project.

Finished project in action

Here's what I used:
ioBridge I/O module
ioBridge servo smart board
old CD spindle case
cardboard scrap
large syringe plunger
scrap wood
webcam (just used for visual confirmation that treat was delievered)

ioBridge servo smart board

I started by cutting a hole in the top of the old CD case for the axel of the servo to fit through. With some scrap wood I mounted the servo above the case.

Old CD spindle case with servo attached to top. The windows in the side are for loading the dispenser with treats

I cut the plunger to a length about a quarter of an inch shorter then the interior of the old cd case. After super gluing the servo's detachable wheel to the top of the plunger I glued square cardboard scrap to half of the plunger at 45 degree angles. I made some triagnles out of wood and used them to keep each of the fins seperated by 45 degrees. While the glue dried I cut a pie shaped wedge in the board that was the same size as the wedges created by gluing the cardboard at 45 degree angles around the plunger. 

Syringe plunger with cardboard fins attached at 45 degree angles

Bottom platform with hole cut for treat to drop through

Once the glue dried I attached the plunger to the servo and connected the servo to the ioBridge I/O modeule via the servo smart board.

View of bottom of housing with plunger assembly attached to servo

Assembled device

I followed the simple ioBridge instructions for getting their board online for the first time. Using the ioBridge web interface it was simple to create a widget that controlled the servo. At the end of the widget wizard it automatically saved the buttons that controlled the position of the servo in my ioBridge dashboard (the dashboard is your home page once you log into the ioBridge website). The wizard also outputs javascript incase you want to embed the controls in your own page as I did. 

Screen shot of widget builder 

With all the javascript their site gave me it was no time before I had a webpage that I could access from my iPhone. I could have just pasted the javascript they gave me into notepad and saved it as an html and had controls that would control my device, but I wanted a little something more. I optimized it to be viewed on my iPhone and embedded a feed from a streaming webcam I placed over Cooper's kennel. Now I could see what my dog is up to when I'm away. I saved the website to my iPhone's home screen, and in less than an hour and a half from starting the project I had a web app on my phone from which I could view my dog and give him delicious, steak flavored treats. 

Icon on iPhone home screen and then view of the web app I created using the ioBridge generated javascript. The picture of my dog is from a streaming webcam.