Comprehensive Home Security System with Camera Surveillance and Multi-Sensor Detection

Dual-MCU Security System with ESP32-CAM Live Streaming, Arduino Nano Multi-Sensor Detection, GSM SMS Alerts, and Telegram Bot Notifications

Category: IoT, Embedded Systems, Home Security, Surveillance, Camera
Tools & Technologies: ESP32-CAM (AI Thinker with PSRAM), Arduino Nano, PIR Motion Sensor, MQ135 Gas Sensor, Flame Detector, Vibration Sensor, SIM800L GSM Module, Telegram Bot API, UART Serial Communication, Camera Web Server (UXGA JPEG), Arduino IDE

Status: Completed

Introduction

This project implements a comprehensive home security system combining camera surveillance with multi-sensor threat detection. The system uses a dual-microcontroller architecture: an ESP32-CAM provides live video streaming via a web server, while an Arduino Nano handles multi-sensor data acquisition from PIR motion, MQ135 gas, flame, and vibration sensors. The two MCUs communicate via UART serial connection, enabling the sensor node to trigger camera captures and alerts. When threats are detected—motion intrusion, gas leaks, fire, or structural vibrations—the system sends SMS alerts via SIM800L GSM and instant notifications with images via Telegram Bot API. The camera web server supports UXGA resolution JPEG streaming accessible from any browser on the local network.

System Overview System Overview


Aim and Objectives

Aim:
Design and develop an integrated home security system combining ESP32-CAM video surveillance with Arduino Nano multi-sensor threat detection and multi-channel alert notification.

Objectives:

  • Implement live camera surveillance using ESP32-CAM with web server streaming (UXGA JPEG).
  • Detect multiple threat types: motion intrusion (PIR), gas leaks (MQ135), fire (flame sensor), and structural disturbance (vibration sensor).
  • Establish reliable UART communication between Arduino Nano sensor node and ESP32-CAM camera node.
  • Send instant SMS alerts via SIM800L GSM module for critical security events.
  • Deliver Telegram Bot notifications with camera images for visual threat verification.
  • Design a modular dual-MCU architecture for scalable sensor expansion.

Features & Deliverables

  • Live Camera Streaming: ESP32-CAM web server provides UXGA resolution JPEG streaming accessible via browser.
  • Motion Detection: PIR sensor detects human presence and triggers camera capture and alerts.
  • Gas Leak Detection: MQ135 sensor monitors air quality and detects hazardous gas concentrations.
  • Fire Detection: Dedicated flame sensor identifies fire/combustion events for early warning.
  • Vibration Detection: Vibration sensor detects structural disturbances (break-in attempts, earthquakes).
  • Dual-MCU Architecture: Arduino Nano handles sensors while ESP32-CAM manages camera and connectivity.
  • UART Communication: Serial link between MCUs enables coordinated sensor-camera response.
  • GSM SMS Alerts: SIM800L sends SMS to emergency contacts for critical security events.
  • Telegram Notifications: Bot API delivers instant alerts with captured images for remote verification.

Process / Methodology

Hardware Assembly

Components: ESP32-CAM (AI Thinker), Arduino Nano, PIR Sensor, MQ135, Flame Sensor, Vibration Sensor, SIM800L GSM, Power Supply.

  • Configured ESP32-CAM with PSRAM for high-resolution image capture and web server streaming.
  • Connected four sensor types to Arduino Nano analog/digital inputs for multi-threat detection.
  • Established UART serial communication between Arduino Nano TX/RX and ESP32-CAM.
  • Integrated SIM800L GSM module for SMS alert capability.

Software Development

  • Developed ESP32-CAM firmware with camera web server, Telegram Bot integration, and UART listener.
  • Programmed Arduino Nano firmware for multi-sensor polling with threshold-based alert triggering.
  • Implemented UART protocol for structured sensor data and command exchange between MCUs.
  • Created Telegram Bot handler for image capture and delivery on alert events.

Testing & Calibration

  • Calibrated MQ135 gas sensor thresholds for accurate hazardous gas detection.
  • Tested PIR sensor detection range and false positive rates in home environment.
  • Validated flame sensor response distance and sensitivity.
  • Verified UART communication reliability between MCUs at various baud rates.

Challenges & Solutions

  • Challenge: ESP32-CAM limited GPIO pins while needing camera, WiFi, and UART simultaneously.
    Solution: Offloaded all sensor processing to Arduino Nano, using ESP32-CAM exclusively for camera and communication.
  • Challenge: Camera image capture during streaming caused momentary freezes.
    Solution: Implemented capture-on-demand approach triggered by Nano alert signals rather than continuous capture.
  • Challenge: False alarm triggering from environmental noise (wind, cooking smoke).
    Solution: Implemented multi-sensor correlation—requiring confirmation from at least two sensors before triggering full alerts.

Results & Impact

  • Multi-Threat Coverage: Successfully detected motion, gas, fire, and vibration events with reliable accuracy.
  • Visual Verification: Telegram image notifications enabled remote threat confirmation before emergency dispatch.
  • Live Monitoring: Camera web server provided anytime browser-based surveillance access.
  • Rapid Alerting: SMS and Telegram alerts delivered within seconds of threat detection.

Future Enhancements

  • Add AI-based person recognition to differentiate family members from intruders.
  • Implement video recording with cloud storage for event playback.
  • Add night vision IR LED support for low-light surveillance.
  • Develop mobile app with real-time camera feed and sensor dashboard.

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.