Skip to content

mbulic97/Smart-Home-Security-System

Repository files navigation

Smart Home Security System

LOGO

Mobile App

Overview

20250926_233003 Smart Home Security System built with Arduino Uno R3, ESP32, Firebase, and a Kotlin Android application using Jetpack Compose and MVVM architecture. The system monitors multiple sensors in real time and provides feedback through the mobile app.

Technologies used (Mobile App)

  • Navigation Bar – Home, History (currently in development), and Profile screens.
  • Firebase Authentication – Login, Sign up, and Sign out (with valid Arduino ID).
  • Firebase Realtime Database – Stores and updates sensor states in real time.
  • Firebase Firestore – Stores user profiles and Arduino IDs.
  • MVVM & LiveData – separates logic from views, manages user authentication, profile, and real-time sensor data on Home screen.

Built With

  • Android Studio Kotlin Jetpack Compose, MVVM
  • Arduino IDE C++
  • Firebase authentication, Realtime Database and Firestore
  • Arduino Uno R3, ESP32
  • Full-size and half-size breadboards
  • Led diode + 220 Ohm
  • Pushbutton switch 12mm + 1k Ohm
  • Buzzer
  • Passive infrared sensor HC SR501
  • Door (servo – Open/Closed state)
  • Resistor
  • RFID Card
  • Voltage divider 5V(Arduino Uno R3) to 3.3V(ESP32), 2.2k Ohm + 1k Ohm
  • Water Level
  • DHT11 temperature and humidity sensor
  • Serial communication (Arduino Uno R3 ↔ ESP32)

Circuit Schema

Shema

Demonstrations

  • Google Drive Videos
  • Screenshots of the Android app
    Profile Home Signup
    Login Alarm Alarm & Flooding

    How It Works

    • Arduino Uno R3
      • Collects sensor data:
        • Alarm → true/false
        • PIR sensor → true/false
        • Temperature & Humidity → numerical values
        • Water Level → true/false
        • Switch button stops the active alarm after 5 seconds, then the system restarts.
        • Sends these values to the ESP32 via Serial communication, pin TX0 (Arduino Uno R3) → Voltage divider (5V → 3.3V) → pin 16GPIO (ESP32).
    • ESP32
      • Reads the Serial output from Arduino Uno R3.
      • Servo motor controls door (Open/Closed) with a valid RFID card.
      • Sends all sensor values and states to Firebase Realtime Database
    • Android App (Kotlin, Jetpack Compose, MVVM)
      • Reads data from Firebase in real time.
      • Displays live sensor values.
      • Vibration & red text alerts when Alarm, PIR, or Water Level are triggered
      • Provides door control (servo Open/Closed).
      • User login, registration, profile, and sign out (requires valid Arduino ID).