https://embetronicx.com/tutorials/microcontrollers/pic16f877a/pir-sensor-interfacing-with-pic16f877a/
PIR Sensor Interfacing with PIC16F877A