Skip to main content

How to Build a Motion Detection Alarm System with Arduino and PIR Sensor


How to Build a Motion Detection Alarm System with Arduino and PIR Sensor



Introduction:

A PIR Sensor-based Security Alarm is a simple and cost-effective way to protect your home or workspace from potential intruders. It is a DIY project that is popular among Arduino enthusiasts and hobbyists. In this blog, we will explain how to create a PIR Sensor-based Security Alarm using an Arduino, an LCD 16x2 display, and a buzzer.


Components:

The components required for this project are as follows:

  • Arduino Uno 
  • BoardPIR SensorLCD 16x2 Display
  • BuzzerJumper Wires
  • Breadboard
  • 10k Ohm Potentiometer



Working:

The PIR Sensor detects the motion of the intruder and sends a signal to the Arduino. The Arduino processes the signal and activates the buzzer and the LED light. It also displays a message on the LCD display indicating the intrusion.


Construction:

The construction of this project involves connecting the PIR Sensor, buzzer, and LCD display to the Arduino board using jumper wires. The PIR sensor is connected to the Arduino's digital input pin, while the buzzer is connected to the digital output pin. The LCD display is connected to the Arduino's digital input and output pins.


Circuit Diagram : 







Code: 

// include the library code for LCD

#include <LiquidCrystal.h>


// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


// initialize the PIR sensor input and the buzzer output pins

int pirSensor = 6;

int buzzer = 7;


void setup() {

  // set the LCD display to 16x2 mode

  lcd.begin(16, 2);


  // set the PIR sensor input pin as input and the buzzer output pin as output

  pinMode(pirSensor, INPUT);

  pinMode(buzzer, OUTPUT);


  // print a welcome message on the LCD display

  lcd.print("PIR Sensor Alarm");

  lcd.setCursor(0, 1);

  lcd.print("System Ready");

}


void loop() {

  // read the PIR sensor input

  int pirState = digitalRead(pirSensor);


  // if the PIR sensor is triggered, activate the buzzer and display a message on the LCD display

  if (pirState == HIGH) {

    digitalWrite(buzzer, HIGH);

    lcd.clear();

    lcd.print("Intrusion Alert!");

    lcd.setCursor(0, 1);

    lcd.print("Motion Detected");

    delay(1000);

  }

  // if the PIR sensor is not triggered, turn off the buzzer and display a message on the LCD display

  else {

    digitalWrite(buzzer, LOW);

    lcd.clear();

    lcd.print("PIR Sensor Alarm");

    lcd.setCursor(0, 1);

    lcd.print("System Ready");

    delay(1000);

  }

}



Advantages:

The PIR Sensor-based Security Alarm is an effective way to protect your home or workspace from intruders. It is easy to build and requires only a few components. The project can be customized to suit your specific needs, and it can be programmed to perform different actions based on the type of intrusion detected.


Conclusion:

In conclusion, the PIR Sensor-based Security Alarm is a cost-effective way to secure your home or workspace. With the help of an Arduino, an LCD display, and a buzzer, you can create an effective security system that can detect intruders and alert you in real-time. This DIY project is an excellent way to learn more about electronics and programming.

Comments

Popular posts from this blog

Weather Station Using Arduino & DHT11

Weather Station Using Arduino & DHT11      Introduction: Weather monitoring is an important task in many industries and applications. In this project, we are going to build a weather monitoring station using Arduino Nano, DHT11 sensor, 16x2 LCD display, and I2C module. The DHT11 sensor will be used to measure temperature and humidity, and the results will be displayed on the 16x2 LCD display with the help of the I2C module. Hardware Required:

Understanding the Basics of Resistors: A Beginner's Guide

  Understanding the Basics of Resistors: A Beginner's Guide Introduction: Resistors are one of the most basic and fundamental components used in electronic circuits. They play a vital role in controlling the flow of current in a circuit and have a wide range of applications in everything from simple LED circuits to complex electronic systems. In this blog post, we will dive into the world of resistors, exploring what they are, how they work, and the different types of resistors that are available. What is a Resistor? A resistor is an electrical component that is used to regulate the flow of electrical current in a circuit. It is designed to have a specific resistance value, which is measured in ohms (Ω). The resistance value of a resistor determines how much current can flow through it, with higher resistance values limiting the current flow, and lower resistance values allowing more current to flow. Resistors are passive components, which means that they do not generate or amplify

Revolutionizing Home Automation: Empowering Smart Living through Seamless Control and Advanced Monitoring

Revolutionizing Home Automation: Empowering Smart Living through Seamless Control and Advanced Monitoring Introduction : Welcome to the forefront of modern living, where our innovative home automation project is reshaping the way we interact with our homes. Our mission is to bring convenience, efficiency, and security to homeowners through a comprehensive system that leverages the power of cutting-edge technology. By integrating internet networking, sensor data, and cloud-based storage, our project ensures real-time updates and effortless user control. With a focus on simplicity and accessibility, our solution is designed for all, regardless of technical expertise. Join us on this journey as we explore the extensive capabilities of our home automation project. Project Overview: At the heart of our home automation project lies the vision of creating a smart ecosystem that seamlessly connects various aspects of the home. By interlinking appliances, sensors, and user devices through inter