Detecting motion with a PIR sensor