Adding a motion sensor (hc-sr501) to my Raspberry Pi

As part of my “make my home a bit smarter” projects, I wanted to add simple motion detection via motion sensor to a Raspberry Pi. This is the first project with a hc-sr501 motion sensor I tried. The goal is to combine the sensor with an esp8266, but this is another project (as I’m still…