Doorbell detection



  • Hi,
    I have been searching for a solution to detect my doorbell and push actions (like pause Kodi, send notification to my phone etc)
    To give a brief background, I live in a rented apartment and my doorbell is AC powered. There is internal wiring and I cannot bypass it and use an arduino input to the pushbutton.
    What could work in my favour is that the doorbell has a LED which turns on for the duration of the chime. (there are two chimes for one push of the button and two long flashes of LED)
    I have a fair idea of what could work - use a LDR to detect the LED blink or flash and send the output to Domoticz as a trigger, which then could be used to carry out other actions.
    By now, you would have figured out that if this guy cannot work out this simple task, he must be a total noob; you got that right.

    I have seen several doorbell posts and most require tinkering with the existing connections and in my case I want to use the flashing LED (about 3 seconds On with a break of 1.5 second and then 3 seconds on for every push of button).

    How should I go about this. As I mentioned, I live in a rented apartment and I cannot mess with the existing setup without risking loosing my security deposit.

    Please guide. Thanks


  • Mod

    @Puneit-Thukral the pulse power meter example should have most of what you need to read the LED. Study that and the button example and I think you'll be able to take at least one or two steps forward.

    Just ask again if you get stuck 🙂



  • Thanks @mfalkvidd for your quick response. I get a sense how pulse power meter example will be useful. The sketch is too complex for me to understand. Correct me if I am wrong, that the pulse powermeter sketch is an overkill for my application. Will be asking for too much, if you could guide me on how to adapt the sketch .
    Thanks.


  • Mod

    @Puneit-Thukral something like this should be sufficient

    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <MySensors.h>
    
    #define DOORBELL_RING_TIME 3000 // Assume the doorbell is ringing for 3 seconds
    #define DIGITAL_INPUT_SENSOR 3  // The digital input you attached your light sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 1              // Id of the sensor child
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    bool ringing = false;
    
    void setup() {
      pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);
    
      attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, RISING);
    }
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Doorbell", "1.0");
    
      present(CHILD_ID, S_DOOR);
    }
    
    void loop() {
      if (ringing) {
        // Let controller know the doorbell is ringing
        send(msg.set(true));
        ringing = false;
        wait(DOORBELL_RING_TIME);
        // Turn off ringing at controller
        send(msg.set(false));
      }
      sleep(0); // Sleep until there is a new interrupt
    }
    
    void onPulse() {
      ringing = true;
    }
    


  • Thank you so much! 💯 👍



  • @Puneit-Thukral BUT..... Why NOT interfere.... I understand your desire to NOT physically interfere but it is illogical... LED=DC=Signal ? No ? A figure of 8 cable connection should not be impossible.... Once removed it is a two tiny holes...



  • @zboblamont Hi, @zboblamont could you please guide me how you think the setup should be.



  • @mfalkvidd Hi, I got the setup running. However, as long as I am connected to the FTDI adapter, the sensor works fine. But when connected to 2 AA batteries through a buck up converter, the sensor does not communicate with domoticz.
    I read that LM393 needs 3.3 V and I have measured the voltage across Vcc and Gnd on LM393, its 3.3 V


  • Mod

    @Puneit-Thukral what does the debug output of the node and the gateway say?



  • @Puneit-Thukral Perhaps an outline of your circuit and what is sensing what may help narrow down the issues. Were I looking at something which fires an LED, there is DC supplying it, which should be easy enough to tap (low voltage DC line) to initiate a response from your node. I would be inclined to test a signal input to light onboard LED on external LED lit, then refine the sketch to carry out the action so it narrows problems to a software issue.... Right now this is Stevie Wonder playing golf in the dark....



  • @mfalkvidd Hi
    On connecting the FTDI cable, the sensor works just fine. On disconnecting the FTDI it stops working. I figured its a power source issue. So, first tep to debug, I connected a 9v battery to RAW and GND - sensor node worked fine. I measured voltage across VCC and GND with the 9V battery - output across VCC and GND was 3.36 V and with 2 AA batteries connected through a buck boost converter, I measure 3.39 V across VCC and GND.

    With the AA batteries, the small LED next to pin 9 on the pro-mini glows fainter than on the 9 V (across RAW/GND) and also blinks every few seconds.

    Is there any way, I can fix this?


  • Mod

    @Puneit-Thukral I have to agree with with zboblamont. We're blind here. How is everything wired to your node? Which transport are you using? Which booster? And, again, what does the debug output say?


Log in to reply
 

Suggested Topics

  • 4
  • 2
  • 4
  • 9
  • 2
  • 15

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts