Wearable Layer
Smart Watch
ESP32-based wearable device with biometric sensing, fall detection, GPS tracking, and BLE emergency triggers. Runs independent firmware and functions as a standalone safety device even without smartphone connectivity.
MAX30102
HR + SpO₂ Sensor
Optical heart rate and blood oxygen sensor via PPG. Integrated temperature compensation for accurate outdoor readings.
ADXL345
3-Axis Accelerometer
High-resolution accelerometer for activity detection, step counting, and fall detection algorithm input at 400Hz.
NEO-6M GPS
Location Tracking
Satellite GPS for outdoor location tracking. Cached last-known position when signal unavailable. Power-gated when indoors.
BLE 5.0 Stack
GATT · ADV · Notify
Bluetooth LE for data streaming to gateway (MiniPC). Uses GATT notifications for real-time data and advertisements for emergency broadcast.
Power Manager
1100mAh LiPo · Sleep modes
Dynamic power management: full-rate sampling when active, reduced rate in sleep, GPS power-gated when indoor. 72hr typical life.
Emergency Trigger
Fall · Button · BLE alert
Dual-trigger emergency: physical button press (3s hold) or automatic fall detection. Broadcasts via BLE advertisement + MQTT alert.
Sensor Specification Matrix
All sensors connected to ESP32-S3 · I2C bus @ 400kHz
| Sensor | Measurement | Range | Accuracy | Sample Rate |
|---|---|---|---|---|
| MAX30102 | Heart Rate + SpO₂ | HR: 30–250bpm / SpO₂: 70–100% | ±2bpm / ±1.5% | 100Hz / 50Hz |
| ADXL345 | Acceleration (3-axis) | ±16g | ±0.5g | 400Hz |
| NEO-6M GPS | Latitude / Longitude | Global | 2.5m CEP | 5Hz |
| ADC (battery) | Battery voltage | 3.0–4.2V LiPo | ±10mV | 1Hz |
| Push button | Emergency trigger | Binary | — | Interrupt |
MQTT Payload Schema
// Wearable MQTT payload schema (JSON)
{
"device_id": "watch-001",
"timestamp": "2024-11-15T08:32:14.231Z",
"vitals": {
"heart_rate": { "bpm": 72, "confidence": 0.96 },
"spo2": { "percent": 97, "confidence": 0.94 },
"steps": 3420
},
"motion": {
"activity": "walking", // idle | walking | running | fall
"fall_detected": false,
"ax": 0.12, "ay": -0.08, "az": 9.78
},
"location": {
"lat": 24.7136, "lng": 46.6753,
"accuracy_m": 3.2,
"source": "gps" // gps | last_known | unavailable
},
"system": {
"battery_pct": 82,
"rssi_dbm": -62,
"firmware": "v1.4.2"
}
}Fall Detection Algorithm
// ESP32 fall detection (Arduino C++)
#define FALL_THRESHOLD 2.5f // g-force spike
#define STILLNESS_PERIOD 2000 // ms after spike
#define SAMPLE_RATE_MS 10 // 100Hz
float magnitude(float ax, float ay, float az) {
return sqrt(ax*ax + ay*ay + az*az);
}
void IRAM_ATTR accel_isr() {
float g = magnitude(accel.ax, accel.ay, accel.az);
if (g > FALL_THRESHOLD && !fall_candidate) {
fall_candidate = true;
fall_candidate_time = millis();
}
if (fall_candidate && millis() - fall_candidate_time > STILLNESS_PERIOD) {
if (magnitude(accel.ax, accel.ay, accel.az) < 1.2f) {
trigger_emergency_alert(FALL_DETECTED);
}
fall_candidate = false;
}
}