I recently bought an HC-SR505 Mini PIR sensor. I connected its positive to my Arduino UNO's 5v, output to digital pin 2, and ground to ground. I used Adafruit's code to test it, but all the serial monitor displayed was "Motion detected", which meant the PIR was always on a HIGH state. I then also tried powering it using 3V3 but the PIR kept on cycling on a HIGH and LOW state. Any help on getting my sensor to actually work would be greatly appreciated.
The PIR sensor has delay of 8 seconds. So when you turn on arduino, take care that no movement is on the PIR, and then after 8 seconds it should detect no movement. And it has always this delay,every time when detects movement.
The PIR works at 5V but you need to tweak the amount of sensibility and the signal length. Usually when a motion is detected, the PIR keeps sending HIGH until x seconds defined by a potentiometer on the board, when it goes down, the sensor is ready to capture another motion.
Switch to use 5v for Vcc, the sensor will work correctly. I have the same trouble if I use 3.3v for Vcc. The output still 3.3v even your Vcc is higher than 5v.
The HC-SR505 module IC is EG4002A, http://www.egmicro.com/download/EG4002_datasheet.pdf
so check against the schematics in the PDF.
I have similar problem with the HC-SR505 sensor. First few seconds it holds 0 on the output pin, and then always 1. I think it was bad batch of sensors. Bad batch in chinese manufacturing means thousands (or hundreds of thousands) bad modules flooded the market.
Meanwhile I decided to choose one of options:
- Stick with HC-SR501 sensor. It's bigger but works more or less.
- Buy expensive ($5.90) PIR sensor from seeed.
- Build my own PIR module by my required dimensions and function (in progress).
Update: From 5 sensors received 2 do the job. Supply voltage must be 5V or higher. First 20-60 seconds the output is not reliable and should be ignored. Then it works OK (if it works at all). Since the module has 3.3V LDO onboard the output signal is 3.3V.
I'm a noob. I had the same problem.
I connected the signal to pin 7 so I listened to gpio7 which always gave 1. But pin 7 is gpio4... Listening to gpio4 fixed the issue :)