PIR Sensor based Security Alarm System
I’ll teach you how to build and install a PIR Sensor-based Security Alarm System in this easy DIY project. This circuit was created with Arduino as the main controller and, of course, the PIR Sensor. In addition, I used the UM3561 IC, a Siren Generator IC, to generate the required Alarm sound using a Speaker.
- Introduction
- PIR Sensor based Security Alarm Circuit Principle
- PIR Sensor based Security Alarm Circuit Diagram
- Circuit Components
- PIR Sensor based Security Alarm Circuit Design
- Code
- Working of PIR Sensor based Security Alarm System
- PIR Sensor Based Security Alarm System Applications
- Limitations of this Circuit
Introduction
In general, infrared or laser transmitters and receivers are utilised in security systems used in homes, stores, workplaces, and other locations for precision and reliability. However, these solutions necessitate a significant financial investment as well as infrastructure support.
This project implements a simple, cost-effective solution for security systems, in which I will describe a PIR-based Security Alarm System, in which a PIR sensor is utilised instead of a transmitter or receiver. This reduces power consumption while also being a low-cost solution. The acronym PIR stands for Passive Infrared Sensor.
PIR Sensor based Security Alarm Circuit Principle
The circuit’s principal goal is to provide security. This is based on a PIR sensor with a siren-producing IC. The PIR sensor detects IR radiation emitted by people and generates a digital output. The Arduino UNO receives this digital output.
The Arduino UNO then triggers the UM 3561 siren IC based on the data signal from the PIR Sensor. When a human is detected, the sound is produced.
The UM3561 is a ROM integrated circuit. It produces a variety of siren sounds, including ambulance, fire engine, police, and machine gun sirens.
PIR Sensor based Security Alarm Circuit Diagram
Circuit Components
- PIR sensor
- Arduino UNO
- UM3561 Siren IC
- NPN Transistor – 2N2222
- Resistors 10KΩ and 220KΩ
- Speaker 8Ω
- Breadboard
- Connecting Wires
PIR Sensor based Security Alarm Circuit Design
The Arduino UNO, PIR sensor, UM3561 IC, Speaker, transistor, and a few resistors make up the designed system. A Siren generator IC is the UM3516. It has a total of eight pins. Sound effect selection pins are located on the first and sixth pins. You can choose from four different types of noises depending on how they’re connected.
To make a Police Siren, I left both Pin 1 and Pin 6 open in my project. An NPN Transistor (which is operated by Arduino UNO’s Pin 4) connects Pin 5 to +5V.
One end of the 220K resistor is linked to the UM 3561 IC’s seventh pin, while the other end is attached to the IC’s eighth pin. The third pin of the IC is used as the output, which is connected to a speaker through a resistor and transistor.
Through a 10K resistor, the transistor’s base is connected to the IC’s output. The emitter pin is linked to ground, with one end of the speaker connected to the collector and the other end to +5V.
The output of the PIR Sensor is linked to Pin 3 of the Arduino.
Code
int pir = 3; | |
int siren =4; | |
void setup() | |
{ | |
pinMode(pir,INPUT); | |
pinMode(siren,OUTPUT); | |
digitalWrite(siren,LOW); | |
delay(8000); | |
} | |
void loop() | |
{ | |
if(digitalRead(pir)) | |
{ | |
digitalWrite(siren,HIGH); | |
delay(10000); | |
digitalWrite(siren,LOW); | |
while(digitalRead(pir)); | |
} | |
} |
Working of PIR Sensor based Security Alarm System
- Connect the wires as shown in the circuit diagram and turn the power on.
- The PIR sensor is turned on and detects infrared rays emitted by humans.
- The range of this PIR sensor is 5 metres. This distance can be varied by adjusting the pot provided for the sensor.
- When a human is identified, the PIR sensor outputs a logic HIGH value to ARduino UNO’s Pin 3, i.e. a voltage of 3.5V to 5V.
- When the Arduino detects logic HIGH on Pin 3, it sets Pin 4 to HIGH for ten seconds. During this moment, the Siren IC UM3561 is turned on by providing +5V to Pin 5.
- Internally, the siren generator has an oscillator that produces the sound.
- A 220K resistor is used externally to adjust the oscillator circuit to a specific frequency.
- After that, it’s sent to the control circuit, which is controlled by tone selection pins.
- These tone selection pins select one tone from the IC’s several tones.
- As a result, oscillations and a chosen tone are communicated to the address counter. The data is subsequently sent to the ROM by the address counter.
- The tone is then sent to the output pin 3 via the ROM.
- The output of the NPN transistor is used to magnify the siren.
- The transistor’s base receives voltage from the siren generator’s output pin.
- When the transistor receives the cutoff voltage at the base, it begins to conduct, and the speaker is linked to the ground through the negative pin.
- When a human is recognised, the sound emitted by the speaker can be heard.
- It makes a Police Siren sound in the current circuit.
PIR Sensor Based Security Alarm System Applications
- This can be used to secure important items in museums.
- This can also be utilised as a doorbell circuit that automatically sounds the bell when a human is identified.
- This could be utilised in defence applications to detect humans in the field of battle.
- This can be utilised in sound-producing toy applications.
Limitations of this Circuit
- PIR sensor pot should be adjusted in such a way to detect the humans only.
- This can detect the human only within its range of 5 meters.