I have 2 motion sensors in a doorway, my plan is to see if motion sensor 1 THEN 2 is triggered someone has entered, if 2 THEN 1 has been triggered then someone has exited. I already know how to program the motion sensors but how to i know if 1 THEN 2 has been triggered or vice versa.
Asked
Active
Viewed 28 times
0
-
How are the sensors connected to the raspberry? What have you tried and which part are you stuck at? – Roger Lindsjö Feb 05 '20 at 18:54
-
currently i am trying to make python react diffrently if sensor 1 is tripped and the 2 is or vice versa – MAD Science Bdukester10 Feb 05 '20 at 18:57
-
So the problem isn’t gettong input from the sensors, but rather in which order they are triggered? If you keep a timestamp for when the sensor was triggered last you could have logic checking when other sensor was triggered. If ”just before” you can infer direction. If not, wait for other sensor. Show what code you already have. – Roger Lindsjö Feb 05 '20 at 20:59
-
Im still in the planning stage so no code yet. How do you suggest I go about this timestamps? – MAD Science Bdukester10 Feb 06 '20 at 23:02