13 Apr 2008

Following Andy’s example, I have setup a twitter account for my own house to share its thoughts with the world on.

So far, it is busy twittering the changing temperature of my living room, as measured by the CurrentCost meter. At the moment it only tweets when the temperature changes at least 10 minutes since the previous change. This reduces some of the noise, but I think there is more to do. I don’t necessarily care if the living room is 16°C rather than 17°C but do care if it is too cold or hot. This is a subject I will come back to another time once I have done some more experiementing.

More immediately, I set myself a challenge this weekend; to get the doorbell twittering.

To begin with I bought a cheap wireless doorbell set from Wickes to play with. This came with two receivers; a portable battery-powered one and a mains-powered one. Wasting no time I took one of them apart to find this:

The circuit has a very conveniently packaged daughterboard containing the wireless receiver. The clue was the aerial connecting to it (the white wire to the right) and even better, in the top left corner are the four pins connecting to the rest of the circuit. With my trusty multimeter, and the labels printed on the board, it didn’t take long to work out the leftmost pin is ground, the rightmost pin is +3v and the other two are the magic data pins.

With my newly acquired arduino, itself a topic for another day, I hooked-up the four pins and fairly instantly had the arduino writing over its serial link to my laptop whenever the doorbell button is pushed. Of the two data pins, I found the one labeled “DAT” is the best trigger to use; the other one, “IDEL”, seems to be more noisy and needs investigating.

The doorbell lets you pick from one of 15 channels to ensure you don’t get interference from the neighbours. It also lets you pick one of three chimes to use, from the traditional ding-dong to the full Big Ben. As that setting is on the button itself, it must be sending it over the wireless signal. Currently my circuit triggers regardless of the channel setting of the button. I assume I need to do some more signal analysis on both the DAT and IDEL pins to figure this part out. For now, it works enough to prove the idea.

Here is the sketch I used. It does some simple debouncing by not triggering twice within 3 seconds.

int potPin = 5; // Connected to 'DAT'
int val = 0;

long time = 0;
long debounce = 3000;

void setup() {
  Serial.begin(9600);
}

void loop() {
  val = analogRead(potPin);
  
  if (val > 0) {
    if (millis()-time > debounce) {
      Serial.print("ON:");
      time = millis();
    }
  }
}

From this point, a bit of python and mqtt magic and the doorbell would be twittering. I say “would” as I haven’t done this final piece of plumbing yet. I only have one arduino at the moment and I am not yet ready to dedicate it to any one task. Clearly I need to order a second arduino – its always good to have separate development and production systems.

  1. Chris HodginsApril 13, 2008

    Nice work! Maybe the SLUG + the serial-to-usb connection might do the trick. Instead of buying another arduino.

  2. nickApril 13, 2008

    Thanks Chris.

    A SLUG isn’t a replacement for the arduino – although I may well be buying one soon to connect both the currentcost and the ‘production’ arduino into.

    I will post soon about the arduino and my many plans for it.

  3. Andy Stanford-Clark • April 13, 2008

    You might want to think about “banding” the temperatures… my gym temperature is banded into “very cold”, “cold”, “warm”, “perfect” (for excercising), “hot”, and “very hot”. THat makes the channels far less chatty, and somewhat more interesting than just numbers…

    And BTW, because I can control the heater in the gym, when I tell the system I want to go and exercise, it heats the gym up until it’s “perfect” and then notifies me πŸ™‚

  4. James TaylorApril 13, 2008

    Very much looking forward to the Aduino post, especially if it includes MQTT!

  5. ben • April 14, 2008

    fantastic work!

    the current temp is useful for alerting me when there may be a fire at home… like a modern smoke alarm

    would love to hear your thoughts on gas usage tracking… one thought i had was to use computer vision (http://opencvlibrary.sourceforge.net/) with a very high frames per second webcam

  6. nickApril 14, 2008

    Gas usage is an interesting one – and is something I definitely want to track to be sure to get the whole energy-use picture.

    I will write a post on this once I’ve done some investigating and experimenting.

  7. RooApril 20, 2008

    Excellent post!

    By the way: “It also lets you pick one of three chimes to use …. As that setting is on the button itself, it must be sending it over the wireless signal.”

    That’s just weird. Does this allow visitors to pick which chime they want to use, or is it a secret hidden feature. Seems surreal to pick at the button rather than the bell.

  8. nickApril 20, 2008

    @roo – it’s a hidden switch inside the button battery compartment. As you can have multiple receivers there is something to be said for only having to pick the chime in one place – but it evidently does complicate the signal it has to send out.

  9. pingback from Current Cost « The lost outpostApril 27, 2008

  10. pingback from Setting up my Current Cost Meter | Chris Dalby Untangles NetworksJune 15, 2008

  11. RudiJune 24, 2008

    β€œIt also lets you pick one of three chimes to use …. As that setting is on the button itself, it must be sending it over the wireless signal.”

    This is for using more than one button, i.e. at the front door and at the back door. Each button (location) thus can have its own melody.

  12. nickJune 24, 2008

    Rudi: it seems so obvious when you say it. Thanks for pointing that out!

  13. InsteonOctober 31, 2009

    Nice use of a basic wireless doorbell to accomplish this! I had to work harder than I thought I would to get my basic 120v doorbell to pass off the signal to the EZIO for my computer to read it. I like the simplicity of this approach and using an Arduino earns you bonus points. πŸ˜‰

  14. pingback from Hacking the doorbell – Roo ReynoldsNovember 11, 2010

  15. DANE • January 11, 2012

    Hoping to do the same with a wireless driveway alert. You say you hooked up all four pins to the Arduino? I don’t have one yet and was hoping not to tie up four input pins with one device…is this necessary?

    Thanks

  16. nickJanuary 11, 2012

    Hi Dane,

    not all four pins were tied to input pins on the arduino; two were for power (ground/3.3v) and then trial and error revealed which of the other two was the more useful one to use to detect the signal. That meant only one input pin was ultimately needed for this.

    Nick

  17. pingback from Tweeting Doorbell | The JumpsJanuary 27, 2013

  18. leave a comment

    You must be logged in to post a comment.