Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

IoT Fundamentals

Lab Assessment – 5
Name : S.Neeraj Kumar Mnaikanta
Reg No : 18BSW0076
Course Code : ECE3501
Slot : L37+L38
Faculty : Prof KARTHIKEYAN B

EXPERIMENT -5
Security Alarm System using PIR Sensor
Aim:
To design the security alarm system by interfacing Passive Infrared (PIR)
Sensor and buzzer with Arduino.
Components Required :
1.Arduino UNO R3
2.LCD 16 x 2
3.250 kohm potentiometer
4.220 ohm resistor
5.PIR sensor
6.Piezo
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.
They are most often used in PIR-based motion detectors. PIR sensors
are commonly used in security alarms and automatic lighting
applications. PIR sensors detect general movement but do not give
information on who or what moved. Operating
Principle:
All objects with a temperature above absolute zero emit heat energy in
the form of radiation. Usually, this radiation isn't visible to the human
eye because it radiates at infrared wavelengths, but it can be detected
by electronic devices designed for such a purpose
Procedure:
1) Sign in to tinkercad.com
2) Create a new project, to create a new circuit.
3) Select the required components and place them in the circuit
window.
4) Make a connection to all components as per the circuit diagram
given below.
5) Click the Code menu to select the code type as Text.
6) In Code window write your code to perform given task.
7) Press start simulation and view the output.
8) Press serial monitor in a code window to view the continuous output
CIRCUIT CONNECTION:

CODE :
//Name : S.Neeraj Kumar
//Reg No : 18BSW0076
#include <LiquidCrystal.h>
#define PIR_In 9
#define buzzer_Out 8
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
pinMode(buzzer_Out, OUTPUT);
pinMode(PIR_In, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
lcd.setCursor(0,0);
lcd.print("Completely fine");
check_For_Intruder();
}
void check_For_Intruder()
{
boolean sensorvalue = digitalRead(PIR_In);
if(sensorvalue==1)
{
digitalWrite(buzzer_Out,HIGH);
lcd.setCursor(0,0);
lcd.print("Intruder in the ");
lcd.setCursor(0,1);
lcd.print("House :( ");
delay(3000);
lcd.clear();
}else{
digitalWrite(buzzer_Out,LOW);
}
delay(10);
}
EXPLANATION :
When PIR sensor goes high ,it means there is an intruder,buzzer will go
high and LCD will display message “Intruder in the house :( “
When there are no intruders,PIR senor will be low and LCD will display
“Completely fine “
OUTPUT :

Since there are no intruders ,Buzzer will not alarm and LCD shows
“Completely fine “

Result:
Thus the Security Alarm System was designed and the desired
output was verified using the tinkercad simulation tool.
Link for experiment in TinkerCard :
https://www.tinkercad.com/things/1NPDgLfrzY1-security-alarm-
system-

You might also like