EDIT - Dec 19*******************
I just finished an imp project in which I use an imp in an April board to open/close my garage door. Since I also do IOS programming I made a iPhone app with a nice little momentary button to control it. This is a really easy project, assuming that you can solder and follow an electronic circuit schematic. You probably aren’t here if you can’t.
If there is a lot of interest, I’d be willing to look into submitting an IOS app to the Apple app store for this. I need to find out if I can use the electric imp logo and name in the app first, however.
For the hardware piece, you can purchase everything you need at Radio Shack. I found this really nice circuit layout for an arduino project, and it is exactly what you need. (Except that I had to swap out the 1K resistor with a 560 ohm, as the 1K was not driving my transistor hard enough to power the relay coil.)
Here is a link to the schematic:
http://playground.arduino.cc/uploads/Learning/relays.pdf
Pin 9 on the April impee goes to the resistor.
GND goes to GND on the impee.
V+ goes to VIN on the impee.
Then I made a simple switch program with three values that could be set by the HTTP IN program. I only use value “2” for this project since I want a momentary “On” for the garage door opener.
I’m a total n00b here, but this is the code I used, and it works:
// Garage Door Opener for HTTP control
// input class for Switch control channel
class input extends InputPort
{
name = "Switch control"
type = “number”
function set(value)
{
// Momentary On/Off for Garage Door App
if(value == 2)
{
//Switch pin to HIGH
hardware.pin9.write(1);
// Wait one second
imp.sleep(1.0);
//Switch pin to LOW
hardware.pin9.write(0);
}
}
}
// Configure pin 9 as an open drain output with internal pull up
//hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP);
hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP);
//Set pin 9 to LOW initially
hardware.pin9.write(0);
// Register with the server
imp.configure(“Garage Door”, [input()], []);
// End of code.
`