I purchased an imp in Dec '12 and using an April board and a simple transistor - relay circuit, created a garage door opener that I control by sending HTTP from an IOS app. The circuit worked fine for a few months, and then failed. I didn’t pay a lot of attention to it until recently when I decided to pick the project up and troubleshoot it.
I am using a single pin as a digital pull up to power the transistor and switch the relay. If there is no load on the pin, and I switch it, my meter reads 3.24v, which is correct. As soon as I add any load to the circuit, the voltage never goes that high. For example, connected to my relay circuit, I read .67 volts when the pin is set high, and when connected to a simple resistor-led circuit, I read 1.76 volts.
The first April board that I used was from Sparkfun, and I ordered one from Adafruit as well, after thinking that I may have damaged the board, but the new board does the same thing.
Any ideas? Is my imp itself damaged? Why would the pin not go to 3.3v under load?
This is the code that runs on the imp. The IOS app simply sends an HTTP GET with ?value=2
// 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);
server.log("Setting PIN 9 == HIGH.");
// Wait one second
imp.sleep(1.0);
//Switch pin to LOW
hardware.pin9.write(0);
server.log("Setting PIN 9 == LOW");
}
}
}
// Configure pin 9 as an open drain output with internal pull up
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.