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.

PCB Design

After designing the schematic diagram of the PIR sensor-based security alarm system, I realised that the assembled components and wiring are too clumsy and unprofessional. In fact, the wiring also has a chance of loose connection. To give it a clean and professional look I decided to build its PCB prototype using EasyEDA software as it is so simple to use. Now come to the main part, where we need to order our PCB prototype. I always prefer PCBWay for their quality assurance, fastest delivery and also for 24/7 customer support.

Gerber file for PIR Sensor Based Security Alarm System Gerber.

You can view the Gerber file here Gerber File Viewer.

PIR Sensor Based Security Alarm System 2D View
2D View
PIR Sensor Based Security Alarm System 3D View
3D View

Why I Choose PCBWay as My First Preference?

I’ve done several runs with PCBWay and am happy with the results, it’s good quality. The etching, solder mask, and hole sizes are all done well and that is what matters to me. It takes a few hours for a design to get approved and then a couple of days to finish and ship.

With more than a decade in the field of PCB prototypes and fabrication, PCBWay has proved its assurance from time to time. They always look at the needs of the customer from different regions in terms of quality, on-time delivery, cost-effectiveness and any other demanding requests. PCBWay is a place that brings manufacturers and customers together. As one of the largest and most experienced PCB manufacturers in China, PCBWay is proud to be the best business partner in any aspect of PCB needs.

Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.

Aspects of PCBWay

High Delivery Rate

In previous years, the on-time delivery rate was 99%. Rather than PCB quality, PCBWay knows that the other most important factor is the shortest possible lead time, which is critical for R&D engineers, especially in the phase of prototyping. PCBWay keeps working to ensure PCBs will be delivered to customers as soon as possible and they’re delighted. It takes only 3 to 15 days according to the courier service to deliver your products. After PCBWay moved to the new factory, the production capacity of multi-layer PCB can be as high as tens of thousands of square meters per month. So on-time delay is also reduced for that. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.

Quality Assurance

When talking about quality assurance, all the PCB prototypes go through the most stringent tests rather than the basic visual checks. They have most of the testing and inspecting types of equipment used in the PCB prototyping industry, such as Flying Probe Tester, X-Ray Inspection Machine, and Automated Optical Inspection (AOI) Machine.

PCB Prototyping & Manufacturing

PCBWay New solder mask

PCBWay can also make advanced PCBs which are high-quality PCBs and they are recommended for industrial types of equipment, instrumentation, automotive electronics, communication types of equipment, etc. They produce FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, and Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.

PCBWay different types of solder masks

Previously there have 9 different types of solder masks available in their company. But now recently they have launched extra 4 solder masks that are pink, grey, orange and transparent solder masks.

PCBWay new solder masks 1

Also, there is a piece of great news about the price reduction of PCB prototypes. From 5th August you can now buy 4-layers & 6-layers with upto 20% discounts. As the price dropped, don’t think they will compromise on the quality. Check out the link “4-layer & 6-layer PCBs” where you can find more about it.

PCB Assembly

It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your BOM file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.

There are three types of assembly services:

  • Turnkey where PCBWay supplies all PCB parts.
  • Kitted or Consigned where the customer is responsible for buying and sending all parts to PCBWay.
  • Combo, where the customer supplies some parts and PCBWay, completes the rest.

3D Printing & CNC

It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.

Guide for Ordering PCB from

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 the range of 5 meters.

Arduino Code

1 thought on “PIR Sensor Based Security Alarm System”

Leave a Comment