PIR Sensor Based Security Alarm System

Previously I have built some security alert systems using different methods. Now I will gonna design and implement a PIR Sensor Based Security Alarm System using Arduino. I have designed this circuit using Arduino as the central microcontroller and of course the PIR sensor itself. For generating a police siren effect, I have used a UM3561 IC, which is a siren generator IC, to produce the alarm sound through a buzzer.

Generally, security systems that are specially used in houses, shops, and offices, are basically infrared or laser systems for accuracy and reliability. But these methods require a lot of monetary investment and infrastructure support.

A simple cost-effective solution for a security alarm system is implemented in this small project where I will elaborate on a PIR based security alarm system. This method requires minimal power consumption as well as a low-cost implementation.

Must Read Infrared Sensor Based Intruder Alarm System

Principle Behind PIR Sensor Based Security Alarm System

The main principle of the circuit is to turn the alarm on and provide security. This is based on a PIR sensor with an IC that produces different siren alarms. PIR sensor stands for Passive Infrared Sensor. The PIR sensor detects the infrared radiations emitted from the human body and produces a digital output through its digital output pin. This digital output is sent to the Arduino for the next process.

Based on the digital signal from the PIR sensor, Arduino then triggers the UM3561 IC through the 2N2222 NPN transistor. Thus it produces the sound when any human is detected.

The UM3561 is a ROM IC. It generates multi-siren tones like an ambulance siren, fire engine siren, police siren and machine gun sound.


PIR Sensor Based Security Alarm System

Circuit Diagram

PIR Sensor Based Security Alarm System Circuit Diagram

Components Required

  • Arduino Nano
  • PIR Motion Sensor
  • UM3561 Multi-Siren IC
  • 2N2222 NPN Transistor (x2)
  • Resistors (10KΩ & 220KΩ)
  • 8Ω Speaker
  • Breadboard
  • Connecting Wires

Circuit Connection of PIR Sensor Based Security Alarm System

The designed circuit consists of Arduino, PIR sensor, UM3561 tone generator IC, buzzer, transistor and a couple of resistors. The UM3516 IC is a tone generator IC. It has 8 pins. Pin 1 and pin 6 are the sound effect selection pins. Based on how they are connected, you can choose between 4 different types of sounds.

For our purpose, I opened both pin 1 and pin 6 to generate a police siren effect. Pin 5 is connected to +5V through a 2N2222 NPN transistor which is also activated by Arduino digital pin 4.

One end of the 220KΩ resistor is connected to the 7th pin of the UM3561 IC and the other end is connected to the 8th pin of the IC. Output is taken from the 3rd pin of the IC and it is connected to a buzzer through a resistor and a transistor.

The base of the transistor is connected to the output of the IC through a 10KΩ resistor. The emitter pin is connected to the ground while the negative end of the buzzer is connected to the collector, while the positive end is connected to the +5V.

Coming to the PIR Sensor, its output is connected to pin 3 of the Arduino.

Working Principle of PIR Sensor Based Security Alarm System

The PIR sensor is powered and it detects the IR rays emitted from the human body. This PIR sensor has a maximum range of around 5 meters. You can adjust the potentiometer provided for the sensor to vary your desired distance. When any human is detected, the PIR sensor outputs a logic HIGH-level value i.e., a voltage of 3.5V to 5V to Arduino digital pin 3.

As soon as the Arduino detects logic HIGH on pin 3, it makes pin 4 HIGH for a duration of 10 seconds. During this time, the IC UM3561 is activated as its pin 5 is provided with +5V. The tone generator has an inbuilt oscillator to produce sound. The oscillator circuit is tuned to a certain frequency and also uses a 220KΩ resistor externally.

Then it is passed to the control circuit, which depends on the tone selection pins. These tone selection pins decide one tone from different tones produced by the IC. Thus oscillations along with selected tones are sent to the address counter.

The address counter then sends the data to the ROM. ROM then sends the tone on the output pin 3. The output is given to the NPN transistor to amplify the siren.

The base of the transistor gets voltage from the output pin of the siren generator. The transistor starts conducting when it gets the cut-off voltage at the base and the buzzer is a negative pin and is connected to the ground.

Thus the system produces the sound that can be heard from the buzzer when a human is detected. In the present circuit, we set this IC for a police siren sound.

Applications of PIR Sensor Based Security Alarm System

  • In museums, we can use this system to protect valuable things.
  • It can also be used as an automatic doorbell system which will activate when a human is detected.
  • This can be used in toy applications that produce sound.

Limitations of PIR Sensor Based Security Alarm System

  • PIR sensor pot should be adjusted in such a way as to detect humans only.
  • This system can detect humans only within a range of 5 meters.

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));  }  }

Post a Comment

Previous Post Next Post