Close
0%
0%

Doorbell Notifier

Convert your existing wired doorbell into a ‘smart’ doorbell, allowing for notifications, integrations, etc.

Similar projects worth following
One of the first projects I tackled after getting back into microcontrollers was converting my wired doorbell into a ‘smart’ doorbell. I wanted to simultaneously trigger the appropriate camera to record on a doorbell press (even if I was home) notify me on my phone (in case I wasn’t home) and blink all of the smart lights in my house (if I was listening to music, etc.). Originally, I used Stringify to achieve this integration beautifully (it is now defunct) but have since moved to IFTTT which has allowed me to do most of the same things. I constrained myself to make no permanent changes to my existing doorbell setup: I both wanted to leave everything intact so as to annoy my wife minimally but still allow for the integration I wanted. Homemade optocouplers proved to work splendidly for reading the doorbell states and I was ultimately able to give the entire project a polished and professional look while making it suitable for a wealth of other microcontrollers.

My first (recent) microcontroller project turned me onto Particle Photons and got me looking for projects that would specifically benefit from having Wi-Fi functionality. Having recently gotten both security cameras and ‘smart’ lights, being able to have the doorbell trigger them seemed like a logical progression. As mentioned in the description, I didn’t want to alter my existing doorbell setup: partly for aesthetics/functionality but also as an added challenge. The first and primary hurdle was figuring out how to read the (relatively) high voltage AC that powers my doorbells.

A quick primer on wired doorbells: in the U.S., 12V AC is pretty common for powering them. (While I know in my case the transformer is rated for 12V, for whatever reason the voltage that each of my doorbells sees is actually 20V.) A quick google search will show you some diagrams for how things are typically wired. At each doorbell there are 2 wires (20V difference in my case). When the wires are shorted, the doorbell is activated. What this means, is that I needed a way to tell when the voltage difference between the 2 wires at each doorbell went to 0.


After doing a fair bit of googling to see how other people approached reading the state of a wired doorbell, I was surprised to find very little. I did however stumble upon a forum where someone was attempting to do this (or something similar) and optocouplers were recommended. The forum never resolved whether this worked for the original user but I decided to try it myself. (Optocopulers allow for signal isolation and simply consist of one side driving an LED and another side with a photoresistor reading the state of the LED.) While you can buy pre-made ones for quite cheap, I initially opted for making my own. I should also mention the fact that this would ideally be done with a DC power source on the LED side as AC voltage is constantly pushing and pulling or going high/low, so when directly powering an LED it will flicker (since they only allow current flow in one direction). In the US, this will be at a rate of 60 times a second. Not terribly noticeable to the human eye, but happening nonetheless. At the time I honestly didn’t know if it would meaningfully affect my use.


To test this, I simply took an LED and photoresistor from my parts bin and faced them towards each other, held in place and covered by black electrical tape (being careful to avoid shorting any of the wires). Wiring each up as you normally would (with the LED being driven by the doorbell wiring and the photoresistor being driven by the microcontroller), I was able to read the voltage on the photoresistor side with a multimeter and compare the pressed and un-pressed states. Somewhat to my surprise, my homemade octocoupler worked quite well: I was able to see very clear differences between the two states. Subsequently, I wired in the microcontroller and arranged things so that I got a ‘high’ state when the doorbell was un-pressed and a ‘low’ state when it was pressed. While there was definite variation due to the AC voltage, my photoresistor seemed to lag enough that it stayed pretty constant.


Fast-forward a little further and I was able to wire things up inside the house, connected to the wiring for both doorbells. I put it in a project box (but left it all on a breadboard) and put together some simple code to send Particle Publish commands when either doorbell was rung.

I actually left it this way for quite some time (read: over a year), both to fully test it out but mainly because it was working as-intended. Recently I started playing around with Eagle and designing my own boards; this seemed like a perfect project due to its small size and simplicity (it’d be awfully hard for me to mess up). However, before making a board I definitely wanted to use an actual optocoupler instead of my homemade ones. I found some quite inexpensive ones that fit the bill, ordered them and then proceeded with testing them as I figured they would act a little...

Read more »

Adobe Portable Document Format - 280.50 kB - 09/19/2019 at 18:46

Preview
Download

  • 1 × Particle Argon or Xenon or other Featherwing compatible board
  • 1 × Custom PCB or wire up your own
  • 1 × Stacking Headers for microcontroller, optional
  • 2 × PC817 Optocouplers
  • 4 × 1kOhm Resistors

View all 8 components

  • 1
    Order and Print Components

    The first thing you’ll want to do is order and print all of the necessary components. The printed components are all available on Github here.

  • 2
    Solder up the board

    Since I was using this as a self-made Eagle tutorial, I printed up a board. As I mentioned in the details, I had 10 printed so message me if you’re interested in me getting one to you. Otherwise, you can pretty easily make your own board using a protoboard.

  • 3
    Assemble everything

    With the board finished and the enclosure printed, assemble everything.

View all 5 instructions

Enjoy this project?

Share

Discussions

Scott Prive wrote 10/21/2019 at 23:13 point

How exactly are you dropping the doorbell's 12VAC down to what the Xenon needs (I assume, 5v)?   

 I see no regulator in the BOM, nor power resistors. The resistors I do see look small and specific to the photocoupler.

  Are you sure? yes | no

Ben Brooks wrote 10/21/2019 at 23:40 point

I'm actually just powering it via USB. In the Description I mention the possibility of trying to power it directly from the doorbell wires in a future iteration. In my specific case, I already had an outlet right next to it so USB was the easy option.

  Are you sure? yes | no

Scott Prive wrote 10/23/2019 at 00:54 point

Ahh, OK. I'd missed that, and let myself be misled by what I thought were terminals meant for the 12VAC.

Following, in case you pursue that challenge. I have been chasing this problem on the forums for years, and basically found (as you did) lots of breadcrumbs but no posted success.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates