Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Mysensored Doorbell

Mysensored Doorbell

Scheduled Pinned Locked Moved My Project
10 Posts 7 Posters 6.8k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Moshe LivneM Offline
    Moshe LivneM Offline
    Moshe Livne
    Hero Member
    wrote on last edited by
    #1

    After a long and tedious war with this doorbell (current causalities: two dead arduinos, 1 dead relay and one dead optocoupler) I decided to stop trying to be too smart for my own good and do it in a way I can understand.
    upload_-1 (3).jpg

    The bell has two circuits. one is 9v ac that comes from a transformer inside the wall. this goes through a rectifier and buck converter into the arduino (yes, I know the buck converter is not needed. However, it works and without it two arduinos died on me). Ringing the doorbell ground pin 3. The sketch then activate the relay that close the original circuit.

    upload_-1 (2).jpg

    It is almost completely wire wrapped as I had to undo and redo the circuit so many times.

    upload_-1 (1).jpg

    It is hosted inside a standard surface mount power/light switch box with blank plate.
    As Marry Poppins said "A thing of beauty is a joy forever!"

    upload_-1.jpg

    Isn't it nice with everything covered?

    Here is the sketch:

    // Doorbell sensor
    // to ring, ground pin 3. connect the relay that close the original circuit to pin 4
    // 
    
    #include <MySensor.h>
    #include <SPI.h>
    #include <Bounce2.h>
    
    #define CHILD_ID 3
    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
    #define RELAY_PIN  4  // Arduino Digital I/O pin bell relay
    
    MySensor gw;
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    
    void setup()  
    {  
      gw.begin();
    
     // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      pinMode(RELAY_PIN,OUTPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
      
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(5);
      
      // Register binary input sensor to gw (they will be created as child devices)
      // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
      // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
      gw.present(CHILD_ID, S_DOOR);  
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
     
      if (value != oldValue) {
         // Send in the new value
         Serial.println(value);
         gw.send(msg.set(value==HIGH ? 0 : 1));
         if (value == 0) {
         	Serial.println("activating rely for 1 sec");
         	digitalWrite(RELAY_PIN, HIGH);
         	delay(1000);
         	digitalWrite(RELAY_PIN, LOW);
         }
         oldValue = value;
      }
    } 
    
    

    Please feel free to comment - I am actually a bit disappointed that I didn't manage to do this the "right way" but it seems that the doorbell circuit is not "real" dc but half rectified AC. This is just a guess - I don't have the equipment to check this . As such it destroys components nicely, especially mechanical relays....
    The downside of doing it this way is that the doorbell will not ring if the arduino dies. well, they can always knock, can't they?

    1 Reply Last reply
    5
    • Moshe LivneM Offline
      Moshe LivneM Offline
      Moshe Livne
      Hero Member
      wrote on last edited by
      #2

      Just an update: this works perfectly. I always know when I miss the postmen now....

      1 Reply Last reply
      0
      • 5546dug5 Offline
        5546dug5 Offline
        5546dug
        wrote on last edited by
        #3

        @Moshe-Livne see the wire wrap would it stay this way or solder. next?
        The tool is $20 seems a lot but is it worth it in those?
        Plus the wait time.
        However cool project.

        Moshe LivneM 1 Reply Last reply
        0
        • 5546dug5 5546dug

          @Moshe-Livne see the wire wrap would it stay this way or solder. next?
          The tool is $20 seems a lot but is it worth it in those?
          Plus the wait time.
          However cool project.

          Moshe LivneM Offline
          Moshe LivneM Offline
          Moshe Livne
          Hero Member
          wrote on last edited by
          #4

          @5546dug Yes, 20$ now looks like a lot of money... Last time I used it it was over a 100$ :-)
          Anyway, I also hesitated but a few soldering mistakes and the inability to save your soldered components without a reflow station made me resort back to wire wrap. In retrospect it is probably the best 20$ I spent in this hobby. Reasons:

          1. It is fairly quick - no need to wait for the iron to heat. you want to do something you just do it.
          2. you can do it anywhere - its almost like knitting.... you can do it while cooking dinner or watching tv (ok, I am making this up) but really - no need for powerpoint of lots instruments
          3. no obnoxious fumes so the kids can "help"
          4. unless you are really good at soldering (and I am not) you can't get anything remotely as neat.
          5. it is very zen like :-)

          this is the one i got http://www.aliexpress.com/item/free-shipping-1PCS-305-meters-long-electrical-wire-line-high-quality-30awg-ok-line-Wire-Wrap/32319341509.html
          the wire will probably last me a lifetime....

          properly made wirewrap is as permanent as soldering, at least according to wikipedia. never had problems with wirewrap deteriorating

          1 Reply Last reply
          0
          • m26872M Offline
            m26872M Offline
            m26872
            Hardware Contributor
            wrote on last edited by
            #5

            Upvote and love for your wire wrap. It was good enough for space rockets and nuclear power plants so I'm sure your doorbell interconnections will stay safe as well.

            1 Reply Last reply
            0
            • DwaltD Offline
              DwaltD Offline
              Dwalt
              wrote on last edited by
              #6

              The onboard guidance computers for the Apollo moon missions were all wire wrapped.

              Veralite UI5 :: IBoard Ethernet GW :: MyS 1.5

              Moshe LivneM greglG 2 Replies Last reply
              0
              • DwaltD Dwalt

                The onboard guidance computers for the Apollo moon missions were all wire wrapped.

                Moshe LivneM Offline
                Moshe LivneM Offline
                Moshe Livne
                Hero Member
                wrote on last edited by
                #7

                @Dwalt Including the Apollo 13 one? :-)
                I can see why. If anything goes wrong you want to be able to fix it with no electricity and with as little equipment overhead as possible.

                1 Reply Last reply
                0
                • DwaltD Dwalt

                  The onboard guidance computers for the Apollo moon missions were all wire wrapped.

                  greglG Offline
                  greglG Offline
                  gregl
                  Hero Member
                  wrote on last edited by
                  #8

                  @Dwalt said:

                  The onboard guidance computers for the Apollo moon missions were all wire wrapped.

                  Really?? That's madness!

                  @Moshe Livne - Cmon...use a soldering iron! I bought a couple of these
                  http://www.hobbyking.com/hobbyking/store/__24789__Soldering_Station_with_Adjustable_Heat_Range_with_AUS_plug.html
                  They are up to temp in 10secs...

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    insomnia
                    wrote on last edited by
                    #9

                    My setup doesn't work. When i activate the relay directly it works. Pin 3 to ground does nothing. I used the sketch from Moshe. What can i do next?

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      errants
                      wrote on last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      16

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.0k

                      Posts


                      Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular