Detect Motion with the Pi

Chances are good that you benefit from motion detectors several times a week or even several times a day. They might turn on the lights automatically at dark, or perhaps they turn on the lights when you enter the restroom at work. In this section, you’ll learn how these detectors work, and you’ll learn how to turn the Pi into a motion detector.

Connect the PIR Sensor to the Pi

Many motion detectors use passive infrared (PIR) sensors.[116] A PIR sensor permanently measures infrared light and notices whenever something in the infrared spectrum changes. This is all you need to detect motion, because nearly every object emits infrared light. That’s true for everything in front of your house: the ground, a bicycle, a garbage ...

Get Raspberry Pi, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.