Code to support motion detector, code will run on Raspberry Pi