ElderGuard is a comprehensive IoT-based health monitoring system designed specifically for elderly care. Built on the ESP32 platform, the system provides real-time health monitoring, fall detection, location tracking, and medication reminders to help elderly individuals maintain independence while ensuring their safety and well-being.
-
Health Monitoring
- Real-time ECG and heart rate monitoring
- Continuous vital sign tracking
- Health data logging and analysis
-
Safety Features
- Advanced fall detection algorithm using MPU6050
- Emergency alert system
- Real-time GPS location tracking
-
Medication Management
- Scheduled medication reminders
- Compliance tracking
- Configurable dosage information
-
User Interface
- OLED display with intuitive information layout
- Voice alerts and notifications
- Simple control interface for elderly users
-
Connectivity
- Wi-Fi for home network connection
- MQTT for real-time data transmission
- HTTP for web-based monitoring interface
- OTA firmware updates
| Component | Purpose | Interface |
|---|---|---|
| ESP32 DevKit V1 | Main controller | - |
| AD8232 ECG Module | Heart monitoring | Analog |
| MPU6050 Accelerometer | Fall detection | I2C |
| NEO-6M GPS Module | Location tracking | Serial (UART) |
| SSD1306 OLED Display | User interface | I2C |
| MP3-TF-16P Module | Audio notifications | Serial (UART) |
| LiPo Battery | Power source | - |
ElderGuard uses a multi-tasking architecture based on FreeRTOS:
┌─────────────────┐
│ ESP32 │
│ Main Controller│
└────────┬────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ Sensing │ │ Processing │ │ Communication│
│ Tasks │ │ Tasks │ │ Tasks │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ ECG Task │ │Fall Detection│ │ WiFi Task │
│ GPS Task │ │Medication │ │ MQTT Task │
└─────────────┘ │Time Task │ │ HTTP Task │
└─────────────┘ └─────────────┘
The system is organized into multiple FreeRTOS tasks, each handling a specific function:
-
Sensing Tasks
ecg_task: Monitors heart signals and processes ECG datagps_task: Handles GPS data acquisition and location tracking
-
Processing Tasks
fall_detection_task: Processes accelerometer data to detect fallsmedication_task: Manages medication schedules and remindstime_task: Maintains system time via NTP
-
Interface Tasks
screen_task: Manages the OLED displayaudio_task: Controls the audio notification system
-
Connectivity Tasks
wifi_task: Handles WiFi connectivitymqtt_task: Manages MQTT communicationhttp_task: Provides HTTP server functionalityfirmware_update_task: Handles OTA updates
- PlatformIO IDE (recommended) or Arduino IDE
- ESP32 board support package
- Required libraries (see below)
All dependencies are managed through PlatformIO:
- Adafruit GFX Library
- Adafruit SH110X
- Adafruit MPU6050
- Adafruit Unified Sensor
- TinyGPSPlus
- DFRobotDFPlayerMini
- NTPClient
- PubSubClient
- ArduinoJson
- WebSockets
- Connect components according to the pin definitions in
include/config.h - Ensure proper power distribution
- Verify all sensor connections
- Clone this repository:
git clone https://github.com/aland-omed/ElderGuardesp32devkitv1.git - Open the project in PlatformIO
- Build and upload to your ESP32
The system is configured through the config.h file, which contains:
- Pin definitions for all connected hardware
- Network settings
- MQTT broker information
- System parameters and thresholds
- Power on the device
- Wait for system initialization (displayed on OLED)
- The system will automatically:
- Connect to WiFi
- Synchronize time
- Start all monitoring tasks
- View system status on the OLED display
- Alerts will be provided through:
- Audio notifications
- OLED display
- MQTT messages to connected services
ElderGuard/
├── include/ # Header files
│ ├── audio_task.h # Audio notifications
│ ├── config.h # System configuration
│ ├── ecg_task.h # ECG monitoring
│ ├── fall_detection_task.h # Fall detection algorithms
│ ├── firmware_update_task.h# OTA update functionality
│ ├── globals.h # Global variables & structures
│ ├── gps_task.h # GPS location tracking
│ ├── http_task.h # HTTP server implementation
│ ├── medication_task.h # Medication reminders
│ ├── mqtt_task.h # MQTT client implementation
│ ├── screen_task.h # OLED display controller
│ ├── time_task.h # NTP time synchronization
│ └── wifi_task.h # WiFi connectivity
├── src/ # Source files
│ ├── globals.cpp # Global variables implementation
│ ├── main.cpp # Main program entry point
│ └── tasks/ # Task implementations
│ ├── audio_task.cpp # Audio system implementation
│ ├── ecg_task.cpp # ECG monitoring implementation
│ ├── fall_detection_task.cpp # Fall detection implementation
│ ├── firmware_update_task.cpp # OTA updates implementation
│ ├── gps_task.cpp # GPS task implementation
│ ├── http_task.cpp # HTTP server implementation
│ ├── medication_task.cpp # Medication reminder implementation
│ ├── mqtt_task.cpp # MQTT client implementation
│ ├── screen_task.cpp # OLED display implementation
│ ├── time_task.cpp # Time synchronization implementation
│ └── wifi_task.cpp # WiFi connection handling
├── platformio.ini # PlatformIO configuration
├── COPYRIGHT.md # Copyright and license information
└── README.md # Project documentation
- Current Version: V3.0 (April 2025)
- Status: Active Development
- Last Updated: April 26, 2025
- Cloud integration for data storage and analysis
- Mobile app companion for remote monitoring
- Machine learning for improved fall detection
- Additional health sensors integration
- Battery optimization for extended runtime
- Aland Omed - GitHub
- Harun Hameed
- Zhir Jamil
Project developed as a graduation project at Komar University of Science and Technology.
This project is licensed under the MIT License - see the COPYRIGHT.md file for details.
- Komar University of Science and Technology for supporting this project
- All contributors to the open-source libraries used in this project
- The ESP32 community for their extensive resources and examples
ElderGuard - Caring technology for independent living
