Configure and Test

There are lots of ways to get the sketch from the listing below onto your Raspberry Pi. Perhaps the easiest is to connect to your Pi using SSH (See Lesson 6) opening an editor using the command below:


.. and then pasting in the code , before saving the files using CTRL-x.

To start with, place the magnet next to the switch and cover the PIR sensor with something.

Run the program as superuser using the command:

sudo python

..and you should see some trace appear in the terminal, when you move the magnet, or take the cover off the PIR sensor.

A good exercise might be to place your kids in-front of the PIR sensor and see how long they can keep still!

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
Last updated on 2016-06-23 at 10.41.11 PM Published on 2013-02-13 at 10.35.59 AM