Skip to content

Eteriss/SecurityApp

Repository files navigation

ESP32 Home Security System

This repository contains a complete home security system solution using ESP32 camera modules with motion detection sensors (PIR and mmWave), a Raspberry Pi server, and a React Native mobile application for monitoring and control.

System Overview

The system consists of three main components:

  1. ESP32 Camera Devices - ESP32 modules with cameras and motion sensors
  2. Raspberry Pi Server - Handles communication and coordination between devices
  3. Mobile Application - Provides user interface for monitoring, alerts, and configuration

1. ESP32 Camera Devices

Two types of ESP32 camera devices are supported:

ESP32 PIR Module

This module uses a Passive Infrared (PIR) sensor to detect motion through heat signatures.

Hardware Requirements:

  • ESP32 with camera module
  • PIR motion sensor
  • Connecting wires

Setup:

  1. Connect the PIR sensor to the ESP32 according to this wiring:

    PIR Sensor ESP32
    VCC 3.3V
    GND GND
    OUT GPIO 14
  2. Connect the ESP32 to computer via USB

  3. Open the esp32_pir_module sketch in Arduino IDE

  4. Install required libraries:

    • WiFi
    • WebSocketsClient
    • ArduinoJson
    • NTPClient
    • ESP32 Camera libraries
    • ESPAsyncWebServer
    • AsyncTCP
  5. Upload the sketch to ESP32

ESP32 mmWave Module

This module uses a millimeter-wave radar sensor for more precise motion detection that can work through thin walls and in varying lighting conditions.

Hardware Requirements:

  • ESP32 with camera module
  • mmWave radar sensor
  • Connecting wires

Setup:

  1. Connect the mmWave sensor to the ESP32 according to this wiring:
    mmWave Sensor ESP32
    VCC 3.3V
    GND GND
    RX GPIO 44
    TX GPIO 43
  2. Connect the ESP32 to computer via USB
  3. Open the esp32_mmwave_module sketch in Arduino IDE
  4. Install the same libraries as for the PIR module
  5. Upload the sketch to ESP32

Initial Device Configuration

When powered on for the first time, each ESP32 device will:

  1. Create a WiFi access point named either "ESP32-PIR-Setup" or "ESP32-mmWave-Setup"
  2. Connect to this access point using a smartphone or computer
  3. The device is now ready to be added to your security system through the mobile app

2. Raspberry Pi Server

The server runs on a Raspberry Pi and acts as a communications hub for all ESP32 devices and the mobile application.

Requirements:

  • Raspberry Pi (3 or 4 recommended) with Raspbian/Raspberry Pi OS
  • Python 3.7 or higher
  • Stable network connection

Installation:

  1. Transfer the server.py file to your Raspberry Pi

  2. Install the required Python packages:

    pip install websockets python-socketio json numpy asyncio
    
  3. Edit the provided security-server.service file to update the paths:

    • Replace /path/to/server.py with the actual path to the server.py file
    • Replace /path/to/directory with the directory containing server.py
  4. Move the provided security-server.service file to the systemd directory:

    sudo mv security-server.service /etc/systemd/system/
    
  5. Enable and start the service:

    sudo systemctl enable security-server.service
    sudo systemctl start security-server.service
    
  6. Check the status to verify it's running:

    sudo systemctl status security-server.service
    

3. Mobile Application

The mobile app provides the user interface for monitoring camera feeds, receiving alerts, and configuring the system.

Development Setup:

  1. Clone the repository containing the mobile app code
  2. Install dependencies:
    npm install
    
  3. Start the development server:
    npx expo start
    
  4. Connect with the Expo Go app on your mobile device:
    • Install "Expo Go" from the App Store (iOS) or Google Play Store (Android)
    • Scan the QR code displayed in your terminal
    • The app will open on your device

Using the Mobile App:

  1. On the mobile app, first go to the Settings screen to configure the following parameters
    (these will be used by the ESP32 devices to connect to your network and server):
    • Your home WiFi network SSID and password
    • The Raspberry Pi server IP address and port (default is 8081 for the ESP32 devices)
  2. Power on the ESP32 device - it will create its own WiFi access point
  3. Connect your phone to the ESP32's WiFi network (either "ESP32-PIR-Setup" or "ESP32-mmWave-Setup")
  4. On the mobile app, go to the Devices screen
  5. Tap "Add Device"
  6. Enter a name for your device and tap "Configure & Add Device"
  7. The device will restart and connect to your network and the Raspberry Pi server
  8. Connect your phone to your home network
  9. On the Home screen of the mobile app add the server IP and port (default is 8080 for the app)
  10. Tap "Connect" to establish a connection with the server.
  11. The system is now configured and ready to use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors