I have bought the PIR motion sensor: PIR motion sensor – Pimoroni
I have wired it up according to this tutorial: How to Interface a PIR Motion Sensor With Raspberry Pi GPIO | Raspberry Pi | Maker Pro
Here is my code:
import RPi.GPIO as GPIO
GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor
i = GPIO.input(11)
if i==0: #When output from motion sensor is LOW
elif i==1: #When output from motion sensor is HIGH
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.