(P)Imp my Doorbell

I’m working on Imp’ing my doorbell such that I get a Pushover notification when the doorbell is rung. The doorbell consists of a button and a wireless battery-operated receiver. It’s the Friedland Libra+. I’ve opened up the receiver and everything is SMD. One of the chips is covered in black epoxy and the other is an RF FSK chip. However, whenever the doorbell is pushed it can be programmed to light up one of 6 LEDs. I thought this would be a convenient place to tap Pin1 of my Imp onto.

The idea was to put the Imp to sleep and then have it woken up when the LED is activated and then send me a Pushover notification. I also thought that Pin 1 was a ‘rising edge’ notification, but it just seems sensitive to +ve level. As a consequence the Imp cycles through waking up, going to sleep, waking up, …

Trying to reverse engineer the doorbell circuitry I think what I’ve tapped onto is the collector of an open-collector output. The collector is linked to the SMD LED and then through an SMD Resistor and up to +3.3V. So, in the (doorbell) dormant state, Pin1/Collector is reading +3.3V (up through the LED/Resistor), but when the doorbell is pushed, it temporarily drops to 0v and lights the LED.

My code looks like this (nothing startling):
`
function logDeviceOnline()
{
local reasonString = “Unknown”;
switch(hardware.wakereason())
{
case WAKEREASON_POWER_ON:
reasonString = “The power was turned on”;
break;

    case WAKEREASON_SW_RESET:
        reasonString = "A software reset took place";
        break;
        
    case WAKEREASON_TIMER:
        reasonString = "An event timer fired";
        break;
        
    case WAKEREASON_PIN1:
        reasonString = "Pulse detected on Wakeup Pin";
        agent.send ("Doorbell Status", "DingDong")
        break;
        
    case WAKEREASON_NEW_SQUIRREL:
        reasonString = "New Squirrel code downloaded";
}

server.log("Reason for waking/reboot: " + reasonString);

}

function DoorbellWakeup ()
{
server.log (“Doorbell Wakeup”)
}

logDeviceOnline();

hardware.pin1.configure(DIGITAL_IN_WAKEUP, DoorbellWakeup)

// wakeup every hour, on the hour

imp.onidle(function() {
server.log (“Hourly Wakeup”)
server.sleepfor(3600 - (time() % 3600));
});
`

How could I modify the connection from Pin1 to the Open Collector to get the inverse effect to what I have now? Thanks in advance.

Dave

You might check out this recent thread which also addressed ‘how to wake the imp with a high --> low state transition on pin 1’ …

http://forums.electricimp.com/discussion/2332/alternative-to-pull-up-for-flipping-pin-1-wakeup-behavior/p1

In essence, the simplest solution would likely be to be add some sort of logic inverter between your OC and pin 1 (either a gate or simple fet-based circuit) to effect the signal inversion.

Larry, thanks for the pointer… will investigate and report back…