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. Hardware
  3. HC-SR501 motion sensor

HC-SR501 motion sensor

Scheduled Pinned Locked Moved Hardware
31 Posts 14 Posters 34.1k Views 9 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.
  • bjornhallbergB Offline
    bjornhallbergB Offline
    bjornhallberg
    Hero Member
    wrote on last edited by bjornhallberg
    #1

    Since I want to make my MySensors project all about security, I'd like some input on the selection and operation of the default Ebay motion sensor - the HC-SR501. Some question that have been bugging me:

    1. Is this sensor reliable? I noticed from the specs that the detection range / cone seems a bit narrow? Will it last outdoors if properly protected and sealed? What sort of lifespan does it have? Does it deteriorate over time?

    2. Are there other better modules available if you're willing to pay a little more? I've found none so far ...

    3. What about power consumption then? 65uA or <50uA are figures being thrown around. I've seen mentions of 40 uA at 5V while idling and 150 uA when motion is detected. That shouldn't be too hard on batteries? What about when you run it on 3.3V and bypass the regulator, surely that would make some difference?

    BulldogLowellB 1 Reply Last reply
    0
    • bjornhallbergB bjornhallberg

      Since I want to make my MySensors project all about security, I'd like some input on the selection and operation of the default Ebay motion sensor - the HC-SR501. Some question that have been bugging me:

      1. Is this sensor reliable? I noticed from the specs that the detection range / cone seems a bit narrow? Will it last outdoors if properly protected and sealed? What sort of lifespan does it have? Does it deteriorate over time?

      2. Are there other better modules available if you're willing to pay a little more? I've found none so far ...

      3. What about power consumption then? 65uA or <50uA are figures being thrown around. I've seen mentions of 40 uA at 5V while idling and 150 uA when motion is detected. That shouldn't be too hard on batteries? What about when you run it on 3.3V and bypass the regulator, surely that would make some difference?

      BulldogLowellB Offline
      BulldogLowellB Offline
      BulldogLowell
      Contest Winner
      wrote on last edited by
      #2

      @bjornhallberg said:

      I noticed from the specs that the detection range / cone seems a bit narrow?

      I am using them indoors to detect motion in/out of rome and hallways. Seems reliable. I mainly use them in wall outlets to detect legs moving by.

      marceltrapmanM HomerH 2 Replies Last reply
      0
      • BulldogLowellB BulldogLowell

        @bjornhallberg said:

        I noticed from the specs that the detection range / cone seems a bit narrow?

        I am using them indoors to detect motion in/out of rome and hallways. Seems reliable. I mainly use them in wall outlets to detect legs moving by.

        marceltrapmanM Offline
        marceltrapmanM Offline
        marceltrapman
        Mod
        wrote on last edited by
        #3

        @BulldogLowell said:

        I am using them indoors to detect motion in/out of rome...

        Wow, how many of these puppies do you use??? :-D

        Fulltime Servoy Developer
        Parttime Moderator MySensors board

        I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
        I have a FABtotum to print cases.

        BulldogLowellB 1 Reply Last reply
        0
        • marceltrapmanM marceltrapman

          @BulldogLowell said:

          I am using them indoors to detect motion in/out of rome...

          Wow, how many of these puppies do you use??? :-D

          BulldogLowellB Offline
          BulldogLowellB Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #4

          @marceltrapman

          two kids rooms to turn off lights (that they seem incapable of doing)

          hallways X 2 and one in the garage I just put there

          marceltrapmanM 1 Reply Last reply
          0
          • BulldogLowellB BulldogLowell

            @marceltrapman

            two kids rooms to turn off lights (that they seem incapable of doing)

            hallways X 2 and one in the garage I just put there

            marceltrapmanM Offline
            marceltrapmanM Offline
            marceltrapman
            Mod
            wrote on last edited by
            #5

            @BulldogLowell said:

            @marceltrapman

            two kids rooms to turn off lights (that they seem incapable of doing)

            hallways X 2 and one in the garage I just put there

            Still many, I have only 2 one for the kitchen and one for the bathroom.

            But... I was referring to the fact that you wrote 'rome' instead of 'room' :)

            Fulltime Servoy Developer
            Parttime Moderator MySensors board

            I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
            I have a FABtotum to print cases.

            BulldogLowellB 1 Reply Last reply
            0
            • marceltrapmanM marceltrapman

              @BulldogLowell said:

              @marceltrapman

              two kids rooms to turn off lights (that they seem incapable of doing)

              hallways X 2 and one in the garage I just put there

              Still many, I have only 2 one for the kitchen and one for the bathroom.

              But... I was referring to the fact that you wrote 'rome' instead of 'room' :)

              BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by
              #6

              @marceltrapman said:

              @BulldogLowell said:

              @marceltrapman

              two kids rooms to turn off lights (that they seem incapable of doing)

              hallways X 2 and one in the garage I just put there

              Still many, I have only 2 one for the kitchen and one for the bathroom.

              But... I was referring to the fact that you wrote 'rome' instead of 'room' :)

              hehe I missed that.

              My kids live in Rome, so to speak, and live like senators!

              marceltrapmanM 1 Reply Last reply
              0
              • BulldogLowellB BulldogLowell

                @marceltrapman said:

                @BulldogLowell said:

                @marceltrapman

                two kids rooms to turn off lights (that they seem incapable of doing)

                hallways X 2 and one in the garage I just put there

                Still many, I have only 2 one for the kitchen and one for the bathroom.

                But... I was referring to the fact that you wrote 'rome' instead of 'room' :)

                hehe I missed that.

                My kids live in Rome, so to speak, and live like senators!

                marceltrapmanM Offline
                marceltrapmanM Offline
                marceltrapman
                Mod
                wrote on last edited by
                #7

                @BulldogLowell :)

                So, the sensors solve the behaviour of the senators...

                Fulltime Servoy Developer
                Parttime Moderator MySensors board

                I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                I have a FABtotum to print cases.

                YveauxY 1 Reply Last reply
                0
                • marceltrapmanM marceltrapman

                  @BulldogLowell :)

                  So, the sensors solve the behaviour of the senators...

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

                  @marceltrapman said:

                  So, the sensors solve the behaviour of the senators...

                  This reminds me of an old thread before the crash. It discussed about the name of a sensor/actuator node and we came to the conclusion that sensuator could easily be mis-interpreted for a whole different type of device ;-)

                  However senator seems like a nice contraction of sensor and actuator! +:100: !!!

                  http://yveaux.blogspot.nl

                  marceltrapmanM 1 Reply Last reply
                  0
                  • YveauxY Yveaux

                    @marceltrapman said:

                    So, the sensors solve the behaviour of the senators...

                    This reminds me of an old thread before the crash. It discussed about the name of a sensor/actuator node and we came to the conclusion that sensuator could easily be mis-interpreted for a whole different type of device ;-)

                    However senator seems like a nice contraction of sensor and actuator! +:100: !!!

                    marceltrapmanM Offline
                    marceltrapmanM Offline
                    marceltrapman
                    Mod
                    wrote on last edited by
                    #9

                    @Yveaux said:

                    However senator seems like a nice contraction of sensor and actuator! +:100: !!!

                    Good one!

                    Fulltime Servoy Developer
                    Parttime Moderator MySensors board

                    I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                    I have a FABtotum to print cases.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      Bandra
                      wrote on last edited by
                      #10

                      Does anybody who has bypassed the onboard regulator on the HC-SR501 be able to post up a photo of where you soldered?

                      I thought it was pretty simple and soldered my 3.3V lead to the leg on the 7133. It seems to power up (at least, so says my voltmeter), but the trigger (output) pin just goes high immediately and never changes. So on my sensors network it is just constantly triggering (even when there's no motion).

                      I'm doing something wrong, but not sure what it is. Any hints?

                      YveauxY liningerL A 3 Replies Last reply
                      0
                      • B Bandra

                        Does anybody who has bypassed the onboard regulator on the HC-SR501 be able to post up a photo of where you soldered?

                        I thought it was pretty simple and soldered my 3.3V lead to the leg on the 7133. It seems to power up (at least, so says my voltmeter), but the trigger (output) pin just goes high immediately and never changes. So on my sensors network it is just constantly triggering (even when there's no motion).

                        I'm doing something wrong, but not sure what it is. Any hints?

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

                        @Bandra see my investigations for this sensor here (also see the scope plus above) : http://forum.mysensors.org/topic/250/how-do-i-use-the-interrupt/19

                        Removing the regulator does not influence the power consumption, so just leave it connected.
                        The 3v3 should be connected to the inner pin of the retrigger jumpers, not the regular 5v supply pin.

                        http://yveaux.blogspot.nl

                        1 Reply Last reply
                        0
                        • B Bandra

                          Does anybody who has bypassed the onboard regulator on the HC-SR501 be able to post up a photo of where you soldered?

                          I thought it was pretty simple and soldered my 3.3V lead to the leg on the 7133. It seems to power up (at least, so says my voltmeter), but the trigger (output) pin just goes high immediately and never changes. So on my sensors network it is just constantly triggering (even when there's no motion).

                          I'm doing something wrong, but not sure what it is. Any hints?

                          liningerL Offline
                          liningerL Offline
                          lininger
                          wrote on last edited by
                          #12

                          @Bandra said:

                          Does anybody who has bypassed the onboard regulator on the HC-SR501 be able to post up a photo of where you soldered?

                          Here is how id modified the sensor.

                          Motion 3v modify.jpg

                          Does anyone know if the Mini version also has such a place as the SR501?

                          Motion Mini.jpg

                          1 Reply Last reply
                          1
                          • B Offline
                            B Offline
                            Bandra
                            wrote on last edited by
                            #13

                            Thanks for the replies, @lininger and @Yveaux. Do you bridge H and the centre solder pad?

                            Here's my solder effort:

                            photo(4).JPG

                            I checked with my multimeter, and soldering a 3.3v wire onto the 7133 leg gets 3.3v to the H solder pad. So I'm pretty sure that I've done the equivalent of yours.

                            And yet, it doesn't seem to work. After a few seconds my output pin just goes high and never drops low. I've tried to tune the pots but it makes little difference.

                            Just wanted to check that at least I got the power right. Thanks guys!

                            YveauxY 1 Reply Last reply
                            0
                            • B Bandra

                              Thanks for the replies, @lininger and @Yveaux. Do you bridge H and the centre solder pad?

                              Here's my solder effort:

                              photo(4).JPG

                              I checked with my multimeter, and soldering a 3.3v wire onto the 7133 leg gets 3.3v to the H solder pad. So I'm pretty sure that I've done the equivalent of yours.

                              And yet, it doesn't seem to work. After a few seconds my output pin just goes high and never drops low. I've tried to tune the pots but it makes little difference.

                              Just wanted to check that at least I got the power right. Thanks guys!

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

                              @Bandra according to its specs it takes a minute or so to startup, but you probably waited longer, right?

                              http://yveaux.blogspot.nl

                              1 Reply Last reply
                              0
                              • B Offline
                                B Offline
                                Bandra
                                wrote on last edited by
                                #15

                                Yeah, the sketch I found waits for it to warm up. I'll increase the warmup period and try again. Thanks for the suggestion!

                                1 Reply Last reply
                                0
                                • B Offline
                                  B Offline
                                  Bandra
                                  wrote on last edited by
                                  #16

                                  Moved my solder point to the H pad. Also bridged the H pad with centre pad. All works now. Thanks everyone!

                                  Interesting observation. The motion sketch works very well. But when I try my multisensor sketch it always reads high and keeps triggering. Must be a problem with taking too long in the interrupt. I recall a small discussion about that. Time for some searching...

                                  YveauxY 1 Reply Last reply
                                  0
                                  • B Bandra

                                    Moved my solder point to the H pad. Also bridged the H pad with centre pad. All works now. Thanks everyone!

                                    Interesting observation. The motion sketch works very well. But when I try my multisensor sketch it always reads high and keeps triggering. Must be a problem with taking too long in the interrupt. I recall a small discussion about that. Time for some searching...

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

                                    @Bandra If you configured the interrupt LEVEL triggered (either low or high) you have to wait for the signal to change in the interrupt handler (or e.g. disable the interrupt in the interupt handler) or it will enter the interrupt handler immediately again on exit.

                                    http://yveaux.blogspot.nl

                                    B 1 Reply Last reply
                                    0
                                    • YveauxY Yveaux

                                      @Bandra If you configured the interrupt LEVEL triggered (either low or high) you have to wait for the signal to change in the interrupt handler (or e.g. disable the interrupt in the interupt handler) or it will enter the interrupt handler immediately again on exit.

                                      B Offline
                                      B Offline
                                      Bandra
                                      wrote on last edited by Bandra
                                      #18

                                      Thanks @Yveaux
                                      I think I'm pretty safe there because I'm relying on the MySensors library to do the interrupt [ie, the sleep(int, int, long) method]. In that method, the library disables the interrupt itself [in MySensor::sleep it performs a "detachInterrupt(interrupt);" ]

                                      I got it going reasonably well by doing two things. I moved the code that tests the D3 pin towards the beginning of the loop(). This helps avoid flapping (ie, if the pin fell low between the time the the interrupt was triggered to the end of the next loop() then it might cause flapping). I also changed my sleep call from:

                                      sleep(INTERRUPT, CHANGE, 30000)
                                      

                                      to

                                      sleep(INTERRUPT, RISING, 30000)
                                      

                                      This way, a flapping motion sensor doesn't affect me as much. Those two changes worked a treat. My multisensor sketch works well now!

                                      Thanks again for all your advice on this forum.

                                      1 Reply Last reply
                                      0
                                      • BulldogLowellB BulldogLowell

                                        @bjornhallberg said:

                                        I noticed from the specs that the detection range / cone seems a bit narrow?

                                        I am using them indoors to detect motion in/out of rome and hallways. Seems reliable. I mainly use them in wall outlets to detect legs moving by.

                                        HomerH Offline
                                        HomerH Offline
                                        Homer
                                        wrote on last edited by
                                        #19

                                        @BulldogLowell said:

                                        I am using them indoors to detect motion in/out of rome and hallways. Seems reliable. I mainly use them in wall outlets to detect legs moving by.

                                        I'd really like to see this. Having the sensor plugged into a wall socket would be perfect! Would you mind sharing how you did this? ie what case etc, so it looks good?

                                        I have searched, but didn't find anything.

                                        thanks

                                        BulldogLowellB 1 Reply Last reply
                                        0
                                        • HomerH Homer

                                          @BulldogLowell said:

                                          I am using them indoors to detect motion in/out of rome and hallways. Seems reliable. I mainly use them in wall outlets to detect legs moving by.

                                          I'd really like to see this. Having the sensor plugged into a wall socket would be perfect! Would you mind sharing how you did this? ie what case etc, so it looks good?

                                          I have searched, but didn't find anything.

                                          thanks

                                          BulldogLowellB Offline
                                          BulldogLowellB Offline
                                          BulldogLowell
                                          Contest Winner
                                          wrote on last edited by
                                          #20

                                          @Homer

                                          check out this thread

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


                                          8

                                          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