0
\$\begingroup\$

I have connected the PIR motion sensor HC-SR501 to an Arduino Uno and its jumper settings is set to H and GND. (This is not a physical jumper, but a small link that connects both H and GND.)

It detects motion, but sometimes does not notice or retrigger if I am still standing in front of it.

Most times I have to wave my hand to indicate that I am still in front of it.

My test case is

  1. After 2 or 3 seconds of being in front of it, and if I move my hands it should continue to stay in "motion detected" mode.
  2. Even if I don't move, and the fact that I am standing in front of it - it should detect the body heat and stay in "motion detected" mode, as this is an infrared detector.

This behavior works most times, but three out of 10 times it stops detecting my presence and when I wave my hand, it takes the "default" sleep mode of 3 more seconds and then detects the movement.

The delay potentiometer is set to minimum. The distance sensitivity potentiometer is not a problem as I have set it to 3 feet (i.e the minimum) and don't see a problem there.

My problem is that it does not sense my "continued" presence to stay in "motion sensed" mode.

I have connected the motion sensor to an Arduino Uno and doing a digitalRead(Pin5) continuously in a loop every 50ms.

Appreciate if someone could answer and tell why this could be happening.

Just to note: The pins on the motion sensor VCC is connected to 5V of Arduino, GND of the motion sensor to GND on the Arduino and the digital output of the motion sensor to pin 5 of the Arduino.

I have placed the motion sensor at 90 degrees to me standing, does it have to be positioned any other way?

I cleaned the dome assuming there was some clog/dust - this did not help.

Any inputs would be appreciated.

\$\endgroup\$
3
  • \$\begingroup\$ That's how PIR sensors work -- there needs to be an AC signal (pulses -- that's what the "P" stands for) at the output of the internal sensor, because DC is deliberately rejected in order to avoid false triggering. You need to either move a heat source (your hands) across the field of view, or make your temperature pulsate (difficult). \$\endgroup\$
    – Dave Tweed
    Commented Jun 11, 2020 at 11:13
  • \$\begingroup\$ I thought that P was for passive. \$\endgroup\$
    – Transistor
    Commented Jun 11, 2020 at 17:40
  • \$\begingroup\$ See the question and answers to electronics.stackexchange.com/q/487419/73158 for some insight to how PIR sensors work. \$\endgroup\$
    – Transistor
    Commented Jun 11, 2020 at 17:46

1 Answer 1

0
\$\begingroup\$

From your description it seems that you have a motion sensor not a presence sensor - or at least that's the way it's configured.

enter image description here

Figure 1. A PIR motion sensor has a pair of side-by-side PIR sensors in reverse-series connection sense motion while giving high immunity to changes background radiation due to temperature changes. Image source is modified by me with original image from MakerGuides article.

Here it becomes clear that due to the reverse-series connection that walking into the purple detection zone would generate a positive going pulse and walking into the orange zone would give a negative going pulse. Standing still inside or outside the sensing zones results in zero output.

According to Components101 there are two modes.

Repeatable(H) mode
In Repeatable(H) mode the output pin Dout will go high (3.3V) when a person is detected within range and goes low after a particular time (time is set by “Off time control” potentiometer). In this mode the output pin will go high irrespective of whether the person is still present inside the range or has left the area. The sensitivity can be set using the “sensitivity control” potentiometer

Non- Repeatable(L) mode
In “I” mode the output pin Dout will go high (3.3V) when a person is detected within range and will stay high as long as he/she stays within the limit of the Sensors range. Once the person has left the area the pin will go low after the particular time which can be set using the potentiometer. The sensitivity can be set using the “sensitivity control” potentiometer.

Try configuring for ""I" mode.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks so much for the detailed answer. I was able to resolve the problem, It was a faulty motion sensor. I replaced it with another and now the "Repeatable" mode works and that's what I wanted. \$\endgroup\$ Commented Jun 17, 2020 at 10:24
  • \$\begingroup\$ Good. Please accept this answer if it helped or write your own and accept it (you may have to wait some hours before you can accept) o mark the problem as solved. \$\endgroup\$
    – Transistor
    Commented Jun 17, 2020 at 10:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.