Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

Detecting movement with a PIR sensor

A PIR sensor is a device that can detect infrared light (heat) emitted by an object (for example, a person). We see these types of sensors all around us in applications such as security systems and automatic doors and lights that react to our presence. The passive in PIR means the sensor just detects movement. To detect what moved and how, you would need an active infrared device, such as a thermal camera.

PIR sensors come in a few different forms and varieties; however, their basic usage is the same – they act as a simple digital switch. When they do not detect movement, they output a digital LOW, and when movement is detected, they output a digital HIGH.

Shown in the following figure is the HC-SR501 PIR sensor module that we will be using for our example. Pictured are the top of the module, the underside, and a common schematic symbol for a PIR sensor:

Figure 11.1 – HC-SR501 PIR sensor module

Some PIR sensors, including our...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461