RPi/motion

From Bjoern Hassler's website
< RPi
Jump to: navigation, search

1 Project 2: Image capture and motion detection[edit]

1.1 Using motion[edit]

Motion can be used for image capture. I thought it might be nice to capture images of the "environment" alongside temperature.

sudo apt-get install motion

You then need to edit the config file:

/etc/motion/motion.conf

And enable the daemon (if you are going to use it):

/etc/default/motion

Then start the service:

sudo service motion start

1.2 Using a PIR sensor[edit]

See e.g. this guide for the Adafruit PIR sensor [1] on the PIR sensor. Note:

  • The jumper switch: non-retriggering (jumper towards edge, H) vs. retriggering (jumper towards middle, L). If you have something that "edge triggered", you should have the "L" setting (jumper more to centre of board)
  • The pods, for
    • timeout - duration for which the output is high after detecting motion (in the pictures on the above link, you can see the positions are labeled as min/max)
    • sensitivity: clockwise makes it more sensitive (also labeled as min/max).

My PIR sensor doesn't seem to be an Adafruit one, and while it has similar switch/pods, they aren't quite in the same locations. Compared to the adafruit one, the jumper is to the right of the pods (with the cap on top, looking at the pods).

  • Retriggering is with the jumper towards the edge, non-retriggering is with the jumper to the centre (opposite of adafruit)
  • Pods
    • Same as Adafruit, the left pod (cap on top, looking at the pods) does timeout. Shortest time about 3 secs, and easily up to a few mins.
    • The other pod is sensitivity.

1.2.1 Important: Interference[edit]

I've not seen this mentioned on pages describing the PIR use, but apparently the PIR sensor can be susceptible to interference, see https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=112111&p=1120330.