I just purchased a cheap motion sensor off Amazon (around £2.50) and attached it to a Raspberry Pi using a PiFace board.
The Raspberry Pi is running Domoticz home automation software.
The installation of the necessary software to drive the PiFace board with Domotiz is covered here.
I have attached the sensor line from the PIR to input 0 on the PiFace board, and the positive power line to the +5V terminal, with the last line to the ground terminal.
My piface.conf file looks like this :
and
This is to let me use the LED connected to output 7 to signal if the motion sensor is triggered or not – making it much easier to debug any problems with the PIR sensor or the wiring etc.
The setup in the Domoticz hardware configuration looks like this :
indicating that the PiFac board is recognised by Domoticz (and the Raspberry Pi)
Under the “Switches” tab you should now see :
and
If you have activated the 2 devices (and given them roughly the same names as I have).
Then the scripts to blink the LED on port 7 as the motion sensor detects movement :
and