An open-source distributed earthquake detection network that analyzes real-time accelerometer data from Android phones, cross-references it with global seismic data (USGS, EMSC, KOERI, AFAD), and sends early warnings before official confirmation.
π± Android app: Testable via Expo Go β standalone APK coming soon
π₯οΈ Windows app: Planned (Electron + Fluent UI)
- β Real-time sensor ingestion β multi-device WebSocket support
- β Two-layer earthquake detection β simple threshold + STA/LTA algorithm
- β Geofencing β 50 km radius clustering + region ID grouping
- β Global data sources β USGS, EMSC, KOERI, AFAD integration
- β Smart matching β correlates local sensor triggers with official data
- β Early warning β alerts sent before official confirmation
- β REST API + WebSocket β devices, events, alerts, live sensor summary
- β Web dashboard β Leaflet map, live device list, earthquake feed
- β Chat β real-time messaging over WebSocket (flood protection included)
- β
Manual reports β
/reportendpoint for felt-earthquake reports (MMI scale)
- β Material You theme β adapts to system color palette (Android 12+)
- β 4 tabs: Alerts / Earthquake List / Report / Settings + Chat
- β Live sensor monitoring β accelerometer data streamed to server
- β
GPS region detection β automatic
region_idfrom location - β Earthquake list β source filter, magnitude color scale, distance from user
- β MMI felt report β Mercalli scale IIβVII manual report submission
- β Alert customization β minimum magnitude threshold, distance filter, notification types
- β Chat β real-time messaging, profanity filter, flood protection (3 msg/10s)
seismic-network/
βββ main.py # FastAPI server, WebSocket manager, REST API
βββ analysis.py # STA/LTA signal processing, geofencing
βββ models.py # SQLAlchemy database models
βββ global_sync.py # USGS + EMSC sync
βββ koeri_sync.py # KOERI (Kandilli Observatory) sync
βββ afad_sync.py # AFAD sync
βββ config.py # Configuration
βββ android-app/
βββ App.tsx # Tab navigation + Material You theme
βββ context/
β βββ SeismicContext.tsx # WebSocket, sensor, chat, settings state
βββ screens/
βββ AlertsScreen.tsx # Alerts + network status + live sensor
βββ QuakeListScreen.tsx# Global earthquake list
βββ ReportScreen.tsx # MMI felt report
βββ SettingsScreen.tsx # Settings + chat
- Python 3.9+
- Ubuntu 22.04+ (VPS recommended)
- Node.js 18+
- Expo Go app (for testing)
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000cd android-app
npm install
npx expo start --lanScan the QR code with Expo Go.
wss://YOUR_SERVER/ws/sensor/{device_id}
Send sensor data:
{
"type": "sensor_data",
"x": 0.05, "y": 0.03, "z": 9.81,
"latitude": 41.0082, "longitude": 28.9784,
"region_id": "turkey_istanbul",
"timestamp": "2024-03-19T20:00:00Z"
}Send chat message:
{ "type": "chat", "text": "Hello!", "timestamp": "..." }| Method | Endpoint | Description |
|---|---|---|
| GET | /status |
Network status, device count |
| GET | /devices |
Registered devices |
| GET | /events |
Local + global earthquake events |
| GET | /alerts |
Generated alerts |
| POST | /report |
Submit a felt-earthquake report |
| Layer | Method | Threshold |
|---|---|---|
| 1 | Simple threshold | vector magnitude > 0.1g |
| 2 | STA/LTA | ratio > 3.0 (STA: 1s, LTA: 30s) |
- Time window: 5 seconds
- Minimum devices: 3+
- Radius: 50 km (Haversine)
| Local Sensors | Official Data | Result |
|---|---|---|
| β Triggered | β No data yet | EARLY WARNING (orange) |
| β Triggered | β Matched | CONFIRMED EARTHQUAKE (red) |
| β Silent | β Official data | DISTANT EARTHQUAKE (blue) |
Edit config.py:
THRESHOLD_SIMPLE_G = 0.1 # Simple threshold (g)
STA_LTA_TRIGGER_RATIO = 3.0 # STA/LTA trigger ratio
GEOFENCING_RADIUS_KM = 50.0 # Clustering radius
TIME_WINDOW_SECONDS = 5 # Detection time window
MIN_DEVICES_FOR_TRIGGER = 3 # Minimum devices to confirm event- Standalone APK / EAS Build
- Windows desktop app (Electron + Fluent UI)
- Multi-device management panel
- Country-based chat rooms
- Additional data sources (INGV, GFZ)
- iOS support
- Fork the repo
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes
- Push and open a Pull Request
β οΈ This system is not a replacement for official earthquake warning services. It is intended for early alerting and community awareness only.