0% found this document useful (0 votes)
12 views16 pages

Co5 Exp6

The document details an experiment on interfacing a Passive Infrared (PIR) sensor with an Arduino, explaining the sensor's construction, working principles, and applications in motion detection. It outlines objectives such as reading sensor data, controlling an LED, and designing a home automation system. Additionally, it includes circuit connections and sample code for implementation.

Uploaded by

harsha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views16 pages

Co5 Exp6

The document details an experiment on interfacing a Passive Infrared (PIR) sensor with an Arduino, explaining the sensor's construction, working principles, and applications in motion detection. It outlines objectives such as reading sensor data, controlling an LED, and designing a home automation system. Additionally, it includes circuit connections and sample code for implementation.

Uploaded by

harsha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Experiment 6 :

Interfacing PIR Sensor with Arduino


Passive Infrared (PIR) Sensor
• A passive infrared sensor (PIR sensor) is an electronic sensor that
measures infrared (IR) light radiating from objects in its field of view.

• The term passive refers to the fact that PIR devices do not radiate
energy for detection purposes.

• They work entirely by detecting infrared radiation (radiant heat) emitted


by or reflected from moving objects.

• PIR sensors detect general movement, hence used for motion detection.

• PIR sensors are commonly used in security alarms and automatic


lighting applications.

2
Symbolic Representation

Symbolic Photograph of PIR


Representation sensor
3
Construction of HC-SR501 PIR sensor
• PIRs are made of pyroelectric sensors, a round metal can with a rectangular crystal in the
center, which can detect levels of infrared radiation.
• A PIR sensor consists of two main parts:
1) Pyroelectric crystal 2) Fresnel lens

Side View Top View Bottom View


4
Working Principal of PIR Sensor
• A PIR sensor can detect changes in the amount of infrared radiation impinging upon it.

• Every object emits low-level radiation, and for hotter object more radiation is emitted.

• A pyroelectric sensor consists of a window with two rectangular slots (two halves). They
allows infrared radiation to pass through them.

• There are two separate infrared sensor electrodes, one responsible for producing the
positive output and the other for producing the negative output.

• When one slot detects more or less IR radiation than other, it means motion is detected
(logic HIGH).

• When change is not detected, both slots has same IR radiation. These two outputs will
cancel each other which means motion is not detected (logic LOW).

5
Working Principal of PIR Sensor

6
Construction of HC-SR501 PIR sensor

Reference: HC-SR501 PIR Sensor Working, Pinout & Datasheet (components101.com)


7
H and L Modes
L Mode

H Mode

8
Aim
● The main objective of this experiment is

1. To interface PIR sensor with Arduino UNO, read PIR


sensor data and print on the Serial Monitor

2. To perform motion detection by glowing LED using


PIR sensor and Arduino UNO

3. To design a home automation system by using PIR


sensor and buzzer.

9
Circuit Connections: Objective 6(a)

10
Program: Objective 6(a)
int PIRSensor = 4;
int PIRSensorState; if (PIRSensorState == HIGH)
void setup() {
{ Serial.println("Motion detected");
pinMode(PIRSensor, INPUT); }
Serial.begin(9600);
} else
{
void loop() Serial.println("Motion not detected");
{ }
PIRSensorState = digitalRead(PIRSensor);
Serial.print("PIR Sensor Output = "); }
Serial.println(PIRSensorState);
delay(1000);

11
Circuit Connections: Objective 6(b)

12
int PIRSensor = 4;
int PIRSensorState; if (PIRSensorState == HIGH)
void setup() {
{ Serial.println("Motion detected");
pinMode(PIRSensor, INPUT); digitalWrite(13,HIGH);
Serial.begin(9600); }
pinMode(13,OUTPUT);
} else
{
void loop() Serial.println("Motion not detected");
{ digitalWrite(13,LOW);
PIRSensorState =
digitalRead(PIRSensor); }
Serial.print("PIR Sensor Output = ");
Serial.println(PIRSensorState); }
delay(1000);
Circuit Connections: Objective 6(c)

14
Self Assessment Questions

1. What is the Principle of PIR sensor?

2. List out the pin in PIN Sensor module?

3. What is the range of PIR sensor?

4. Is that PIR Sensor is Analog Sensor or Digital Sensor?

15
THANK YOU

Team – Fundamentals of IoT & Sensors

You might also like