Wire it

PIR sensors and the Pi 3 sometimes don't get along - if you're having false trigger reports, make sure the PIR Sensor is far away from the Pi 3

Connections on Prototyping Pi Plate:

PIR Sensor
  • Red -> 5V
  • Yellow Data -> input 24
  • Black -> Ground
Door Switch
  • One wire to ground, the other to input 23, with a 10k pull-up resistor to 3v3
Indicator LEDs
  • Green connected to output 18 through a 220ohm resistor, will correspond to motion detection
  • Red connected to output 25 through a 220ohm resistor, will correspond to an open magnetic door switch
And of course, some sort of stereo or portable speaker in the 1/8in jack so you can hear it!

That's it! Now on to the code...
Last updated on 2016-06-23 at 10.35.23 PM Published on 2012-12-20 at 07.35.26 AM