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 project I 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.

49 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 #

  11. Great idea. Could use an accelerometer chip instead of a piezo to detect knock.

    Comment by px-2 — August 21, 2008 #

  12. How about taking a webcam apart, and mounting the lens inside your peephole? Then, when the doorbell is rung, you can be emailed, or even MMS’d an image of the person at the door…

    Comment by richieacc — August 21, 2008 #

  13. Knock-detectors: do-it-yourself and commercial.

    Comment by Wim L — August 21, 2008 #

  14. Let me compare that to my setup :-)
    When someone rings the doorbell and i’m not at home a popup on my PC opens and shows the person at the door (when the PC is online). Otherwise I get an email with the photos. The doorcom calls my mobile phone and I can talk to that person. Of course I can open the door remotely… Or the garage when a mailmal wants to leave a parcel…

    Comment by jb — August 22, 2008 #

  15. I’ve been reading all this stuff, and I have to say it – hand on heart. You people really should get out more.

    Comment by Martini — September 11, 2008 #

  16. But if I’m out, how am else am I supposed to know if someone has rung the doorbell unless it’s being logged on the internet?

    Comment by roo — September 11, 2008 #

  17. Hi there – I stumbled across this article and became very excited… exactly what I’ve been looking for.

    I’m still trying to figure out how the code “sketches” work… but have a solid background in C/C++, C#, Java, so should be no problem.

    However, when the device receives the serial data from the push button, how are you calling your other script that sends the e-mail? It’s this command:

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

    Where is the file “curl” located and how do you call that from the code on your controller device?

    Thanks!

    Comment by Patrick — January 3, 2009 #

  18. curl is a tool for talking to web servers. In this case (via the -d option) it’s being used to make an HTTP POST. The computer I was using as a bridge from the Arduino to the web is a Mac, which has curl ready to go on the command line. If you’re using any sort of Linux, it should Just Work, otherwise you’ll want to find a copy of Curl or handle the HTTP POST in whatever way is most comfortable for you.

    Comment by Roo — January 4, 2009 #

  19. So, do you have a separate app on your Mac that reads the serial data from the Arduino when the button is pressed?

    It doesn’t look like the Arduino language has much to it, unless you extend it with your own C/C++ code.

    My idea was to have some application on the PC listening to the Arduino COM port for any data that it sends, and then handle the “ring” accordingly. In my case, I don’t want to POST anything anywhere, just send an e-mail from the local machine.

    Comment by Patrick — January 4, 2009 #

  20. Yep, that’s right. The Arduino is good at interfacing with hardware, but when I want to use an input to do something webby I had to read the serial line and handle the event on a computer.

    A nice alternative, if you want to avoid having a computer running the whole time, might be to use an Ethernet shield which plugs into your Arduino like this one from Nuelectronics or this (announced but unreleased) one from Tinker.

    I have not played with an Arduino Ethernet shield yet. From what little I know about the Ethernet shields, I’d imagine that using one to send an email should be pretty straightforward. I’ve been jealously watching Nick’s experiences with a pre-release one from Tinker. He gave a great presentation at HomeCamp which is well worth watching.

    Comment by Roo — January 4, 2009 #

  21. Was just googling for wireless doorbells and your blog came up. The internet is a tiny place I tell yer! Nice geekout, well done.

    x
    Katie

    Comment by Shinykatie — January 14, 2009 #

  22. I’ve recently built one of these for my Windows server at home. Found your site when looking for suitable code to run on the Arduino — thanks for that!

    @Patrick – I had to write some Perl code to listen to the incoming serial stream and do something based on that data. My write up and Windows-compatible Perl code is here if you’re interested…

    http://www.grantgibson.co.uk/blog/index.php/2009/03/29/putting-doorbell-online/

    Grant

    Comment by Grant Gibson — March 30, 2009 #

  23. Hello colleagues, good piece of writing and nice
    urging commented here, I am in fact enjoying by these.

    Also visit my homepage – 7zip download xp chip

    Comment by 7zip download xp chip — January 15, 2014 #

  24. Great site. Plenty of useful information here.
    I’m sending it to some friends ans also sharing in delicious.
    And certainly, thank you for your effort!

    Comment by european university accredited — January 18, 2014 #

  25. I was able to find good information from your blog posts.

    my homepage: best online games of aall time (the-pluc.net)

    Comment by the-pluc.net — January 20, 2014 #

  26. I have been browsing online more than three hours today,
    yet I never found any interesting article like
    yours. It is pretty worth enough for me. Personally, if all webmasters and bloggers
    made good content as you did, the internet will be much more useful than ever before.

    Comment by men polo t-shirts uk — January 20, 2014 #

  27. Howdy! Someone in my Facebook group shared this site with
    us so I came to look it over. I’m definitely loving the information.
    I’m bookmarking and will be tweeting this to my followers!
    Fantastic blog and great design and style.

    my web blog – printable fire safety tips for kids [Kandice]

    Comment by Kandice — January 24, 2014 #

  28. It is perfect time to make some plans for
    the future and it is time to be happy. I’ve learn this post and if I may
    I wish to counsel you some fascinating issues or tips.

    Perhaps you can write subsequent articles referring to this article.
    I wish to read more issues approximately it!

    my blog :: CSR Racing Cheats (Octavio)

    Comment by Octavio — January 27, 2014 #

  29. When it comes to living a long and healthy life, there are
    two necessary ingredients: diet and fitness.

    There aren’t many food allergy diary apps out there, but if that is what you want from
    a food diary then Food Allergy Detective is definitely the
    best. For lunch you can have a salad, a turkey sandwich on wheat
    bread, or you can go with a meal if you are eating out.

    Review my homepage: how to have a smaller waist – Marla,

    Comment by Marla — January 29, 2014 #

  30. You have to be careful here as the sizing isn’t consistent amongst manufacturers.

    The CFM measure is useful for determining the vacuuming ability.
    Human beings would have a greater chance at a longer lifespan if the world’s air and water were cleaner and
    free of chemicals.

    Comment by http://yfrog.com/ — February 5, 2014 #

  31. Do not believe the tag stamped for the jewelry like 14 karat or 18
    karat because that might be done easily. I need to say, they really have a very lot of cheap deals
    going on at the website, I recently bought my partner a sharp looking Beaded Bauble Bracelet for under $20.
    You should use soap to your minimum since some soaps can contain heavy chemicals, which slowly degrade your silk fabric.

    Comment by Marylin — February 6, 2014 #

  32. Link exchange is nothing else except it is simply
    placing the other person’s web site link on your page at suitable place and other person will also do similar in favor of you.

    Review my blog

    Comment by Twitter hack — February 18, 2014 #

  33. Hmm is anyone else experiencing problems with the images on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.

    Any feed-back would be greatly appreciated.

    Feel free to visit my website Read Full Article

    Comment by Read Full Article — April 30, 2014 #

  34. I know thi if off topic buut I’m looking into starting my own
    weblog annd was curious what all is needed to get set
    up? I’m assuming having a blog like yours would cost a pretty
    penny? I’m not very internet ssmart so I’m not 100% certain.

    Any recommendations or advice would be greatly appreciated.
    Kudos

    Take a look at myy web-site – acne scars best treatment

    Comment by acne scars best treatment — May 10, 2014 #

  35. El Albacete está siendo una de las notas positivas de este arranque liguero.

    Comment by juega y gana — May 28, 2014 #

  36. Wow! At last I got a webpage from where I can genuinely get helpful
    information concerning my study and knowledge.

    Comment by Best elliptical 2014 — May 28, 2014 #

  37. C’est incroyablement un plaisir de vous lire

    Comment by blog.com — June 1, 2014 #

  38. These may either be caused by the process of baking or the quality
    of breadmaker itself. “Check this out this review site: Bread Maker Reviews. Best thing about bread maker is that we get fresh breads out of it and as long as the bread is baking we keep waiting for it in anticipation.

    Comment by Zojirushi Bread Maker Amazon — June 15, 2014 #

  39. Colorfully dressed and huge defense contractors give people the ability of the owner doesn’t have to work with large
    corporations and government officials all together, and Accurate Steel Installers, Inc.
    They may have gone up to homeowners on their GSA Schedule Contract
    to be used. What is consumers an answer to get your money is safe.
    A new social network has been noticed and observed that the team of experts before choosing any Residential contractor consumers as and when you are
    considering.

    my web page – website (Glen)

    Comment by Glen — June 22, 2014 #

  40. Attractive part of content. I simply stumbled upon your blog and in accession capital
    to claim that I acquire in fact enjoyed account your blog posts.
    Anyway I’ll be subscribing on your feeds and even I fulfillment you get entry to constantly quickly.

    Comment by www.amazon.com — July 4, 2014 #

  41. Hello there, I found your blog via Google whilst
    searching for a comparable topic, your site got here up, it seems good.

    I’ve bookmarked it in my google bookmarks.
    Hello there, just turned into aware of your weblog through Google, and found
    that it’s truly informative. I’m gonna be careful for brussels.
    I will be grateful when you continue this in future. A lot of other folks will probably be benefited from
    your writing. Cheers!

    Comment by Perry — July 9, 2014 #

  42. Choosing the right moving company to help you make a move in your near future is
    imperative if you want an easy and smooth move. That is reason for hiring moving companies that are able to help you
    transfer easier during this time. The movers also must protect consumers’ goods
    by maintaining cargo liability insurance, workers’ compensation insurance, and bodily injury and property damage insurance.

    Review my blog: vero jensen beach movers

    Comment by vero jensen beach movers — July 11, 2014 #

  43. After failing to open the entrance by all means, you then wish that you had an extra key.
    Broadcast Journalism – Broadcast journalism majors seeking associate degrees often work in television or radio.
    Homeland Security is an executive federal government department (DHS) designed with the purpose to prevent, detect, respond
    to, and recover from acts of terrorism, and also
    respond to natural disasters. A knife may be as short as about 1 inch and as long as 4-5 feet in the case of some swords.
    Does your telephone service have emergency options to ensure
    you don’t miss any phone calls.

    Here is my site what are the 37 vital food items

    Comment by what are the 37 vital food items — July 13, 2014 #

  44. Good post. I absolutely love this site. Stick with it!

    Comment by job appoint — July 18, 2014 #

  45. Have you ever considered publishing an e-book or guest
    authoring on other blogs? I have a blog based on the same information you discuss and would really
    like to have you share some stories/information.
    I know my subscribers would enjoy your work. If you’re even remotely interested, feel free to shoot me an email.

    Feel free to visit my web-site; HGH Pro Supplements (http://www.alliedpackaging.com)

    Comment by www.alliedpackaging.com — July 19, 2014 #

  46. Anytime you get near a gun, assume that it is loaded.

    Level 26 You should have finished the desert quest by now, if not, make a few more BPs of hmms and sell
    them, and get enough money for a promotion. The only real option is strength training for bow hunting.

    Comment by Linnea — July 19, 2014 #

  47. Hi there exceptional blog! Does running
    a blog similar to this take a lot of work?
    I’ve absolutely no understanding of computer programming but I had been hoping to start my own blog in the near future.
    Anyway, if you have any suggestions or tips for new blog
    owners please share. I know this is off sbject nevertheless I just
    had to ask. Many thanks!

    my homepage … web hosting ecommerce merchannt account
    (Grady)

    Comment by Grady — July 23, 2014 #

  48. Aw, this was a really good post. Taking the time and
    actual effort to make a good article… but what can I say… I hesitate a whole
    lot and don’t manage to get nearly anything done.

    Comment by http://quietcomplement84.webs.com/apps/blog/show/42297806-breakup-help-on-the-way-to-handle-an-impending-breakup — July 23, 2014 #

  49. Good way of describing, and fastidious article to obtain information concerning my presentation topic, which i am going to convey in school.

    Here is my blog post … شركة نقل اثاث الرياض

    Comment by شركة نقل اثاث الرياض — July 28, 2014 #

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.