Skip to content

OP-Patel/wearalert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WearAlert: WiFi-Based Fall Detection System

Project Overview

WearAlert is a real-time wireless fall detection and alert system designed to monitor elderly individuals and people with mobility constraints. When a fall is detected, the system immediately alerts a caregiver station, enabling fast and actionable response to prevent serious injury.

The system combines wearable sensors, wireless telemetry, real-time signal processing, and caregiver alerts into a low-latency embedded solution.


Mission

To provide a robust, low-latency fall detection technology that:

  • Continuously monitors patient motion in real-time
  • Detects falls with minimal false positives
  • Delivers immediate audio alerts to caregivers
  • Enables live monitoring through a caregiver dashboard
  • Operates wirelessly across multiple rooms

Results & Recognition

  • Top 20 Nomination at university embedded systems course (out of 100+ submissions)
  • 9–10 Hz wireless packet rate with <100ms end-to-end latency
  • Successfully detected falls across multiple test scenarios with configurable sensitivity
  • Stable multi-MCU system with emergency override and do-not-track modes

Images

IMG_5860 IMG_5835 IMG_5856

Technology Stack

Hardware

  • Wearable Transmitter: ESP32 DevKit with BNO055 IMU (9-DOF) and DPS310 barometer sensor
  • Wireless Relay: ESP8266 receiving data via ESP-NOW protocol
  • Caregiver Station: STM32 Nucleo-F407 running fall detection and alert logic
  • Audio System: DAC + DMA-driven amplifier with integrated speaker
  • Display: SSD1306 OLED for status visualization
  • Integration: Custom 3D-printed headband (Onshape), soldered prototype PCBs

Firmware & Software

  • ESP32 Transmitter: C++ with Arduino libraries (Adafruit_BNO055, Adafruit_DPS310)
  • STM32 Receiver: C with STM32CubeMX and Keil IDE
    • Custom UART packet parser (FSM-based)
    • Real-time fall detection algorithm (multi-stage FSM)
    • DAC/DMA audio playback control
  • Caregiver Dashboard: Python Streamlit with live COM-port visualization

Wireless Communication

  • Protocol: ESP-NOW + WiFi (2.4 GHz)
  • Packet Format: 32-byte structured messages (pressure, acceleration, gyroscope)
  • Data Rate: 9–10 packets/sec = 2.3 kbps
  • Latency: <100ms end-to-end (sensor → wireless → STM32 → alert)

System Architecture

image

Key Features

Fall Detection

  • Multi-stage FSM algorithm using:
    • Barometric altitude change (0.10m–0.18m drop threshold)
    • Linear acceleration magnitude spikes (2.2–3.4 m/s²)
    • Temporal confirmation (350ms+ stillness)
  • Adaptive baseline altitude to account for elevation changes
  • Configurable thresholds to minimize false positives from sudden movements

Patient Controls

  • Emergency Button: Instantly triggers caregiver alert (packet ID=2)
  • Do-Not-Track Toggle: Pauses transmission when patient doesn't want monitoring
  • Visual Feedback: OLED display shows tracking status and acceleration readings

Caregiver Station

  • Immediate Audio Alert: Looping alarm via integrated speaker when fall detected
  • Acknowledgement Button: Caregiver presses to mute alarm and reset system
  • Live Dashboard: Python Streamlit interface showing:
    • Real-time acceleration (X, Y, Z)
    • Barometric pressure trends
    • Gyroscope data
    • Fall detection state
    • Packet count and latency metrics

How to Operate

Setup

  1. Power On Wearable: Connect ESP32 to USB power bank; headband is ready to transmit
  2. Power On Caregiver Station: Connect STM32 to USB power; OLED displays "BOOT OK"
  3. Verify Connection: Check that ESP8266 is receiving ESP-NOW packets (green LED blinks)

Normal Operation

  • Continuous Monitoring: ESP32 transmits sensor data every 100ms (9–10 Hz)
  • Patient Moving: OLED shows "STATE: OK" and displays Z-axis acceleration
  • Patient Stationary: System remains in IDLE state, baseline altitude adapts

Fall Detection Sequence

  1. Phase 1 - Descent: Acceleration spike detected + altitude drop registered
  2. Phase 2 - Impact: Peak acceleration measured; altitude confirms lower position
  3. Phase 3 - Still: Acceleration settles + confirmed altitude drop → FALL ALERT
  4. Audio Alert: DAC plays looping alarm through speaker
  5. Caregiver Action: Press button on caregiver station to acknowledge and stop alarm

Dashboard Monitoring

# On PC connected to STM32 COM port:
streamlit run dashboard.py --logger.level=warning

# Opens browser dashboard showing:
# - Live 3-axis acceleration graph
# - Barometric pressure history
# - Gyroscope data
# - Packet status and latency

Emergency Button

  • Patient presses emergency button on headband
  • Packet ID=2 immediately sent (bypasses fall detection FSM)
  • Caregiver station triggers alarm instantly (no fall confirmation needed)

Do-Not-Track Toggle

  • Patient presses toggle button on headband
  • Transmission pauses; ESP32 stops sending sensor data
  • OLED shows "Tracking: OFF"
  • Press again to resume monitoring

System Specifications

Metric Value
Packet Rate 9–10 Hz
Data Rate 2.3 kbps (32 bytes/packet)
End-to-End Latency <100ms
Pressure Sensor Range 30–120 kPa
Acceleration Range ±16 m/s²
Gyroscope Range ±2000°/s
Operating Range WiFi coverage (typical: 30–50 meters)
Power: Wearable USB power bank (5V, 2A)
Power: Caregiver Station USB (5V, 1A)

Hardware Integration

Soldering & Assembly

  • Soldered BNO055 and DPS310 sensors to ESP32 prototype board
  • Soldered STM32 Nucleo to receiver PCB with OLED and DAC amplifier
  • Integrated all components into a compact 3D-printed headband enclosure

Prototype Boards

  • Double-sided PCB for minimal wiring and interference
  • Decoupling capacitors on all power rails
  • Ground plane for signal integrity

Team

Co-engineered by: Om Patel & Michel [Partner Name]

About

source code for wear alert project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors