User guide PIR
A HC-SR501 or a HC-SR505 can be used for motion detection.
If you want to use this sensor uncomment in user_config
To change the Mqtt-topic change subjectHCSR501toMQTT in config_HCSR501.h:
#define subjectHCSR501toMQTT "home/HCSR501toMQTT"
|Module Pin||RX Pin||TX Pin|
|PIR Sensor Out||D7||-|
For Esp32 use D5 instead. This is configured in config_HCSR501.h.
Vcc pin of the Arduino/Esp and the PIR to a 5V supply source
Ground pins of the Arduino/Esp and the PIR to the ground of the supply source.