Motion Sensor triggering on its own
-
Hi, I build a mysensors motion sensor with a nano a couple of weeks ago, and initially it appeared to be working very well and has been switching on my lights when motion is detected for the last few weeks perfectly happily
However I have noticed over the last few days it has been triggering on its own without any motion.
I was watching the mqtt messages earlier today and it was appearing to be triggered with motion every few minutes, even though nothing was there. I have not tried swapping the sensor for another one in case its a problem with the sensor, but I was wondering if there is any other possible reason for these false triggers??
I do have the sensor powered directly from the nano via the 5v pin, is that likely to cause any problems?
I've also just rememebered that there is a radiator in the hall way where the sensor is placed, so I'm wondering if when the heating comes on it detects that heat and triggers the sensor?
-
thanks @hek the sensor is currently stuck half way up a wall, where would you recommend installing it? wall or ceiling? I was also a little unclear about the jumper settings which is best?
-
A tutorial how a PIR sensor is detecting, using the Fresnel lens. To understand that the PIR is detect areas of "heat" and "cold"
http://www.instructables.com/id/PIR-Motion-Sensor-Tutorial/ -
I have just find out the same problem with one of my nodes that have a HC-SR501 motion sensor.
It is a Arduino 5v with the same sketch as 3 other nodes.It updates every second and i have it right now in a closed box so it shuld not trigger any motion.
I have tried to clearEEPROM and tried again, but i get the same result.What can i do?
-
@ErrK try to rewire the node - you can also measure if the signal pin from motion sensor is high all the time.
-
@ErrK try to rewire the node - you can also measure if the signal pin from motion sensor is high all the time.
@sundberg84 thanks. I will try it.
-
I have just find out the same problem with one of my nodes that have a HC-SR501 motion sensor.
It is a Arduino 5v with the same sketch as 3 other nodes.It updates every second and i have it right now in a closed box so it shuld not trigger any motion.
I have tried to clearEEPROM and tried again, but i get the same result.What can i do?
@ErrK I had similar problem with my hc-sr501 pir. It seems that some pirs are very sensitive to any electromagnetic noise. For me pir was reporting false positives each time nrf was sending data. You can easily test it: just remove any gw.send commands and solder led to pir output (of course through 1k resistor). When pir is detecting a motion output goes high so led will go on for the time set by pir potentiometer. In my case each sending (when for example battery level was reported each 30 min) resulted in false pir trigger.
It seems that this depends on specific device. I switched pirs between my sensors and this false triggering went to other node :-)
Finally I solved this problem in software. I can share my sketch that is working well for two of my nodes.Btw: there are many discussions on the web about those pir false triggering concerning remote radio nodes. I took the idea of software solution from there.
Of course in your case reasons can be different...
-
@ErrK I had similar problem with my hc-sr501 pir. It seems that some pirs are very sensitive to any electromagnetic noise. For me pir was reporting false positives each time nrf was sending data. You can easily test it: just remove any gw.send commands and solder led to pir output (of course through 1k resistor). When pir is detecting a motion output goes high so led will go on for the time set by pir potentiometer. In my case each sending (when for example battery level was reported each 30 min) resulted in false pir trigger.
It seems that this depends on specific device. I switched pirs between my sensors and this false triggering went to other node :-)
Finally I solved this problem in software. I can share my sketch that is working well for two of my nodes.Btw: there are many discussions on the web about those pir false triggering concerning remote radio nodes. I took the idea of software solution from there.
Of course in your case reasons can be different...
@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? -
I have solved this by reading the status of the HC-SR501 twice. Works finde for me.
boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; Serial.println(tripped); if (tripped==1){ //wait delay(100); //read the pin again tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; if (tripped==1){ gw.send(msg2.set(tripped?"1":"0")); // Send tripped value to gw } } -
The same problem for me. Different HC-SR501 sensors (connected to one of three nodes with this sensors) periodically entering "flood mode" with continuous sending 1/0 values. I suspect that this is power supply related problems.
-
I have for a sonar sensor (Ultrasonic Module HC-SR04) used in RPI and written in Python, used to measure 3 times and if all 3 measurements are same, then result is valid and data send. This is working perfect for me. You can create something similar for your Arduino
intdistance = 0
distance = -1 continueLoop = True log.debug("Loop until distance1 = distance2 = distance3") while(continueLoop): #distance = ser.read(size=3) distance = ser.readline() getValue1 = distance.rstrip('\r\n') log.debug("distance1: %s", getValue1) distance = ser.readline() getValue2 = distance.rstrip('\r\n') log.debug("distance2: %s", getValue2) distance = ser.readline() getValue3 = distance.rstrip('\r\n') log.debug("distance3: %s", getValue3) distance == getValue1 if getValue1 == getValue2 and getValue2 == getValue3 : continueLoop = False intdistance = int(distance) log.info("distance: %d to be sent to Agocontrol", intdistance) -
The same problem for me. Different HC-SR501 sensors (connected to one of three nodes with this sensors) periodically entering "flood mode" with continuous sending 1/0 values. I suspect that this is power supply related problems.
@robosensor Have you tried to enable the ibternal pullup for the pin?
-
@robosensor Have you tried to enable the ibternal pullup for the pin?
@Jan-Gatzke said:
@robosensor Have you tried to enable the ibternal pullup for the pin?
Didn't read biss0001 datasheet, so I don't know is output pin 5V-compatible (for pullup) or not, so I didn't tried to enable internal pullup.
In any case I will try to check what happens with OUT pin of module during this 1/0 flood.
-
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.


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? -
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.
-
@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?@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.
-
@Maciej-Kulawik , how are you powering the node? I had once a PIR false-triggering due power instabilities...
-
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);