# PIR motion sensor always high

**URL:** <https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856>\
**Category:** Support\
**Created:** [January 14, 2021, 4:41am UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856 "2021-01-14T04:41:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnstaveley](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@johnstaveley](https://forums.pimoroni.com/u/johnstaveley)\
**Post date:** [January 14, 2021, 4:41am UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/1 "2021-01-14T04:41:13Z")

</div>

I have bought the PIR motion sensor: [PIR motion sensor – Pimoroni](https://shop.pimoroni.com/products/pir-motion-sensor)  
I have wired it up according to this tutorial: [How to Interface a PIR Motion Sensor With Raspberry Pi GPIO | Raspberry Pi | Maker Pro](https://maker.pro/raspberry-pi/tutorial/how-to-interface-a-pir-motion-sensor-with-raspberry-pi-gpio)  
Here is my code:  
import RPi.GPIO as GPIO  
import time  
GPIO.setwarnings(False)  
GPIO.setmode(GPIO.BOARD)  
GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor  
while True:  
i = GPIO.input(11)  
time.sleep(0.5)  
if i==0: #When output from motion sensor is LOW  
print(“No intruders”)  
elif i==1: #When output from motion sensor is HIGH  
print(“Intruder detected”)

However i is always 1, unless I unplug it and it goes to zero. I have tried turning the sensitivity and delay down, hiding the PIR in a box etc. Nothing works, always high.

I have also tried it on pins 7 and 3 and in .net code which works with another PIR I have. Still doesn’t work.

---

<div class="post-metadata">

**Author:** ![malchick](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@malchick](https://forums.pimoroni.com/u/malchick)\
**Post date:** [January 18, 2021, 11:13am UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/2 "2021-01-18T11:13:58Z")

</div>

I have a PIR motion sensor attached to a pi zero which controls an addressable led strip. I tested your code on my setup and it works perfectly. Could this be a hardware problem with the PIR?

---

<div class="post-metadata">

**Author:** ![johnstaveley](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@johnstaveley](https://forums.pimoroni.com/u/johnstaveley)\
**Post date:** [January 18, 2021, 11:29am UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/3 "2021-01-18T11:29:24Z")

</div>

thanks for looking into this. That was my thought but I wanted to make sure I wasn’t doing something obviously wrong. Do you think I should return the item as defective?

---

<div class="post-metadata">

**Author:** ![malchick](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@malchick](https://forums.pimoroni.com/u/malchick)\
**Post date:** [January 18, 2021, 11:43am UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/4 "2021-01-18T11:43:49Z")

</div>

Yes, that’s what I would do. As you’ve tested the PIR on different pins it seems reasonable that the fault is with the PIR.

---

<div class="post-metadata">

**Author:** ![johnstaveley](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@johnstaveley](https://forums.pimoroni.com/u/johnstaveley)\
**Post date:** [January 22, 2021, 3:08pm UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/5 "2021-01-22T15:08:19Z")

</div>

For anyone else that has this problem. The actual problem is that the pins are not as described in the tutorial " [How to Interface a PIR Motion Sensor With Raspberry Pi GPIO | Raspberry Pi | Maker Pro](https://maker.pro/raspberry-pi/tutorial/how-to-interface-a-pir-motion-sensor-with-raspberry-pi-gpio)" but are reversed. The actual pins are described here: [Raspberry Pi GPIO Sensing: Motion Detection– The Pi Hut](https://thepihut.com/blogs/raspberry-pi-tutorials/raspberry-pi-gpio-sensing-motion-detection)

---

<div class="post-metadata">

**Author:** ![johnstaveley](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@johnstaveley](https://forums.pimoroni.com/u/johnstaveley)\
**Post date:** [January 22, 2021, 3:10pm UTC](https://forums.pimoroni.com/t/pir-motion-sensor-always-high/15856/6 "2021-01-22T15:10:13Z")

</div>

For anyone else that has this problem, the pins are not correct but are the reverse to those described in the tutorial. Follow this tutorial if you want things to work: [Raspberry Pi GPIO Sensing: Motion Detection– The Pi Hut](https://thepihut.com/blogs/raspberry-pi-tutorials/raspberry-pi-gpio-sensing-motion-detection)
