Need Guidance about PIR sensor output holding time

I am making an automated washroom using Arduino and PIR sensor.
I just want to know how much time should I set for the PIR sensors output holding time.

By holding time, do you mean the time that the PIR output goes high (of low) when motion is detected?

The holding time is probably somewhat irrelevant. Use your Arduino to detect the change of state of the PIR output and then you can generate whatever time interval you lime.

What do you do with this information?
42 is the answer (because 42 = (-80538738812075974)3 + 804357581458175153 + 126021232973356313)

30 seconds.

1 Like

What if some one doesn't move for 60s. PIR output will go LOW and lights will be turned off.

Why 42???
What if some one doesn't move for 60s. PIR output will go LOW and lights will be turned off.

@J-M-L knows the secret.

Suppose I went to washroom. Lights would turn ON automatically(PIR==1). My PIR is in retriggering mode. If I don't move (PIR==0) and lights would be turned off. If PIR holds output for 60s lights would be turned ON for 60 seconds even if someone doesn't move.
If some one doesn't move for 61s, lights will turn OFF. I want the lights only be turned OFF while there is no one in the room.

Maybe a PIR sensor is not the right sensor for your application. As you say, if the person stops moving for whatever reason, then the sensor won't detect anything.

You could use a reed switch and magnet pair on the door and frame to turn the light on if the door is closed. However, that would also turn the light on if somebody simply closed the door.

Maybe you could use a combination of the two. The PIR sensor triggers when a person enters the washroom. Then using your Arduino you could monitor the reed switch to see if the door is closed. You could then keep the light on as long as the reed switch is closed.

Another option may be to somehow detect that the door has been locked and use that to keep the light on.

If you are limited to using just the PIR sensor, then you could just pick an excessive timeout such as 5 minutes and let your Arduino handle the 5 minute countdown. Each time the PIR detects movement, the countdown is reset to 5 minutes.

2 Likes

Which is how every timed light switch works. @rrreyad don't overthink something that is simple af.

1 Like

Thanks everyone.
Will try using 100s. If it doesn't work than I will go for higher time.

If the light turns off and it’s dark, the user will move, no need to overthink it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.