Using the digitalRead function, I'm trying to detect the state of the PIR motion sensor connected to digital port 3 of my Arduino Uno. It seems to always be delivering a TRUE state, even when there is no motion, which seems to be the root of my code not working. I know there are several other posts about this over the past few years but none seem to provide a solution. This is the source of the test code I (and it seems many others) have used. PIR Motion Sensor with Arduino - Circuit Magic
PIR sensors are VERY sensitive to all kind of influences - I haven't been able to get mine to work on a long cable (2-3m) while the same sensor worked beautifully on a short cable (10 cm or so).
They're also sensitive to all kinds of movement - i.e. changes in the IR image they see. Shield the sensor with an opaque cover to make sure it doesn't see anything to test it not seeing any movement.
Make sure you have set the pots to short delay times, it can go down to a few seconds, otherwise you may have to wait 5-10 mins before the signal goes low.
Make sure you turn the "time" pot fully anticlockwise, so the code is the only thing that controls 'on' time. Leave the "sensitivity" pot in the middle.
Leo..