Skip to content

User guide PIR

Patrik Hermansson edited this page Feb 10, 2018 · 1 revision


A HC-SR501 or a HC-SR505 can be used for motion detection.

If you want to use this sensor uncomment in user_config

#define ZsensorHCSR501

#include "config_HCSR501.h"

To change the Mqtt-topic change subjectHCSR501toMQTT in config_HCSR501.h:

#define subjectHCSR501toMQTT "home/HCSR501toMQTT"

Hardware setup:

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.

The files used is config_HCSR501.h and ZsensorHCSR501.ino. ZsensorHCSR501.ino

Clone this wiki locally
You can’t perform that action at this time.