More Awesome DoorBell Control

 

UPDATE: I eventually decided to use a single switching regulator that I found on digikey which is both awesome and well priced. See this blog post update about it.

My first DoorBell Mote prototype was working nicely and it allowed monitoring the door bell (while also triggering it remotely – toddlers love it). But I wanted more. On weekends the family likes to get a well deserved nap during the day and often those pesky solicitors ring the bell and wake everyone up. So naturally the doorbell has to be disabled also, without major effort or any disconnected wires. Sounds like the perfect addition to the Door Bell Mote. So I made a new revision and a proper PCB for this, below is the schematic with the changes and the proto PCB from OSHPark. Actually I made more changes to the schematic after putting together the PCB, so there are some differences. I’ve tried a LTV814H optocoupler for AC detection instead of the more expensive H11AA11, it works just as well, but both can be used on this PCB:

bellmote_schematic

There are 2 regulators on this PCB. One is a 12V linear LM7812. The second is a 3.3V linear regulator getting input from the 12V LM output, both in TO220 packages. I know they are super inefficient to convert rectified 16VAC to DC voltages and the critics will stone me for doing this. But here’s the deal – the linears are about 50cents each and I had both among my junk parts. An efficient switching regulator is somewhere between $5-$10. The linears run somewhat warm. The 3.3V regulator only gets warm when I use the disable relay. So they can get warm but not hot, which is fine by me, it’s just a tradeoff. I might make a new revision where I have a single switching regulator such as this one, a drop in replacement for the LM linear regs.

Modes of operation: detect and trigger

If I just want to use this as a bell detector and trigger a ring, I can wire it as before, 3 simple taps, into the first 3 terminals (“GND”, AC, and trigger). The terminals from the transformer are AC so there is no ground, but I marked one of the wires as “GND”, this is our virtual ground for the DC part of the circuit, the other provides our DC rectified output:

Modes of operation: detect, trigger and disable/enable

However the main purpose of this revision was to make it possible to disable the door bell convenienty from my smart phone when we want a quiet nap. For that there’s a second simple non-latching relay that will need to turn ON to disable the doorbell (see the schematic, it interrupts the wire going to the front door bell button). Below is the the wiring for this new mode, note the two white wires with the orange wire nut where we originally tapped to trigger the bell, now they become split and go into the bottom 2 terminals and through the disabling relay, which by default (turned OFF) has the two connected just as if they were connected with the wire nut. When the relay is turned ON, the two wires become disconnected, hence disabling the bell. I know a latching relay would have been a much more efficient choice here, but again in terms of simplicity and cost effectiveness this was the best compromise, and also I can use the same type of small relay as the other one.

For more on how this project transforms 16VAC to DC, and the technicalities of how it detects the AC flow when the door bell button is pressed, see the schematic above and/or the initial blog post where I explain this in detail.

Code changes and adding a Disable button to the Gateway UI

I’ve updated the DoorBellMote sketch to reflect the changes and make it respond to BELL:0 (disable) or BELL:1 (enable) commands. It now also sends a START message every time the Moteino is started/reset, this helps debugging any strange resets that should not happen and it illustrates how you could add your own custom messages or new metrics for debugging or other purposes. Here are the new set of commands defined in exports.metrics in metrics.js, the regular expressions of each metric have to match the incoming Moteino message:

exports.metrics = {
  ...
  //BellMote
  BELL_DISABLED : { name:'Status', regexp:/BELL\:0/i, value:'OFF'},
  BELL_ENABLED  : { name:'Status', regexp:/BELL\:1/i, value:'ON'},
  START         : { name:'START', regexp:/START/i, value:'Started'},
  ring          : { name:'RING', regexp:/RING/i, value:'RING', pin:1, graph:1, graphValue:1, graphOptions:{ lines: { show:false, fill:false }, points: { show: true, radius: 5,  lineWidth:1 }, grid: { backgroundColor: {colors:['#000', '#a40']}}, yaxis: { ticks: 0 }}},
}

To add a new button to the Gateway interface, I need to define a new control in the DoorBell node entry in the exports.motes section of metrics.js:

exports.motes = {
...
DoorBellMote: {
    label  : 'DoorBell',
    icon   : 'icon_doorbell.png',
    controls : { ring : { states: [{ label:'Ring it!', action:'RING', icon:'audio' }]},
                 status :  { states: [{ label:'Disabled', action:'BELL:1', css:'background-color:#FF9B9B;', icon:'power', condition:''+function(node) { return node.metrics['Status']!=null && node.metrics['Status'].value == 'OFF'; }},
                                      { label:'Enabled',  action:'BELL:0', css:'background-color:#9BFFBE;color:#000000', icon:'power', condition:''+function(node) { return node.metrics['Status']==null || node.metrics['Status'].value == 'ON'; }}]},
    },
  }
}

Run test and Conclusions

Here is the new DoorBell mote all wired up and the new UI in the Gateway. This shows the bell disabled. Pressing the doorbell button at the front door does nothing, now the baby can sleep uninterrupted. Pressing the “Ring it!” button in the UI will still ring the bell even when disabled (flipping both relays ON/OFF quickly from one state to another). And of course, even when disabled, if someone presses the doorbell button, I can still detect and graph it:

graph

This was a really fun and useful project. There is now a kit available in the shop (with a single switching regulator for more efficiency).

9 thoughts on “More Awesome DoorBell Control

  1. I’m interested for sure. Just went to my local electronics store yesterday and bought the components for your last model and sat down to build it today and seen this post. Can you please share the parts list and everything needed to build. Would be greatly appreciated.

    • I think all the parts were mentioned in this and the previous post, the latest schematic in this post also has them. If you’re still not sure about something let me know.

  2. I was looking at your schematic and I might be missing something. For the ground displayed in your circuit, do they all go to DC ground after the AC rectify, or do some go to the virtual ground you’ve setup from the transformer? More specifically, for the trigger circuit, for the GND input to the H11AA1, is this to DC GND or the virtual AC GND?

    • DC ground == virtual ground. This is made up from one of the AC taps. The other is rectified to become the DC vin to the buck regulator.

  3. Hi Felix,

    Amazing work, thank you! Minor typo, please see the diagram where its labelled PNP but the diagram shows an NPN (Transistor connecting to the opto-coupler). I suspect hence the confusion on how to get the wiring connections to work.

    • Thanks for the kind words, and you are correct, it’s a typo, I think someone else noticed but I never corrected it (it is a PNP). I will probably eventually make a page for this project with a new diagram and more info. On the PCB itself it will be obvious where each transistor goes.

  4. I would be interested in “if there’s any interest I might make it into a kit” buying a kit.

Comments are closed.