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. Troubleshooting
  3. Motion Sensor triggering on its own

Motion Sensor triggering on its own

Scheduled Pinned Locked Moved Troubleshooting
39 Posts 19 Posters 24.9k Views 13 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.
  • ErrKE Offline
    ErrKE Offline
    ErrK
    Plugin Developer
    wrote on last edited by
    #16

    Thanks @Jan-Gatzke it did not work for me this time.

    I'm using a 5v Arduino Pro mini and when i measure the power on the HC-SR501 i get 3.71v.
    When i measure the power on the VCC i get 3.69v and when i measure the RAW i get 5.43v.

    Here you can se how everything is wired, I use the Easy/Newbie PCB by @sundberg84.
    1_1457118103690_IMG_6345 copy.jpg
    0_1457118103689_IMG_6346 copy.jpg

    First i used the 5v cable to the raw on the PCB and then it did't work.
    When I change to connect to the PWR then it works. Don't know why. Maybe @sundberg84 know why?

    1 Reply Last reply
    0
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #17

      Hi @ErrK.

      Work your way backwards with the multimeter. Are you powering with 5v there shouldnt be a drop to 3v. Check volt over arduino and then vcc output. As i said work you way backwards in the circuit.

      I suspect a faulty hardware somewhere, measure the input and output on the voltage regulator on the arduino.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • ErrKE ErrK

        @Maciej-Kulawik Thanks.

        Today my second node started to do this too.
        I have tried to change the HC-SR501 and the problem seams to be on the node and not on the sensor.
        Can i see how you fixed this in the sketch?

        M Offline
        M Offline
        Maciej Kulawik
        wrote on last edited by
        #18

        @ErrK In my case PIR switches into HIGH for some seconds (depending on potentiometer), so reading after 100ms will give the same value.

        @ErrK Unfortunately my solution is not 100% reliable. For 2 of my nodes it works well, but for 3rd node (the same hardware, the same sketch, only PCB is a little bi different - previous version, but difference only in dimension) - pir is false triggerring almost each minute (sometimes with 2 minutes delay with false triggering). And I checked - it is not caused by NRF sending. I have no idea whats going on.

        1 Reply Last reply
        0
        • rvendrameR Offline
          rvendrameR Offline
          rvendrame
          Hero Member
          wrote on last edited by
          #19

          @Maciej-Kulawik , how are you powering the node? I had once a PIR false-triggering due power instabilities...

          Home Assistant / Vera Plus UI7
          ESP8266 GW + mySensors 2.3.2
          Alexa / Google Home

          M 1 Reply Last reply
          0
          • fifipil909F Offline
            fifipil909F Offline
            fifipil909
            wrote on last edited by
            #20

            Hi,

            i'm wanted to share my experience also with those sensor.
            I had a lot of issue with false trigger when running on 3.3V. In my case the power was definitely the issue.
            it's looks like sleeping the radio/mcu cause some noise on the voltage line.

            I solve 100% of my false trigger issue when doing a small sleep, before enabling the sleep with interrupt.

            gw.sleep(500);
            gw.sleep(INTERRUPT,RISING, SLEEP_TIME);
            
            1 Reply Last reply
            0
            • rvendrameR rvendrame

              @Maciej-Kulawik , how are you powering the node? I had once a PIR false-triggering due power instabilities...

              M Offline
              M Offline
              Maciej Kulawik
              wrote on last edited by
              #21

              @rvendrame I'm powering all with 2xAA baterries. On PIR I removed regulator. The problem with false trigerring is independent from voltage level. It is the same if I put old baterries (2,8V) or brand new (3,2V).
              @fifipil909 I also suspect that it is somehow connected to powering noises and mcu sleeping. In my one case PIR is triggering each minute - and sleep time is also one minute.

              1 Reply Last reply
              0
              • rvendrameR Offline
                rvendrameR Offline
                rvendrame
                Hero Member
                wrote on last edited by
                #22

                @Maciej-Kulawik , maybe if you try to power the PIR with +5V for a while and watch the results? Don't forget to keep all GNDs inter-connected...

                Home Assistant / Vera Plus UI7
                ESP8266 GW + mySensors 2.3.2
                Alexa / Google Home

                1 Reply Last reply
                0
                • SweebeeS Offline
                  SweebeeS Offline
                  Sweebee
                  wrote on last edited by
                  #23

                  I'm also having this issue at 3V. It gets triggered if there is a (little) voltage drop. All my pirs only wake with an interrupt and no timer, then it works fine. But with a sleep timer it won't work the normal way.

                  At 5V everything works fine.

                  Maybe @fifipil909 's solution works.

                  1 Reply Last reply
                  0
                  • ahmedadelhosniA Offline
                    ahmedadelhosniA Offline
                    ahmedadelhosni
                    wrote on last edited by
                    #24

                    I was testing the below sensor with 3.3v and it was reporting false status. It worked well with 5v. Although the site claims it works between 3 to 5 volts.
                    Maybe power issues

                    http://store.fut-electronics.com/products/pir-motion-sensor-module-adjustable-range

                    M 1 Reply Last reply
                    0
                    • ahmedadelhosniA ahmedadelhosni

                      I was testing the below sensor with 3.3v and it was reporting false status. It worked well with 5v. Although the site claims it works between 3 to 5 volts.
                      Maybe power issues

                      http://store.fut-electronics.com/products/pir-motion-sensor-module-adjustable-range

                      M Offline
                      M Offline
                      Maciej Kulawik
                      wrote on last edited by
                      #25

                      @ahmedadelhosni All those PIRs are built using the same chip. All all have 3,3v regulator onboard, so they always work with 3,3v. I don't understand why powering directly with 3,2v from battery makes so trouble.
                      Maybe this LDO regulator adds some additional stabilisation/filtering on power line, when powered with greater voltage...

                      rvendrameR ahmedadelhosniA 2 Replies Last reply
                      0
                      • M Maciej Kulawik

                        @ahmedadelhosni All those PIRs are built using the same chip. All all have 3,3v regulator onboard, so they always work with 3,3v. I don't understand why powering directly with 3,2v from battery makes so trouble.
                        Maybe this LDO regulator adds some additional stabilisation/filtering on power line, when powered with greater voltage...

                        rvendrameR Offline
                        rvendrameR Offline
                        rvendrame
                        Hero Member
                        wrote on last edited by
                        #26

                        @Maciej-Kulawik It can be that the on-board LDO needs more than 3.3v to activate. It maybe even dropping the voltage from batteries, and doing nothing but disturbing :-) Maybe it worth to remove it when running the circuit with 3V from batteries.

                        Home Assistant / Vera Plus UI7
                        ESP8266 GW + mySensors 2.3.2
                        Alexa / Google Home

                        M 1 Reply Last reply
                        0
                        • rvendrameR rvendrame

                          @Maciej-Kulawik It can be that the on-board LDO needs more than 3.3v to activate. It maybe even dropping the voltage from batteries, and doing nothing but disturbing :-) Maybe it worth to remove it when running the circuit with 3V from batteries.

                          M Offline
                          M Offline
                          Maciej Kulawik
                          wrote on last edited by
                          #27

                          @rvendrame But I work only with pirs with ldo removed (and diode).

                          rvendrameR 1 Reply Last reply
                          0
                          • M Maciej Kulawik

                            @rvendrame But I work only with pirs with ldo removed (and diode).

                            rvendrameR Offline
                            rvendrameR Offline
                            rvendrame
                            Hero Member
                            wrote on last edited by
                            #28

                            @Maciej-Kulawik if so, your PIR looks to need at least 3.3V, so the ~3V from 2xAA is not enough and it is causing instabilities (probably the same as reported by others here).

                            Home Assistant / Vera Plus UI7
                            ESP8266 GW + mySensors 2.3.2
                            Alexa / Google Home

                            1 Reply Last reply
                            0
                            • M Maciej Kulawik

                              @ahmedadelhosni All those PIRs are built using the same chip. All all have 3,3v regulator onboard, so they always work with 3,3v. I don't understand why powering directly with 3,2v from battery makes so trouble.
                              Maybe this LDO regulator adds some additional stabilisation/filtering on power line, when powered with greater voltage...

                              ahmedadelhosniA Offline
                              ahmedadelhosniA Offline
                              ahmedadelhosni
                              wrote on last edited by
                              #29

                              @Maciej-Kulawik I didnt know that info. Thanks.

                              1 Reply Last reply
                              0
                              • L Offline
                                L Offline
                                LastSamurai
                                Hardware Contributor
                                wrote on last edited by
                                #30

                                Did you guys get them working? I tried to power the pir sensor via the "H" pad directly with 3.3V from a boost converter (via a coin cell). Now I get random readings that I didn't have when using a stable 3.3V source. Any ideas how to solve this?
                                I haven't (yet) removed the voltage regulator on board. Perhaps that might help...

                                1 Reply Last reply
                                0
                                • ChakkieC Offline
                                  ChakkieC Offline
                                  Chakkie
                                  wrote on last edited by Chakkie
                                  #31

                                  I have the same issue first when I tried to power the PIR with the VCC from the arduino mini pro 3.3V. It seems like the PIR does not work with 3.3V. Now I power the PIR directly from the 9V battery. Problem solved.

                                  Raspberry Pi 2
                                  Domoticz
                                  RFXCOM
                                  ZWAVE Aeon stick
                                  Coming soon Arduino mysensors GW

                                  1 Reply Last reply
                                  0
                                  • fifipil909F Offline
                                    fifipil909F Offline
                                    fifipil909
                                    wrote on last edited by
                                    #32

                                    Hi,

                                    False detection is only due to power stability issue.
                                    Personnaly i remove the regulator and power the PIR without any boost on the VCC pin. Even below 2v the PIR continue working without any a single issue.

                                    Did you try to do a small delay before sleeping with interupt ? See my post a bit upper.

                                    For me it solve all my false trigger issue.

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

                                      I know this thread's about hc-501. But I guess one can apply some of my hc-505 (mini-pir) experiences from here:
                                      https://forum.mysensors.org/topic/2715/slim-node-as-a-mini-2aa-battery-pir-motion-sensor

                                      1 Reply Last reply
                                      0
                                      • F Offline
                                        F Offline
                                        Fabien
                                        wrote on last edited by Fabien
                                        #34

                                        Same problem here every time m node wake-up I have a false trigger. With delay (@fifipil909) it's not better

                                        1 Reply Last reply
                                        0
                                        • L Offline
                                          L Offline
                                          LastSamurai
                                          Hardware Contributor
                                          wrote on last edited by
                                          #35

                                          Mhm I still have strange results from my PIR sensor (doesn't even seem to be the wake up that influences them).
                                          I have the pir with diode and voltage regulator removed powered by a boost converter with the low pass filter and a pull down resistor. Using a clean 3.3V worked though, but I really want to use batteries (with sometimes less than 3V). Directly powering the sensor with the 2.x V did not work either.
                                          For one of the guys with working sensors: what is your exact setup? None of the tipps I found seem to work. I would really love to get one sensor running. Only idea I still have is to try with another sensor.

                                          Here is the code I am currently using:

                                          
                                          #include <MySensor.h>  
                                          #include <SPI.h>
                                          
                                          unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
                                          #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
                                          #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
                                          #define CHILD_ID 1   // Id of the sensor child
                                          
                                          #ifdef DEBUG
                                          #define DEBUG_SERIAL(x) Serial.begin(x)
                                          #define DEBUG_PRINT(x) Serial.print(x)
                                          #define DEBUG_PRINTLN(x) Serial.println(x)
                                          #else
                                          #define DEBUG_SERIAL(x)
                                          #define DEBUG_PRINT(x) 
                                          #define DEBUG_PRINTLN(x) 
                                          #endif
                                          
                                          MySensor gw;
                                          // Initialize motion message
                                          MyMessage msg(CHILD_ID, V_TRIPPED);
                                          
                                          void setup()  
                                          {  
                                          
                                            DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
                                            DEBUG_PRINTLN("Serial started");
                                          
                                            gw.begin();
                                          
                                            // Send the sketch version information to the gateway and Controller
                                            gw.sendSketchInfo("Motion Sensor Test", "24052016");
                                          
                                            pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
                                            // Register all sensors to gw (they will be created as child devices)
                                            gw.present(CHILD_ID, S_MOTION);
                                            
                                          }
                                          
                                          void loop()     
                                          {     
                                            // Read digital motion value
                                            boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; 
                                            DEBUG_PRINT("Got tripped: ");
                                            DEBUG_PRINTLN(tripped);
                                                  
                                            gw.send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
                                           
                                            DEBUG_PRINTLN("Sleeping till next interrupt");
                                          
                                            // Sleep until interrupt comes in on motion sensor. Send update every two minute. 
                                            //gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME);
                                            // Sleep until interrupt comes in on motion sensor. Won't wake up otherwise
                                            gw.sleep(500);
                                            gw.sleep(INTERRUPT, CHANGE, 0);
                                            //gw.sleep(INTERRUPT, RISING, 0);
                                          }
                                          
                                          
                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          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