Projects Hub, lesson 13 of 81

Building an Intruder Detection System with LCD and Alarm using Arduino

intermediate2 min read

Introduction

Security is a paramount concern for many homeowners and businesses. Intruder detection systems play a crucial role in safeguarding properties by alerting occupants when unauthorized access is detected. In this article, we will guide you through the process of creating a simple yet effective intruder detection system using an Arduino, LCD display, and alarm.

Working Principle

The intruder detection system we are building relies on the Arduino to monitor a specific area for intrusions. It employs a passive infrared (PIR) motion sensor to detect movement within its range. When an intruder is detected, the Arduino triggers both an audible alarm and displays a notification on an LCD screen.

Things We Need

  1. Arduino board (e.g., Arduino Uno)
  2. PIR motion sensor
  3. 16x2 LCD display
  4. Passive buzzer or piezo buzzer
  5. Breadboard and jumper wires
  6. 10k ohm potentiometer
  7. 220-ohm resistor

Circuit Diagram

Place a photo here...

Working of the System with Arduino

  1. Connections: Connect the PIR sensor to the Arduino as follows:
    • VCC to 5V
    • GND to GND
    • OUT to a digital pin (e.g., D2)Connect the LCD display as follows:
    • VCC to 5V
    • GND to GND
    • SDA to A4
    • SCL to A5Connect the buzzer to a digital pin (e.g., D3).
  2. Ardu no Code : Here's a simplified Arduino code for this project
Loading the circuit…Arduino Uno
Press Run to upload the code to the Arduino.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(0x27, 16, 2);
int pirPin = 2;
int buzzerPin = 3;
int pirState = LOW;
int val = 0;
 
void setup() {
  lcd.init();                      // Initialize the LCD
  lcd.backlight();                 // Turn on backlight
  pinMode(pirPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
  lcd.print("Intruder Alert!");
  delay(2000);
  lcd.clear();
}
 
void loop() {
  val = digitalRead(pirPin);
  if (val == HIGH) {
    lcd.clear();
    lcd.print("Intruder Detected!");
    digitalWrite(buzzerPin, HIGH);
    delay(1000);
    digitalWrite(buzzerPin, LOW);
    delay(1000);
  } else {
    lcd.clear();
    lcd.print("System Armed");
    digitalWrite(buzzerPin, LOW);
  }
}

Conclusion

Intruder detection systems are essential for enhancing security, and creating one using an Arduino, LCD display, and buzzer is both educational and practical. By following this guide, you can build a basic yet functional intruder detection system that serves as a starting point for more advanced security projects. With further customization and enhancements, you can adapt this system to suit specific security needs and help protect your property effectively.