Motion Detection with PIR and Raspberry PI: HC-SR501 wiring and Python Code



Projects involving motion detection actions require a reliable way to run their code when an object movement happens. One of the most common solutions to accomplish this task is by the HC-SR501 PIR sensor with Raspberry PI.
In this tutorial, I’m going to show you how to connect and use a PIR with Raspberry PI computer boards using Python.
What is a PIR
A PIR (Passive InfraRed, sometimes named “PID” as “Passive Infrared Detector”) sensor is an electronic device able to measure the infrared (IR) light radiating from objects. The term passive means that the PIR module doesn’t radiate energy for detection purposes: it only detects infrared radiation emitted by or reflected from objects.
It can make your project aware if a generic movement happened in its range of view, but it can’t give more information (like, for example, who, where and how many the object moved).
You can find a more detailed description of how the PIR works from the following Glolab PIR page.
-

- Login or register to post comments
Printer-friendly version- 1022 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
today's howtos
|
Open Hardware: XON/XOFF and Raspberry Pi Pico
|
Security Leftovers
|
How to Apply Accent Colour in Ubuntu Desktop
A step-by-step tutorial on how to apply accent colour in Ubuntu desktop (GNOME) with tips for Kubuntu and others.
|





This section of TuxMachines will no longer have new stories in it (with some caveats, including this post). To see the latest stories go to 

.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 day 22 hours ago
2 days 2 hours ago
2 days 2 hours ago
3 days 9 hours ago
3 days 10 hours ago
3 days 11 hours ago
3 days 11 hours ago
3 days 11 hours ago
3 days 14 hours ago
3 days 16 hours ago