Hacking the doorbell

I bought a new doorbell. It actually came as a set, with two ringers. One is battery operated and the other is mains powered, plugging straight into the wall. I once again find myself attempting to keep up with Nick. Having seen his doorbell projectI knew exactly what I had to do: it was time to hook my doorbell up to an Arduino board and put it on the internet.

Repurposed

The red wire is +3V, the black is ground. The doorbell chime unit used to draw its power from two AA batteries, so now it gets the same three volts from the Arduino instead.

The short dangling white wire is actually the antenna for wireless reception of the signal from the remote button, while the long white wire once completed the circuit to the buzzer. The Arduino treats it as an analog signal (and uses the built in pullup resistors to ’steer’ the input to high). I should probably use it to drive a transistor to close a digital switch instead. This way works for now though.

The USB cable currently supplies the power and also acts as a serial line, down which the message that the doorbell has been triggered is sent. Eventually I’d like to use an ethernet shield, or even an ethernet-enabled Arduino like this one (which I do hope will be available soon!).

Here’s the Arduino sketch (tweaked slightly from Nick’s blog post).

int ledPin = 13;   // LED connected to digital pin 13
int potPin = 0;    // white doorbell wire to analog pin 0
int val = 0;

long time = 0;
long debounce = 5000;

void setup() {
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Serial.begin(9600);           // open serial port at 9600 baud
  digitalWrite(14 + potPin, HIGH); // set pullup on the analog pin
                                // (analog 0 = digital 14, a1 = d15, etc)
}

void loop() {
  val = analogRead(potPin);
  if (val < 100) {              // if the circuit is completed
  // (for me, it generally drops from 1023 to ~ 15 when 'ringing')
    if (millis()-time > debounce) {
      Serial.println("ON");
      digitalWrite(ledPin, HIGH);   // sets the LED on
      delay(500);                   // ...wait for half a second
      digitalWrite(ledPin, LOW);    // and turns the LED off
      time = millis();
    }
  }
}

To hook it up to my house’s twitter feed, I just need to open the serial line on the attached computer, doing something like this every time a new line is added

curl -u email@example.com:password -d status="There's somebody at the door" http://twitter.com/statuses/update.xml

Update: it’s now housed in an Altoids tin.

10 Comments »

RSS feed for comments on this post.

  1. I have a very similar wireless doorbell, but obviously without this extreme modding. Sometimes my doorbell chimes when there’s no one there. It is very scary. Just thought I’d warn you.

    Comment by infobunny — May 14, 2008 #

  2. Thanks. Actually, my previous wireless doorbell did that too. I guess the radio signal is prone to interference.

    Comment by Roo — May 14, 2008 #

  3. You should fix up a simple webcam to it, so that it takes a snap of your visitor and posts it to a flickr stream. Kind of a ‘Who’s at Roo’s?’.

    Comment by Kim — May 14, 2008 #

  4. That would be fun. I’m also thinking it would be helpful to know when ‘attempted deliveries’ were no such thing. I’m convinced I frequently get a “sorry we missed you” slip through the door when the delivery person has neither rung the doorbell nor knocked on the door. It might be a bit geeky to use my timestamped database of doorbell events as evidence when complaining though.

    Comment by Roo — May 14, 2008 #

  5. “neither rung the doorbell nor knocked on the door.”

    That has got me thinking… we need a vibration sensor for the cases where the visitor doesn’t ring the bell but knocks instead. Could also be used to spot things being posted through the letterbox.

    Comment by Nick O'Leary — May 14, 2008 #

  6. Yes.. as I typed it I was thinking of piezo elements. I wonder if I could mount something in the wooden panel next to the door, and still pick up enough vibrations when the door is knocked…

    Comment by Roo — May 14, 2008 #

  7. It seems that you might be able to get away with some sort of sound detector or something.. you would have most of the same problems with the analog nature of sound versus the analog nature of a vibrations. By that I mean to say that “when is a knock not really a knock?” (via sound.) But you would have to solve that question using vibrations, also, no?

    Comment by Chris — May 25, 2008 #

  8. It needs a converted cellphone with camera , so I can answer the door where ever I am, then a SMS operated door opener I can always be in for the parcels guy :-)

    Comment by Geoff — May 26, 2008 #

  9. I always wanted an outside door mat that weighed whoever was standing there :-)

    Comment by Geoff — May 26, 2008 #

  10. The hidden scales sound like fun. Combine it with a rangefinder and you could offer visitors a meal based on their Body Mass Index.

    I was actually looking at SMS operated door locks the other day, thinking that it would be handy to be able to go out without having to take keys. (Especially as I’m better at remembering my phone than my keys). My wife wasn’t convinced. In fact, she said “I’m not paying 10p every time I want to open the front door”.

    Comment by Roo — May 27, 2008 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
The postings on this site are my own and don't necessarily represent my employer's positions, strategies or opinions.