0% found this document useful (0 votes)
8 views6 pages

Experiments On IOT

The document details connecting a PIR motion sensor to a Raspberry Pi board to detect motion and control an LED. It provides information on PIR sensors and their operation, the connection details between the sensor and Raspberry Pi, and a Python program to read the sensor input and control an LED based on detected motion.

Uploaded by

adhwithkrishna9
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)
8 views6 pages

Experiments On IOT

The document details connecting a PIR motion sensor to a Raspberry Pi board to detect motion and control an LED. It provides information on PIR sensors and their operation, the connection details between the sensor and Raspberry Pi, and a Python program to read the sensor input and control an LED based on detected motion.

Uploaded by

adhwithkrishna9
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/ 6

Date: Experiment 6

Aim: To interface the passive infrared (PIR) Sensor to the Raspberry Pi board.

Material Required:

1. Raspberry Pi (any model)


2. PIR sensor Module
3. Connecting wires

PIR Sensor Module:

• PIR sensor is used for detecting infrared heat radiations. This makes them useful in
the detection of moving living objects that emit infrared heat radiations.
• The output (in terms of voltage) of the PIR sensor is high when it senses motion;
whereas it is low when there is no motion (stationary object or no object).
• PIR sensors are used in many applications like room light control using human
detection, human motion detection for security purposes at home, etc.

Connection details of PIR sensor with Raspberry pi board:


Python Program:

import RPi.GPIO as GPIO

import time

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor

GPIO.setup(3, GPIO.OUT) #LED output pin

while True:
i=GPIO.input(11)

if i==0: #When output from motion sensor is LOW

print "No intruders",i

GPIO.output(3, 0) #Turn OFF LED

time.sleep(0.1)

elif i==1: #When output from motion sensor is HIGH

print "Intruder detected",i

GPIO.output(3, 1) #Turn ON LED

time.sleep(0.1)

OUTPUT:
Result

For Faculty Use Only


Performance Marks (Out of 10)
Report Grade
Faculty Signature with date

You might also like