PIR Motion sensor detecting without touching
Ask QuestionAsked 3 days agoActive todayViewed 34 times1
I have setup my raspberry pi and have inserted the correct wires to the motion sensor, i am currently running a a simple script that detects motion however it constantly outputs that it motion is detected although i have no interacted with the sensor. I am unsure as to what i should do as ive tried numerous things.
here is the script also:
from gpiozero import MotionSensor
import time
print ("Ready")
pir = MotionSensor(4)
time.sleep(40)
while True:
if pir.motion_detected:
print("Motion detected")
time.sleep(2)
sensorShareEditFollowClose 2Flagasked Apr 26 at 18:40Kazi Ilyas2911 bronze badge New contributor
- what is the purpose of the picture? … please draw a diagram of the connections between the sensor and the RPi – jsotola Apr 26 at 22:32
3 Answers
Question
How come my PIR motion sensor output is always High, falsely detects something moving?
Answer

- Your photo is very nice.
- I see the PIR motion sensor in the bottom right corner.
- You motion sensor is very popular, but very unstable.
- I would recommend to use a good sensor.
- You might like to read my PIR answer (Ref 1), for more details on:a. How to prove that the PIR is unstable.b. Which stable PIR sensor to use.
References
(1) Why is HC-SR501 PIR motion Sensor always on? Asked 2020, Viewed 3k times
ShareEditDeleteFlaganswered just nowtlfong013,67433 gold badges88 silver badges2222 bronze badgesAdd a comment0
Question
How come my PIR motion sensor output is always High, falsely detecting something moving?
Answer
- Your photo is very nice.
- I see your PIR motion sensor in the bottom right corner.
- This motion sensor, HC-SR501, is very popular, but very unstable.
- I would recommend to use a very stable sensor, AM302.
- You might like to read my PIR answer (Ref 1), for more details on:a. How to prove that the PIR is unstable.b. Which stable PIR sensor to use.
References
(1) Why is HC-SR501 PIR motion Sensor always on? Asked 2020, Viewed 3k times
(2) PIR Learning Notes v0.3 – tlfong01 2021apr30hkt1100
ShareEditDeleteFlagedited 5 mins agoanswered 13 mins agotlfong013,67433 gold badges88 silver badges2222 bronze badgesAdd a comment2
That is not a motion sensor. It is a heat detector. If it sees a change in infra-red (heat) it raises an alarm.
As long as you are ‘seen’ by the sensor it will raise an alarm.ShareEditFollowFlaganswered Apr 26 at 19:43joan62.5k55 gold badges6060 silver badges9494 bronze badges
- 1As you said, if it sees a change in IR it will trigger the output. If a warm object is stationery then the sensor sees no change and does not raise an alarm. So, it is a motion sensor if it is a warm object that is in motion. – Elliot Alderson Apr 26 at 21:23
- 1Yes it is a motion sensor, here is the link of the purchase – thepihut.com/products/… – Kazi Ilyas Apr 26 at 23:54
Categories: Uncategorized