Skip to content

Development of a real-time earthquake detection system, to alert the population even in areas where there isn’t a dedicated relevation system. The solution will realize stand-alone detectors, which will be applicable to appliances in the future. The data will be sent to a server which will then send an alert in case of a seismic wave.

License

Notifications You must be signed in to change notification settings

GiZano/QuakeGuard

Repository files navigation

🌋 QuakeGuard

Electro-Domestic Seismic Alarm System

Full-Stack IoT Architecture for Real-Time Earthquake Detection

C++ Python React Native PostgreSQL Redis Docker


📖 Overview

QuakeGuard is an advanced Full-Stack IoT architecture designed for the real-time detection, analysis, and reporting of seismic events.

The system utilizes intelligent edge sensors (ESP32) that analyze vibrations locally and transmit cryptographically secured data to an asynchronous hybrid Cloud. The backend is specifically engineered to handle the massive traffic spikes (Thundering Herd effect) typical during widespread earthquake events, ensuring reliable alarm delivery without bottlenecking.


🏗 System Architecture

The project is highly modular, following Microservices and Event-Driven Design principles across three main layers:

1. 📡 IoT Edge (Data Harvester)

  • Hardware: ESP32-C3 SuperMini paired with an ADXL345 Accelerometer.
  • Edge Computing: 100Hz sampling rate, applying Digital High-Pass Filters (HPF) and the STA/LTA (Short Term/Long Term Average) seismic algorithm directly on the device.
  • Security: Hardware-level digital signing of payloads using ECDSA (NIST256p).
  • Resilience: Temporal timestamp reconstruction to mitigate network latency and out-of-order packet deliveries.

2. ☁️ Backend (Data Elaborator)

  • Core API: Built with FastAPI (Python) for high-performance asynchronous routing.
  • Event Pattern: Producer-Consumer architecture leveraging Redis as a Message Broker to decouple ingestion from processing.
  • Persistence: PostgreSQL + PostGIS for robust geospatial data management.
  • Background Workers: Dedicated processes for queue consumption, event validation, and alarm aggregation.
  • Performance: Fully asynchronous management capable of handling >500 Req/s on standard commercial hardware.

3. 📱 Frontend (Mobile Monitor)

  • Framework: React Native (Expo) for cross-platform compatibility.
  • Features: Interactive dashboard with real-time visual and haptic alarms via Adaptive Polling, alongside a live sensor network map.

🔐 Security & Cryptography

Data integrity is paramount in emergency systems. Every telemetry packet transmitted by the edge sensors is cryptographically signed.

{ 
  "value": 250, 
  "timestamp": 17000000, 
  "signature": "a1b2c3d4e5f6..." 
}

The backend rigorously verifies the signature (SHA256 + ECDSA) against the sensor's registered public key before accepting the payload. This architecture strictly prevents Man-in-the-Middle (MitM) and Spoofing attacks, ensuring that alarms cannot be falsely triggered by malicious actors.


🚀 Quick Start (Local Deployment)

Prerequisites

  • Docker & Docker Compose
  • PlatformIO (VS Code Extension)
  • Node.js & Expo Go (Mobile App)

1. Launch the Cloud Backend

Deploy the API, Database, and Message Broker via Docker:

cd "Backend - Data Elaborator"
docker-compose up --build -d

The backend will be live at http://localhost:8000. API documentation is auto-generated at http://localhost:8000/docs.

2. Configure and Flash the IoT Edge Device

  1. Modify IoT - Data Harvester/esp32_config.env with your local IP and WiFi credentials.
  2. Upload the firmware to the ESP32 via PlatformIO.
  3. ⚠️ IMPORTANT: On the first boot, copy the generated PUBLIC KEY from the serial monitor and register the device via the Swagger UI (http://localhost:8000/docs).

3. Launch the Mobile Dashboard

cd "Frontend - Mobile App"
npm install
npx expo start

Scan the generated QR code with your smartphone (ensure your phone is on the same WiFi network as your backend).


Developed by GiZano
Version 3.0.0 (Stable) | MIT License

About

Development of a real-time earthquake detection system, to alert the population even in areas where there isn’t a dedicated relevation system. The solution will realize stand-alone detectors, which will be applicable to appliances in the future. The data will be sent to a server which will then send an alert in case of a seismic wave.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •