Development of an IoT-Based Security Alarm System

Motion-Activated Security with ESP32, PIR Sensor, Blynk IoT Remote Arm/Disarm Control, and Push Notification Alerts

Category: IoT, Embedded Systems, Security, Home Automation
Tools & Technologies: ESP32, PIR Motion Sensor, Buzzer, LED Indicator, Blynk IoT Platform, WiFi, Arduino IDE

Status: Completed

Introduction

This project implements an IoT-based security alarm system using an ESP32 microcontroller with PIR motion detection and Blynk IoT cloud integration. The system provides remote arm/disarm functionality through a Blynk dashboard toggle (V0), allowing users to enable or disable motion detection from anywhere via their smartphone. When armed and motion is detected, the system activates a pulsating buzzer alarm pattern and illuminates an alert LED while sending push notifications ("Attention!!! Motion Detected.") to the user's Blynk mobile app. The system includes a dedicated WiFi status LED that indicates connectivity, and operates with an offline fallback mode when WiFi is unavailable — maintaining alarm functionality even without internet connectivity. A 10-second WiFi connection timeout ensures the system remains responsive.

System Overview System Overview


Aim and Objectives

Aim:
Develop an IoT-based security alarm system with remote control, PIR motion detection, and push notification alerts via Blynk IoT platform.

Objectives:

  • Detect motion intrusion using PIR passive infrared sensor.
  • Provide remote arm/disarm control through Blynk IoT dashboard toggle switch.
  • Send push notification alerts to user's mobile device on motion detection.
  • Activate pulsating buzzer alarm and LED indicator upon intrusion detection.
  • Indicate WiFi connectivity status with a dedicated LED indicator.
  • Maintain alarm functionality in offline mode when WiFi is unavailable.

Features & Deliverables

  • PIR Motion Detection: Passive infrared sensor detects human/animal movement within detection range.
  • Remote Arm/Disarm: Blynk V0 toggle widget enables/disables alarm system from anywhere via smartphone.
  • Push Notifications: Instant mobile alerts with "Attention!!! Motion Detected." message via Blynk event system.
  • Pulsating Alarm: Buzzer produces distinctive pulsating tone pattern for attention-grabbing intrusion alert.
  • LED Indicators: Separate LEDs for alarm activation status and WiFi connectivity status.
  • Offline Fallback: System remains operational as standalone alarm when WiFi connection is lost.
  • Quick Startup: 10-second WiFi timeout ensures system enters operational mode rapidly.

Process / Methodology

Hardware Assembly

Components: ESP32, PIR Motion Sensor, Active Buzzer, Alert LED, WiFi Status LED.

  • Connected PIR sensor to ESP32 digital input for motion detection.
  • Wired buzzer and alert LED to output pins for alarm indication.
  • Added separate WiFi status LED for connectivity feedback.
  • Assembled compact enclosure suitable for wall mounting at entry points.

Software Development

  • Developed Blynk-connected firmware with V0 virtual pin for remote arm/disarm toggle.
  • Implemented PIR reading with armed state check before triggering alarm sequence.
  • Programmed pulsating buzzer pattern with alternating on/off high-frequency tones.
  • Configured Blynk event logging and push notification on motion detection events.
  • Added WiFi connection management with 10-second timeout and offline fallback.

Testing & Calibration

  • Tested PIR detection range and sensitivity in various environments.
  • Verified Blynk push notification delivery latency and reliability.
  • Validated arm/disarm toggle state synchronization between device and dashboard.

Challenges & Solutions

  • Challenge: PIR sensor false triggers from temperature changes and air currents.
    Solution: Adjusted PIR sensitivity potentiometer and added debounce delay between detection events.
  • Challenge: System unresponsive during WiFi reconnection attempts.
    Solution: Implemented 10-second connection timeout with automatic fallback to offline alarm mode.
  • Challenge: Blynk state desynchronization after WiFi reconnection.
    Solution: Used Blynk.syncVirtual(V0) on connection restore to synchronize arm/disarm state from cloud.

Results & Impact

  • Reliable Detection: PIR sensor provided consistent motion detection within operational range.
  • Remote Control: Blynk toggle enabled convenient arm/disarm from any location via smartphone.
  • Instant Alerts: Push notifications delivered within seconds of motion detection events.
  • Robust Operation: Offline fallback ensured continuous protection regardless of WiFi availability.

Future Enhancements

  • Add camera module for visual capture and event-triggered image recording.
  • Implement multiple PIR zones for area-specific detection and reporting.
  • Add door/window magnetic reed switches for comprehensive perimeter security.
  • Integrate with home automation systems for coordinated response actions.

Demonstration / Access

  • GitHub Repository: Coming soon
  • Live Demonstration Video: Coming soon

Thank You for Visiting My Portfolio

I sincerely appreciate you taking the time to explore my portfolio and learn about my work and expertise. If you have any questions or wish to discuss potential collaborations, please feel free to reach out via the Contact section.

Best regards,
Damilare Lekan, Adekeye.