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. General Discussion
  3. Garage door status sensors ideas

Garage door status sensors ideas

Scheduled Pinned Locked Moved General Discussion
doorgaragesensor
27 Posts 11 Posters 5.2k Views 8 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.
  • M Offline
    M Offline
    McQueen
    wrote on last edited by
    #1

    Hi guys,

    Happy New Year! I'm new here and really excited about the work done here.

    I'm working on building a garage door opener. I'm trying to find a sensor to detect if the garage door is open or closed. I don't want to use a reed switch as I want it to be wireless. Basically my sensor will connect using the Rf24l01 to the gateway. The gateway is connected to the garage opener via a relay.

    Any ideas of what sensors I could use to detect the status of the garage door?

    I looked at a tilt sensor but it doesn't help with 90 degree angles, it detects 0 and 180 degrees.

    Thanks!

    YveauxY dbemowskD 2 Replies Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #2

      You do not need to place the reed switch / microswitch on the port itself, if using a reed switch you could place the magnet on the port itself, and then have the reed switch on the rails of the port, then you can run a wire to it from your arduino

      1 Reply Last reply
      0
      • M McQueen

        Hi guys,

        Happy New Year! I'm new here and really excited about the work done here.

        I'm working on building a garage door opener. I'm trying to find a sensor to detect if the garage door is open or closed. I don't want to use a reed switch as I want it to be wireless. Basically my sensor will connect using the Rf24l01 to the gateway. The gateway is connected to the garage opener via a relay.

        Any ideas of what sensors I could use to detect the status of the garage door?

        I looked at a tilt sensor but it doesn't help with 90 degree angles, it detects 0 and 180 degrees.

        Thanks!

        YveauxY Offline
        YveauxY Offline
        Yveaux
        Mod
        wrote on last edited by
        #3

        @mcqueen How about using a compass sensor?
        It will allow you to accurately determine the angle of your door wrt the ground plane.

        http://yveaux.blogspot.nl

        M 1 Reply Last reply
        0
        • dbemowskD Offline
          dbemowskD Offline
          dbemowsk
          wrote on last edited by
          #4

          Granted this was quite some time ago, but here is a post I did in 2016 on my garage door project. I was able to tap into the existing limit switches on the opener. I still have that node running to this day and it works well. I also have it set up as a repeater for other things outside.
          https://forum.mysensors.org/topic/4059/automated-garage-door

          Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
          Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

          1 Reply Last reply
          1
          • rozpruwaczR Offline
            rozpruwaczR Offline
            rozpruwacz
            wrote on last edited by
            #5

            can't understand why reed switch makes You unable to make wireless sensor ? these are orthogonal things. Just make an atmega board with nrf24 and reed switch connected to it and voila :) event better, make two sensors, one for checking if the garage door is closed, and second for checking if garage door is fully open. But if you need to report the actual angle of the door than maybe something like ADXL345 ?

            1 Reply Last reply
            0
            • M McQueen

              Hi guys,

              Happy New Year! I'm new here and really excited about the work done here.

              I'm working on building a garage door opener. I'm trying to find a sensor to detect if the garage door is open or closed. I don't want to use a reed switch as I want it to be wireless. Basically my sensor will connect using the Rf24l01 to the gateway. The gateway is connected to the garage opener via a relay.

              Any ideas of what sensors I could use to detect the status of the garage door?

              I looked at a tilt sensor but it doesn't help with 90 degree angles, it detects 0 and 180 degrees.

              Thanks!

              dbemowskD Offline
              dbemowskD Offline
              dbemowsk
              wrote on last edited by
              #6

              @mcqueen Is your garage door opener a chain drive or a lead screw type?

              Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
              Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

              M 1 Reply Last reply
              0
              • dbemowskD dbemowsk

                @mcqueen Is your garage door opener a chain drive or a lead screw type?

                M Offline
                M Offline
                McQueen
                wrote on last edited by
                #7

                @dbemowsk it's actually a rubber chain like. I read your post. I have the same issue currently I have a reed switch at the top and the door sometimes slides past the switch.

                dbemowskD 1 Reply Last reply
                0
                • YveauxY Yveaux

                  @mcqueen How about using a compass sensor?
                  It will allow you to accurately determine the angle of your door wrt the ground plane.

                  M Offline
                  M Offline
                  McQueen
                  wrote on last edited by
                  #8

                  @yveaux is it like an accelerometer? Like the ADXL345?

                  YveauxY 1 Reply Last reply
                  0
                  • M McQueen

                    @dbemowsk it's actually a rubber chain like. I read your post. I have the same issue currently I have a reed switch at the top and the door sometimes slides past the switch.

                    dbemowskD Offline
                    dbemowskD Offline
                    dbemowsk
                    wrote on last edited by
                    #9

                    @mcqueen The reason I asked about how your door is driven is that I have heard of some people that have put the magnets on the chain and put the reed switches somewhere near the magnet on the chain. If you had one of the lead screw type that wouldn't have worked.

                    Have you looked inside your controller? Maybe you have a setup like mine where you could tap into the internal limit switches somehow.

                    Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                    Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                    1 Reply Last reply
                    0
                    • ileneken3I Offline
                      ileneken3I Offline
                      ileneken3
                      wrote on last edited by
                      #10

                      I use an accelerometer ( search for MMA8452Q in AliExpress), along with code that checks the orientation:

                      byte pl = accel.readPL();
                         switch (pl)
                         {
                           case PORTRAIT_U:
                             Serial.println("Portrait Up");
                             break;
                           case PORTRAIT_D:
                             Serial.println("Portrait Down");
                             break;
                           case LANDSCAPE_R:
                             Serial.println("Landscape Right");
                             break;
                           case LANDSCAPE_L:
                             Serial.println("Landscape Left");
                             break;
                           case LOCKOUT:
                             Serial.println("Flat");
                             break;
                         }
                      
                         if ( pl == LOCKOUT ) { // flat
                           garage_state = GARAGE_CLOSED;
                         } else {
                           garage_state = GARAGE_OPEN;
                         }
                      
                      Nca78N 1 Reply Last reply
                      1
                      • ileneken3I ileneken3

                        I use an accelerometer ( search for MMA8452Q in AliExpress), along with code that checks the orientation:

                        byte pl = accel.readPL();
                           switch (pl)
                           {
                             case PORTRAIT_U:
                               Serial.println("Portrait Up");
                               break;
                             case PORTRAIT_D:
                               Serial.println("Portrait Down");
                               break;
                             case LANDSCAPE_R:
                               Serial.println("Landscape Right");
                               break;
                             case LANDSCAPE_L:
                               Serial.println("Landscape Left");
                               break;
                             case LOCKOUT:
                               Serial.println("Flat");
                               break;
                           }
                        
                           if ( pl == LOCKOUT ) { // flat
                             garage_state = GARAGE_CLOSED;
                           } else {
                             garage_state = GARAGE_OPEN;
                           }
                        
                        Nca78N Offline
                        Nca78N Offline
                        Nca78
                        Hardware Contributor
                        wrote on last edited by
                        #11

                        @ileneken3 said in Garage door status sensors ideas:

                        I use an accelerometer ( search for MMA8452Q in AliExpress), along with code that checks the orientation:

                        I second this solution it's the best to have 0-90-180-270 orientation with no pain and low power consumption. And with some (complex) calculations you can even calculate a more precise angle, depending on the resolution of the accelerometer.
                        If you already have an accelereometer breakout at home check if it has this function, it's included in a bunch of chips like LIS3DH.

                        And be careful on AliExpress some sellers sell MMA7361 with current consumption of 400uA with "MMA8452Q" reference, it's not suitable for battery operation (real MMA8452Q is 6uA in low power mode)

                        1 Reply Last reply
                        0
                        • M McQueen

                          @yveaux is it like an accelerometer? Like the ADXL345?

                          YveauxY Offline
                          YveauxY Offline
                          Yveaux
                          Mod
                          wrote on last edited by Yveaux
                          #12

                          @mcqueen said in Garage door status sensors ideas:

                          @yveaux is it like an accelerometer? Like the ADXL345?

                          No, more like an HMC5883L compass senosor. Gives you the xyz-angles w.r.t. the earth magnetic field.
                          MMA8452Q also seems like a good choice though.

                          http://yveaux.blogspot.nl

                          Nca78N 1 Reply Last reply
                          0
                          • YveauxY Yveaux

                            @mcqueen said in Garage door status sensors ideas:

                            @yveaux is it like an accelerometer? Like the ADXL345?

                            No, more like an HMC5883L compass senosor. Gives you the xyz-angles w.r.t. the earth magnetic field.
                            MMA8452Q also seems like a good choice though.

                            Nca78N Offline
                            Nca78N Offline
                            Nca78
                            Hardware Contributor
                            wrote on last edited by
                            #13

                            @yveaux said in Garage door status sensors ideas:

                            @mcqueen said in Garage door status sensors ideas:

                            @yveaux is it like an accelerometer? Like the ADXL345?

                            No, more like an HMC5883L compass senosor. Gives you the xyz-angles w.r.t. the earth magnetic field.
                            MMA8452Q also seems like a good choice though.

                            Compass are better at this (and can measure while moving) but they are much more power hungry. I guess the best would be to mix the 2 sensors: keep only accelerometer active while there's no movement, measure with compass while door is moving. That way you get the real angle of the door and not an approximation that can tell you it's opened or it's closed if it's stucked in the middle or not fully closed because it's blocked by an obstacle.

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              McQueen
                              wrote on last edited by
                              #14

                              Thanks for the suggestions, everyone! This is very helpful.

                              1 Reply Last reply
                              1
                              • dbemowskD Offline
                                dbemowskD Offline
                                dbemowsk
                                wrote on last edited by
                                #15

                                When you start talking about using compass sensors and the like, you are talking about sensors that would need to be attached to the door itself. Being that the door is moving, it is not easy to run power to it which means that it would need to be a battery operated node. The other part of it is that it would be hard to combine that with the garage door control for opening and closing the door. I can't imagine the need to know the exact position of the door other than the fully up and/or the fully down positions. If you needed something in between that you can include some logic to estimate position based on timing. The door travels at a certain speed. Based on that you can calculate an average time that it should take for the door to open or close. Add a couple logic checks for what position the door was in when the opener was started, you can calculate whether the door is opening or closing. If the door is closing and you trip the safety sensors causing the door to go back up, you add another check to see if the door returns back to the upper position instead of stopping at the lower position. Based on all of that data you should be able to get a rough idea of the position of the door at any given time.

                                Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                                Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                                1 Reply Last reply
                                0
                                • gohanG Offline
                                  gohanG Offline
                                  gohan
                                  Mod
                                  wrote on last edited by
                                  #16

                                  I still think the reed switch on the side of the door is the best solution, as you can have a battery powered node that can wake up only when sensor is triggered

                                  zboblamontZ 1 Reply Last reply
                                  0
                                  • gohanG gohan

                                    I still think the reed switch on the side of the door is the best solution, as you can have a battery powered node that can wake up only when sensor is triggered

                                    zboblamontZ Offline
                                    zboblamontZ Offline
                                    zboblamont
                                    wrote on last edited by
                                    #17

                                    @gohan Tend to second this on the KISS principle, but I recall a comment that the door would sometimes overshoot the optimal contact point (possibly door flexing?) on the 'closed' position...

                                    Perhaps it might be worth re-examining WHERE the switching contact is located to minimise the possibility of 'passing', or change from reed to microswitch with a finger actuator to give a range of detection of say 10mm.
                                    A c/o contact micro would also give confirmation the door was mid transit, the node could have a rundown timer to alarm out if the closed or open signal not received as expected?

                                    1 Reply Last reply
                                    0
                                    • gohanG Offline
                                      gohanG Offline
                                      gohan
                                      Mod
                                      wrote on last edited by
                                      #18

                                      Of course you need to find the right spot for the magnet to trigger the reed switch

                                      1 Reply Last reply
                                      0
                                      • I Offline
                                        I Offline
                                        iahim67
                                        wrote on last edited by
                                        #19

                                        Hi, maybe you can use the reed switch in a different way, I mean do not use it like contact closed or contact opened as this would cause you overshoot issues.
                                        When the magnet attached to the door slides in front of the reed switch, then you'll have the reed switch closed for a short time at least, most likely, you can test that. You can use the reed just like you would use a motion detector.
                                        I mean connect the reed to pin 3 - interrupt - and put this at the end of your code, so when an interrupt occurs you will know the door has moved (and you can keep track of movement of course so you would know if the door is open or close) ... just an idea ... :

                                        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
                                        dbemowskD 1 Reply Last reply
                                        1
                                        • rozpruwaczR Offline
                                          rozpruwaczR Offline
                                          rozpruwacz
                                          wrote on last edited by
                                          #20

                                          another option is to place couple of reed switches in parallel in several places. Only one is needed to close the circuit and trigger the interrupt.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          20

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 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