I'm trying to get a motion sensor (SR-505) to work on the ESP32.
Searching the internet I found a way that supposedly would work. But with me it doesn't work. Nothing is detected. I've tried using two sensors of the same model, but nothing, I don't know what it could be.
Hi,
The output of this module (SR-505) is LOW 0V and HIGH +3.3V,
but its power needs to be from +4.5V to a maximum of +20V.
If you are feeding it with +3.3V, it will not work.
The problem is that when it detects the presence of movement and the sensor value goes to HIGH, it still remains for a few seconds, sometimes short but sometimes long.
the problem is that the sensor already starts at HIGH. And then what I get on the serial monitor is the following:
11:33:05.305 -> 1
⸮⸮⸮E⸮4⸮Q⸮5 r+3H⸮STATE PIR
11:33:05.601 -> 1
11:33:05.601 -> LAST STATE PIR
11:33:05.652 -> 0
11:33:05.652 -> ON!
11:33:05.652 -> STATE PIR
11:33:05.700 -> 1
11:33:05.700 -> LAST STATE PIR
11:33:05.700 -> 1
11:33:05.700 -> STATE PIR
11:33:05.700 -> 1
11:33:05.745 -> LAST STATE PIR
11:33:05.745 -> 1
11:33:05.745 -> STATE PIR
11:33:05.745 -> 1
11:33:05.745 -> LAST STATE PIR
11:33:05.793 -> 1
11:33:05.793 -> STATE PIR
11:33:05.793 -> 1
11:33:05.793 -> LAST STATE PIR
11:33:05.793 -> 1
11:33:05.793 -> STATE PIR
11:33:05.840 -> 1
11:33:05.840 -> LAST STATE PIR
11:33:05.840 -> 1
11:33:05.840 -> STATE PIR
11:33:05.840 -> 1
11:33:05.840 -> LAST STATE PIR
11:33:05.887 -> 1
11:33:05.887 -> STATE PIR
11:33:05.887 -> 1
11:33:05.887 -> LAST STATE PIR
11:33:05.934 -> 1
11:33:05.934 -> STATE PIR
11:33:05.934 -> 1
11:33:05.934 -> LAST STATE PIR
11:33:05.934 -> 1
11:33:05.934 -> STATE PIR
11:33:05.979 -> 1
11:33:05.979 -> LAST STATE PIR
11:33:05.979 -> 1
11:33:05.979 -> STATE PIR
11:33:05.979 -> 1
11:33:05.979 -> LAST STATE PIR
11:33:06.028 -> 1
11:33:06.028 -> STATE PIR
11:33:06.028 -> 1
11:33:06.028 -> LAST STATE PIR
11:33:06.028 -> 1
11:33:06.074 -> STATE PIR
11:33:06.074 -> 1
11:33:06.074 -> LAST STATE PIR
11:33:06.074 -> 1
11:33:06.074 -> STATE PIR
11:33:06.121 -> 1
11:33:06.121 -> LAST STATE PIR
11:33:06.121 -> 1
11:33:06.121 -> STATE PIR
11:33:06.121 -> 1
11:33:06.121 -> LAST STATE PIR
11:33:06.167 -> 1
11:33:06.167 -> STATE PIR
11:33:06.167 -> 1
11:33:06.167 -> LAST STATE PIR
11:33:06.167 -> 1
11:33:06.215 -> STATE PIR
11:33:06.215 -> 1
11:33:06.215 -> LAST STATE PIR
11:33:06.215 -> 1
11:33:06.215 -> STATE PIR
11:33:06.215 -> 1
11:33:06.261 -> LAST STATE PIR
11:33:06.261 -> 1
11:33:06.261 -> STATE PIR
11:33:06.261 -> 1
11:33:06.261 -> LAST STATE PIR
11:33:06.308 -> 1
11:33:06.308 -> STATE PIR
11:33:06.308 -> 1
11:33:06.308 -> LAST STATE PIR
11:33:06.308 -> 1
It does not change from HIGH to LOW. It stays on HIGH for more than a minute and doesn't change.
The connection still remains the same. ESP32, the (+) connected to the VIN pin, the (-) to the GND and I'm using pin 15.