Accessible health and environmental monitoring for everyone, everywhere.
- Overview
- Technical Specifications
- Machine Learning & Activity Recognition
- System Architecture
- Hardware Implementation
- Getting Started
- Project Structure
- API Documentation
- Implementation Timeline
- Team
- Screenshots
- Bill of Materials
- Live System Access
- Contributing
- License
LifeGuard is an innovative wearable system that bridges critical gaps in personal safety, accessibility, and preventive healthcare. By integrating advanced sensors with machine learning algorithms, it delivers real-time insights on health metrics and environmental parameters, making safety monitoring accessible and affordable for all.
Current health and environmental monitoring systems face several critical limitations:
- Fragmented Solutions: Most market solutions require multiple devices for comprehensive monitoring, leading to higher costs and added complexity
- Limited Accessibility: Premium devices ($400-600) exclude vulnerable populations who need them most
- Delayed Response: Many existing solutions fail to provide real-time alerts and updates, limiting their ability to respond promptly to critical situations
- Missing Integration: Health and environmental data remain siloed, preventing holistic risk assessment
LifeGuard, powered by the advanced Arduino Nicla Sense ME board, integrates 9 sensors to deliver seamless real-time monitoring of health metrics and environmental conditions at 60% lower cost than premium alternatives like Apple Watch.
|
60% Cheaper than Apple Watch |
72h Battery Life |
9 Integrated Sensors |
IP67 Water Resistance |
99.5% Fall Detection Accuracy |
| Core Board | Arduino Nicla Sense ME with 9 integrated sensors |
| Processor | 32-bit Cortex-M4 microcontroller at 64MHz |
| Health Sensor | MAX30102 - Heart Rate & Pulse Oximeter Module |
| Power | 3.7V LiPo Battery (400mAh) |
| Battery Life | 72 hours with optimized power management |
| Power Consumption | <10mA average draw with dynamic sensor sampling |
| Durability | IP67 water and dust resistance |
| Weight | Approximately 45g (including enclosure) |
| Connectivity | BLE 5.0, WiFi (via companion device) |
| Display | LCD Screen for local data visualization |
| Built-in Sensors |
• 6-Axis IMU (Accelerometer & Gyroscope) • Temperature & Humidity sensors • Barometric pressure sensor (high-linearity, high-accuracy) • Magnetometer • Gas sensors (VOCs, VSCs, CO, H₂) with AI processing • Sensor fusion for absolute spatial orientation |
| Frontend | Backend | Mobile | ML & Analytics |
|---|---|---|---|
|
• React 18 • TypeScript • Tailwind CSS • MapBox API |
• .NET 8.0 • Node.js • PostgreSQL • Firebase (Real-time DB) • JWT Auth • OAuth 2.0 |
• Flutter 3.19 • Provider State • Material 3 Design • SharedPreferences • Dark/Light Themes |
• LSTM Networks • TinyML Models • Edge Impulse Platform • Edge Inference • Time-series Analysis • Sensor Fusion • Z-score Normalization • Quantization & Pruning |
- Frontend: Vercel (Web hosting with global CDN)
- Backend: Render (API hosting with auto-scaling)
- Database: Neon (PostgreSQL hosting)
- Real-time Database: Firebase
- CI/CD: Automated deployment pipelines
LifeGuard incorporates state-of-the-art machine learning capabilities through Edge Impulse for real-time activity classification and fall detection directly on the device:
View Live Edge Impulse Project
- Model Type: Accelerometer-based activity classification with LSTM architecture
- Target Device: Arduino Nicla Vision (Cortex-M7 480MHz) / Nicla Sense ME (Cortex-M4 64MHz)
- Training Data: 284 samples across 18+ minutes (collected: 18m 5s)
- Performance Metrics:
- Validation Accuracy: 100.0%
- Test Accuracy: 99.5%
- Latency: 2ms (real-time capable)
- False Positive Rate: <0.5%
- Memory Footprint:
- RAM Usage: 1.8K
- Flash Usage: 17.0K
- Optimization: Quantized (int8) for efficient embedded deployment
- Walking: Normal walking activity detection with gait analysis
- Still: Stationary/resting state recognition for baseline monitoring
- Falling: Critical fall event detection with 99.5% accuracy
- Unknown: Unclassified movement patterns flagged for review
Input Configuration:
- Sensors: AccX, AccY, AccZ (3-axis accelerometer)
- Sampling Rate: 10Hz for optimal battery/accuracy balance
- Window Size: 1-second data windows (1000ms)
- Window Increase: Sliding window approach for continuous monitoring
Feature Extraction:
- Spectral analysis of acceleration patterns
- Time-series windowing for motion data
- Z-score normalization for sensor data
- Sensor fusion combining IMU data
Model Training:
- Pre-trained LSTM models for temporal pattern recognition
- Transfer learning from established activity datasets
- Custom training on device-specific movement patterns
- Continuous learning capability for personalization
This ML model enables:
- Automatic Fall Detection: Instant emergency contact notifications upon fall detection
- Activity Pattern Analysis: Long-term health insights from movement behaviors
- Risk Assessment: Predictive analytics for fall risk based on movement patterns
- False Positive Reduction: Correlation with heart rate variability to distinguish falls from jumps
- Real-time Processing: On-device inference with <500ms end-to-end latency
- Power Efficiency: Optimized model allowing 72h battery life with continuous monitoring
Dataset Statistics:
- Total Data Collected: 18m 5s
- Train/Test Split: 67% / 33%
- Sensors Used: accX, accY, accZ @ 10Hz
- Labels: falling, still, unknown, walking
- Sample Length: 1 second windows
The LifeGuard system follows a distributed architecture with edge computing capabilities:
-
Edge Layer (Wearable Device):
- Arduino Nicla Sense ME with integrated sensors
- On-device ML inference for real-time fall detection
- Local data preprocessing and filtering
- BLE communication with companion device
-
Gateway Layer (Mobile/Web):
- Data aggregation from wearable device
- User interface for monitoring and control
- Local caching for offline functionality
- Alert management and notification
-
Cloud Layer (Backend Services):
- .NET API for data ingestion and processing
- PostgreSQL database with HIPAA-compliant encryption
- Firebase for real-time data synchronization
- Analytics and long-term trend analysis
- Emergency contact management
-
Integration Layer:
- MapBox for pollution mapping
- MyHealthfinder API for health tips
- Freesound API for wellness sounds
- SendGrid for email notifications
- OAuth providers for authentication
Data Flow Process:
-
Data Collection:
- Sensors gather health and environmental data at optimized intervals
- MAX30102 monitors heart rate and SpO2
- Built-in sensors track motion, air quality, and environmental conditions
-
Edge Processing:
- TinyML models analyze patterns on-device
- Real-time activity classification
- Critical events trigger immediate local alerts
- Data compression before transmission
-
Data Transmission:
- BLE connection to companion device (smartphone)
- Secure encrypted data packets
- Efficient batching to minimize power consumption
- Automatic reconnection handling
-
Cloud Processing:
- Data ingestion through REST APIs
- Storage in PostgreSQL with encryption
- Real-time updates via Firebase
- Advanced analytics and pattern detection
-
User Interface:
- Real-time dashboard visualization on web and mobile
- Interactive pollution maps
- Historical trend analysis
- Customizable alert configurations
-
Alert System:
- Threshold-based automatic triggers
- Multi-channel notifications (SMS, email, push)
- Emergency contact cascade
- Location sharing with emergency responders
This diagram illustrates the complete ecosystem showing how the wearable device communicates with various stakeholders:
- Wearable User: Direct monitoring and alerts
- Healthcare Professional: Access to patient data and trends
- Researcher: Anonymous aggregated data for studies
- Immediate Family: Emergency notifications and status updates
Components:
- Arduino Nicla Sense ME (main processing unit with 9 sensors)
- MAX30102 Sensor (heart rate and SpO2 monitoring)
- LiPo Battery 3.7V 400mAh (power supply)
- Connection wiring and interfaces
Arduino Nicla Sense ME Features:
- Microcontroller: 32-bit Cortex-M4 @ 64MHz
- Smart Sensor Hub: BME688 with AI for gas sensing
- IMU: 6-axis motion tracking (BHI260AP)
- Pressure Sensor: BMP390 high-accuracy barometric sensor
- Connectivity: Bluetooth Module (ANNA-B112) for BLE 5.0
- Memory: 2 MB Flash, UART/SPI/I2C interfaces
- Power Management: BQ25120A with battery charging
- LED Driver: IS31FL3194 for RGB LED control
Key Pin Connections:
- Power Pins: VIN, 3.3V, GND for power distribution
- I2C Interface: SCL, SDA for MAX30102 sensor communication
- Analog Pins: A0-A4 for sensor expansion
- Digital Pins: D0-D13 for control signals
- Battery Connector: JST connector for LiPo battery
- USB-C: Programming and charging interface
Schematic Components:
- ESLOV Connector: For future expansion and modularity
- Battery Connector: JST 2-pin for LiPo battery connection
- USB Connector: USB-C for programming, debugging, and charging
- Power Management: Voltage regulation and battery charging circuit
- Sensor Interfaces: I2C bus connections for external sensors
- LED Control: RGB LED driver circuitry
Connection Details:
- Nicla Sense ME to MAX30102: I2C connection (SCL, SDA, VIN, GND)
- Battery to Nicla: Direct connection via JST connector
- Power Distribution: 3.7V from battery regulated to 3.3V for sensors
Enclosure Features (Designed in SolidWorks):
- Compact wearable form factor
- Watch-style wrist mounting system
- IP67-rated water and dust resistance
- Ventilation for environmental sensors
- Secure compartments for electronics
- Easy battery replacement design
- Integrated watch strap mounting points
Completed Device:
- White protective housing with LED indicator window
- Standard watch strap for comfortable wearing
- Compact 45g total weight
- Dimensions optimized for all-day wear
- LCD screen for local display (optional)
- Button-free operation (controlled via app)
Software Requirements:
- Node.js 18+ (for web development)
- .NET SDK 8.0 (for backend API)
- Flutter SDK 3.19+ (for mobile app)
- PostgreSQL 15+ (database)
- Arduino IDE or PlatformIO (for firmware development)
- Git (version control)
Hardware Requirements (for development):
- Arduino Nicla Sense ME board
- MAX30102 sensor module
- LiPo battery (3.7V, 400mAh)
- USB-C cable for programming
- Computer with Bluetooth capability
git clone https://github.com/evansachie/LifeGuard.git
cd LifeGuard# Backend (.NET)
cp backend/.env.example backend/.env
# Node Server
cp node-server/.env.example node-server/.env
# Web Dashboard
cp web/.env.example web/.env
# Mobile App
cp mobile/.env.example mobile/.envEdit each .env file with your configuration:
- Database connection strings
- API keys (MapBox, SendGrid, Freesound)
- Firebase credentials
- OAuth client IDs
- JWT secret keys
# Install PostgreSQL if not already installed
# Create database
createdb lifeguard_db
# Run migrations (from backend directory)
cd backend
dotnet ef database updatecd backend
dotnet restore
dotnet build
dotnet runThe API will be available at https://localhost:5001 (or configured port)
cd node-server
npm install
npm startThe Node server will run at http://localhost:3000 (or configured port)
cd web
npm install
npm run devAccess the dashboard at http://localhost:3000
cd mobile
flutter pub get
flutter runSelect your target device (iOS simulator, Android emulator, or physical device)
cd firmware
# Using Arduino IDE: Open sketch and upload
# Or using PlatformIO:
pio run --target uploadlifeguard/
├── .github/ # GitHub actions and templates
├── firmware/ # Arduino code and sketches
│ ├── test-sketches/ # Sketches to test Nicla Sense ME
│ └── we-dashboard/ # Web dashboard for reading sensor data
├── web/ # React dashboard
│ ├── public/ # Static assets
│ ├── src/ # React components
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Main application views
│ │ ├── services/ # API integrations
│ │ └── store/ # Redux state management
├── mobile/ # Flutter mobile app
│ ├── lib/ # Dart code
│ │ ├── models/ # Data models
│ │ ├── screens/ # UI screens
│ │ ├── services/ # Business logic
│ │ └── widgets/ # Reusable components
├── backend/ # .NET Core API
│ ├── Controllers/ # API endpoints
│ ├── Models/ # Data structures
│ ├── Services/ # Business logic
│ └── Middleware/ # Request processing
├── node-server/ # Node.js backend service
│ ├── controllers/ # Route controllers
│ ├── models/ # Database schemas
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── middleware/ # Express middleware
│ └── utils/ # Helper functions
├── docs/ # Documentation
│ ├── api/ # API reference
│ ├── images/ # Project images
│ └── tutorials/ # User guides
└── .devcontainer/ # Development container config
View Complete API Documentation on Postman
The LifeGuard API is split across two backend services for optimal performance and modularity:
Base URL: https://lifeguard-hiij.onrender.com
Handles user authentication, account management, and photo storage.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | / |
Health check endpoint | No |
| POST | /api/Account/login |
User login with email/password | No |
| POST | /api/Account/register |
Register new user account | No |
| POST | /api/Account/forgot-password |
Initiate password recovery | No |
| POST | /api/Account/ResendOTP |
Resend OTP to user | No |
| POST | /api/Account/VerifyOTP |
Verify user OTP | No |
| POST | /api/Account/ResetPassword |
Reset password with token | No |
| POST | /api/Account/CompleteProfile |
Complete user profile setup | Yes |
| GET | /api/Account/{id} |
Get account info by ID | Yes |
| GET | /api/Account/GetProfile/{id} |
Get detailed profile | Yes |
| GET | /api/Account/google-login |
Initiate Google OAuth | No |
| GET | /api/Account/signin-google |
Google OAuth callback | No |
| DELETE | /api/Account/{id} |
Delete user account | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /{id}/photo |
Upload user photo | Yes |
| DELETE | /{id}/photo |
Delete user photo | Yes |
| GET | /{id}/photo |
Retrieve user photo | Yes |
Base URL: https://lifeguard-node.onrender.com
Handles health metrics, emergency contacts, medications, and advanced AI features.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/memos |
Get user memos | Yes |
| POST | /api/memos |
Create new memo | Yes |
| GET | /api/memos/undone/count |
Count of incomplete memos | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/emergency-contacts |
Get emergency contacts | Yes |
| POST | /api/emergency-contacts |
Add emergency contact | Yes |
| POST | /api/emergency-contacts/alert |
Send emergency alert | Yes |
| GET | /api/emergency-contacts/test-alert/{id} |
Test alert to contact | Yes |
| GET | /api/emergency-contacts/verify |
Verify contact with token | No |
| GET | /api/emergency-contacts/alerts |
Get alert history | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/health-metrics/latest |
Get latest metrics | Yes |
| POST | /api/health-metrics/save |
Save new metrics | Yes |
| GET | /api/health-metrics/history |
Get metrics history (last 10) | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/exercise/stats |
Get exercise stats & streaks | Yes |
| POST | /api/exercise/complete |
Record workout session | Yes |
| POST | /api/exercise/goals |
Set/update workout goals | Yes |
| GET | /api/exercise/workout-history |
Get workout history | Yes |
| GET | /api/exercise/calories-history |
Get calories history | Yes |
| GET | /api/exercise/streak-history |
Get streak history | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/medications |
Get all medications | Yes |
| POST | /api/medications/add |
Add new medication | Yes |
| PUT | /api/medications/:id |
Update medication | Yes |
| DELETE | /api/medications/:id |
Delete medication | Yes |
| POST | /api/medications/track |
Track dose (taken/skipped) | Yes |
| GET | /api/medications/compliance |
Get compliance rate | Yes |
| GET | /api/medications/emergency/:userId |
Emergency medication info | No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/health-tips |
Get health tips from MyHealthfinder | Yes |
| GET | /api/health-tips/topic/:id |
Get specific topic details | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/freesound/audio-proxy |
Proxy Freesound audio | Yes |
| GET | /api/favorite-sounds |
Get all favorite sounds | Yes |
| GET | /api/favorite-sounds/{userId} |
Get user favorites | Yes |
| DELETE | /api/favorite-sounds/{userId}/{soundId} |
Remove from favorites | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/upload |
Upload PDF for processing | Yes |
| POST | /api/ask |
Ask question about PDFs | Yes |
RAG System Features:
- Upload health documents (prescriptions, lab reports, medical records)
- Intelligent document parsing and text extraction
- Vector embeddings for semantic search
- Natural language question answering
- Context-aware responses with source citations
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/voice-commands/process |
Process voice command with NLP | Yes |
| POST | /api/voice-commands/emergency |
Emergency voice command | Yes |
| GET | /api/voice-commands/commands |
Get available commands | Yes |
Supported Voice Commands:
- "Check my heart rate"
- "Show air quality"
- "Call emergency contact"
- "Start meditation"
- "Record workout"
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/user-preferences/notifications |
Get notification settings | Yes |
| POST | /api/user-preferences/notifications |
Update notification settings | Yes |
| POST | /api/user-preferences/send-test-email |
Send test notification | Yes |
Evans Acheampong Full Stack & Hardware Lead University of Ghana Responsibilities:
|
Michael Adu-Gyamfi Backend & ML Lead University of Ghana Responsibilities:
|
|
Dr. Percy Okae Project Supervisor Department of Computer Engineering University of Ghana Provided academic guidance, technical supervision, and project oversight throughout the development process. |
Chiratidzo Matowe Project Advisor University of Ghana Offered technical advice on system architecture, user experience design, and industry best practices. |
Marvin Rotermund Ambassador Embedded Learning Challenge Edge Impulse Provided guidance on machine learning implementation, Edge Impulse platform utilization, and embedded AI optimization. |
| Item | Description | Cost (GH₵) | Quantity | Total (GH₵) |
|---|---|---|---|---|
| Arduino Nicla Sense ME | Main processing unit with 9 integrated sensors (IMU, temp, humidity, pressure, magnetometer, gas sensors) | 1,500.00 | 1 | 1,500.00 |
| MAX30102 Sensor | Heart Rate & Pulse Oximeter Module with I2C interface | 64.00 | 1 | 64.00 |
| LiPo Battery | 3.7V 400mAh rechargeable battery with JST connector | 95.00 | 1 | 95.00 |
| LCD Screen | Small display for local data visualization (optional) | 90.00 | 1 | 90.00 |
| Custom Enclosure | 3D-printed housing with watch straps | ~50.00 | 1 | 50.00 |
| Item | Purpose | Cost Range |
|---|---|---|
| 3D Printer Access | Enclosure prototyping | GH₵ 500 - 1,000 |
| Development Tools | Software licenses, cloud services | GH₵ 1,000 - 2,000 |
| Testing Equipment | Multimeters, oscilloscope access | GH₵ 500 - 1,500 |
| PCB Prototyping | Custom circuit boards (if scaled) | GH₵ 2,000+ |
| Device | Price Range | LifeGuard Advantage |
|---|---|---|
| Apple Watch Series 9 | $399 - $799 | 60% cheaper, similar sensors |
| Fitbit Sense 2 | $249 - $299 | 62% cheaper, more environmental sensors |
| Samsung Galaxy Watch 6 | $299 - $429 | 65% cheaper, open-source software |
| Garmin Venu 3 | $449 - $499 | 72% cheaper, specialized health focus |
Current Cost Structure (Prototype):
- Hand-assembled units
- 3D-printed enclosures
- Off-the-shelf components
- Estimated cost per unit: GH₵ 1,800
Projected Cost at Scale (1,000+ units):
- Injection-molded enclosures: -30%
- Bulk component purchasing: -20%
- Automated assembly: -15%
- Projected cost per unit: GH₵ 900 - 1,100
Target Retail Price: GH₵ 1,500 - 2,000 ($95 - $125)
|
Web Dashboard https://lifeguard-vert.vercel.app Full-featured web application with:
|
Mobile App Flutter App (iOS & Android) Download and install:
|
|
.NET API https://lifeguard-hiij.onrender.com/api Core backend services:
|
Node.js API https://lifeguard-node.onrender.com Specialized microservices:
|
We welcome contributions from the community! LifeGuard is an open-source project aimed at making health monitoring accessible to all.
This project is licensed under the MIT License - see the LICENSE file for details.
If you use LifeGuard in your research or project, please cite:
@misc{lifeguard2025,
title={LifeGuard: Wearable Health and Environmental Monitoring System},
author={Acheampong, Evans and Adu-Gyamfi, Michael Kwabena},
year={2025},
institution={University of Ghana},
url={https://github.com/evansachie/LifeGuard}
}We would like to express our gratitude to:
- University of Ghana for providing facilities and academic support
- Dr. Percy Okae for invaluable guidance and supervision
- Chiratidzo Matowe for technical advice and mentorship
- Marvin Rotermund and Edge Impulse for ML platform and support
- Arduino for the amazing Nicla Sense ME platform
- Our user testers for valuable feedback and patience
- Open-source community for tools and libraries that made this possible














