Skip to content

changliu0024/Smart-Home-Security

Repository files navigation

Smart Home Security System (IoT Project)

A cost-effective, real-time smart home security solution built with Raspberry Pi, MQTT, and Android, demonstrating the practical application of IoT principles in residential safety.

👥 Team Members

Warsha Kiringoda (waki2609@student.su.se)

Chang Liu (cl0024556@gmail.com / chli6238@student.su.se)

Ivoshani Senevirathne (lase4127@student.su.se)

📌 Project Overview

The goal of this project is to design and implement a functional, low-cost home security system that enhances user convenience and safety. It features real-time monitoring, automated responses, and a mobile interface with three distinct operational modes to suit different security scenarios.

Key Objectives

  • Real-time Functionality: Alerts, light automation, and live camera feed.
  • User Interaction: An Android-based mobile application for remote control and status monitoring.
  • Multi-mode Operation: Three specialized modes: Stay, Away, and Night.

🛠 Features & System Modes

The system's behavior changes dynamically based on the selected mode:

Mode Purpose Core Functions
Stay Protects perimeter while allowing internal motion Monitors doors/windows; records events without triggering loud alarms.
Away High-level notification for unoccupied house Monitors all sensors; sends instant push notifications for any event.
Night Maximum alerting for sleeping hours Monitors door/window sensors; triggers immediate alerts/alarms upon breach.

Core Deliverables:

  • IoT System: Integrated with 3 sensors (Motion, Door, Window) and 1 control device (Raspberry Pi).
  • Android App: Features login, live camera feed, light toggling, sensor status, and event history.
  • Automation: Light auto-toggles based on motion detection.

🏗 Technology Stack

  • Hardware: Raspberry Pi, PIR Motion Sensor, Magnetic Reed Switches (Door/Window), TellDus/Tellstick.
  • Protocols: MQTT (test.mosquitto.org) for low-latency, real-time communication between hardware and mobile app.
  • Software:
    • Backend: Python (RPi.GPIO, gpiozero libraries).
    • Frontend: Android (Java/Kotlin), Simple HTML/CSS/JS for sensor simulation.
    • Methodology: Scrumban with iterative testing.

🔌 Hardware Implementation Details

1. Motion Sensor Integration

  • A Python script (motionserver.py) runs on the Raspberry Pi, opening a port for HTTP POST requests.
  • Data (0 or 1) is published to the topic iotproject/motion via MQTT at 1-second intervals.
  • The Android app subscribes to this topic and updates the UI instantly upon state changes.

2. Door & Window Sensors

  • Hardware: Magnetic reed switches connected to Raspberry Pi GPIO pins and Ground (GND).
  • Logic: * Closed: Magnet is near the switch (Circuit Closed) $\rightarrow$ LOW signal.
    • Open: Magnet moves away (Circuit Open) $\rightarrow$ HIGH signal.
  • Monitoring: Uses gpiozero to detect state transitions in real-time.

🚀 Challenges & Solutions

  • Reliability: Ensured low-latency communication between the Raspberry Pi and the app by implementing the MQTT publish-subscribe model.
  • System Setup: Overcame Raspberry Pi configuration hurdles through rigorous documentation consultation and connection testing.
  • Logic Design: Defined mode-specific behaviors by simulating real-world security scenarios and user requirements.

🔮 Future Work

  • AI Integration: Implement AI for threat detection and passenger recognition via camera image analysis.
  • Scalability: Expand the system to support multi-home management.
  • UI/UX: Further enhance the Android application's data management and interface design.

Final Presentation Powerpoint:

https://docs.google.com/presentation/d/1PuCxeGfW5G5yHDy3AFmwfzBeH90RLk4lT9S7kYCjKEs/edit?slide=id.g99f2f57a71_0_177&pli=1#slide=id.g99f2f57a71_0_177

About

A real-time, low-cost Smart Home Security System built with Raspberry Pi, MQTT, and Android, featuring mode-based monitoring and automated responses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages