Table of Contents

Understanding PIR Motion Sensors

Example Description
Discover how Passive Infrared (PIR) motion sensors work, their principle of detecting infrared radiation, and their applications in security systems and lighting control
Introduction

A Passive Infrared (PIR) motion sensor is a device commonly used in security systems, lighting control, and other applications to detect the presence of a moving object or person by measuring changes in infrared radiation. It’s called “passive” because it doesn’t emit any energy itself; it only detects the infrared radiation emitted by objects in its field of view.

  1. Detection Principle: PIR sensors work based on the fact that all objects with a temperature above absolute zero (-273.15°C or -459.67°F) emit infrared radiation. PIR sensors are designed to detect changes in the amount of infrared radiation in their surroundings.
  2. Sensor Construction: A PIR sensor typically consists of two pyroelectric sensors, which are sensitive to changes in temperature, and a special Fresnel lens that focuses the infrared radiation onto these sensors.

Overview | PIR Motion Sensor | Adafruit Learning System

Circuit

connection

IR_VCC – 5v

IR_GND – GND

IR_OUTPUT – D7

LED+ to D9

LED- to  GND

Resistance -270

Code

Create a circuit as per the above circuit diagram

  1. From control drag  if -else block.
  2. From the Arduino sensor palette, add a “read digital sensor () at ()” block. Choose “PIR” as the sensor type and select pin 7.
  3. The sensor’s detection of an object will alter the status of pin 7 from LOW to HIGH. In response to object detection, add the “set digital pin () output as ()” block from the Arduino palette within the “if” block.
  4. For the “else” part, ensure the LED turns off when no object is in front of the sensor.
  5. Drag a “forever” block from the controls palette and place the above set of blocks inside it.
  6. finally, add when flag clicked block from events palette

 

Script

Output

OUTPUT will be updated soon