Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Intruder Detection with Arduino

Importance and Utility of Intruder Detection

Intruder detection is a crucial aspect of security systems, whether it be for residential, commercial, or industrial purposes. By implementing an intruder detection system, we can ensure the safety and protection of our properties and assets. Arduino, with its versatility and ease of use, provides an excellent platform for developing such systems.

Project: Intruder Detection System

The objective of this project is to create a simple yet effective intruder detection system using Arduino. The system will utilize a passive infrared (PIR) motion sensor to detect any movement within its range. Upon detecting an intruder, the system will trigger an alarm or send a notification to the user.

Functionalities of the Intruder Detection System:

  1. Detects motion using a PIR motion sensor.
  2. Activates an alarm or sends a notification when an intruder is detected.
  3. Can be easily integrated with other security systems.

List of Components:

  1. Arduino Uno - 1x (https://www.arduino.cc/en/Main/ArduinoBoardUno)
  2. Passive Infrared (PIR) Motion Sensor - 1x (https://www.sparkfun.com/products/13285)
  3. Buzzer - 1x (https://www.sparkfun.com/products/7950)
  4. LED - 1x (https://www.sparkfun.com/products/10632)
  5. Jumper Wires - As required
  6. Breadboard - 1x (https://www.sparkfun.com/products/12615)

Examples:

Example 1: Basic Intruder Detection System

// Intruder Detection System

int pirPin = 2;     // PIR motion sensor connected to digital pin 2
int buzzerPin = 3;  // Buzzer connected to digital pin 3
int ledPin = 4;     // LED connected to digital pin 4

void setup() {
  pinMode(pirPin, INPUT);    // Set PIR pin as input
  pinMode(buzzerPin, OUTPUT);  // Set buzzer pin as output
  pinMode(ledPin, OUTPUT);    // Set LED pin as output
}

void loop() {
  int pirState = digitalRead(pirPin);  // Read PIR sensor state

  if (pirState == HIGH) {  // If motion is detected
    digitalWrite(buzzerPin, HIGH);  // Turn on the buzzer
    digitalWrite(ledPin, HIGH);  // Turn on the LED
    delay(5000);  // Alarm duration
    digitalWrite(buzzerPin, LOW);  // Turn off the buzzer
    digitalWrite(ledPin, LOW);  // Turn off the LED
  }
}

In this example, we have a basic intruder detection system. The PIR motion sensor is connected to digital pin 2 of the Arduino. When motion is detected, the buzzer and LED are turned on for 5 seconds to indicate the presence of an intruder.

Example 2: Sending Notification

To send a notification when an intruder is detected, we can integrate the Arduino with a GSM module or a Wi-Fi module. Here's an example using a GSM module:

// Intruder Detection System with Notification

#include <SoftwareSerial.h>

int pirPin = 2;     // PIR motion sensor connected to digital pin 2
int buzzerPin = 3;  // Buzzer connected to digital pin 3
int ledPin = 4;     // LED connected to digital pin 4

SoftwareSerial gsmSerial(10, 11);  // RX, TX pins of GSM module

void setup() {
  pinMode(pirPin, INPUT);    // Set PIR pin as input
  pinMode(buzzerPin, OUTPUT);  // Set buzzer pin as output
  pinMode(ledPin, OUTPUT);    // Set LED pin as output

  // Initialize GSM module
  gsmSerial.begin(9600);
  gsmSerial.println("AT+CMGF=1");  // Set GSM module to text mode
}

void loop() {
  int pirState = digitalRead(pirPin);  // Read PIR sensor state

  if (pirState == HIGH) {  // If motion is detected
    digitalWrite(buzzerPin, HIGH);  // Turn on the buzzer
    digitalWrite(ledPin, HIGH);  // Turn on the LED

    // Send notification
    gsmSerial.println("AT+CMGS=\"+1234567890\"");  // Replace with recipient's phone number
    delay(1000);
    gsmSerial.println("Intruder detected!");  // Message content
    gsmSerial.write(0x1A);  // Send Ctrl+Z to indicate end of message
    delay(5000);  // Alarm duration

    digitalWrite(buzzerPin, LOW);  // Turn off the buzzer
    digitalWrite(ledPin, LOW);  // Turn off the LED
  }
}

In this example, we have added a GSM module to send a notification when an intruder is detected. The GSM module is connected to the Arduino's RX and TX pins (digital pins 10 and 11). The system sends an SMS message to a specified phone number when motion is detected.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.