An IoT-based Android application for real-time baby health monitoring that integrates embedded sensors, Bluetooth Low Energy (BLE) communication, and cloud services to provide comprehensive health tracking for infants.
The Health Monitoring System is a complete IoT solution designed to help parents and healthcare professionals monitor infant health in real-time. The system tracks temperature and movement data through embedded sensors, transmits it wirelessly via BLE to an Android application, and stores it securely in the cloud for remote access and analysis.
- Real-time Monitoring: Continuous tracking of baby's temperature and acceleration data
- Bluetooth Low Energy (BLE) Integration: Wireless communication with embedded sensor board
- Cloud Synchronization: Automatic data upload to Firebase Firestore with configurable intervals
- Smart Alerts: Automatic notifications for fever detection (β₯38Β°C) and fall detection
- Data Visualization: Interactive line charts for temperature trends over time
- Automated Data Management: Configurable upload periods and automatic cleanup of old records
- Multi-role System: Support for Parents, Doctors, and Admin users
- Role-based Access Control: Different permissions and interfaces for each user type
- Secure Authentication: Firebase Authentication with email verification
- Doctor Approval System: Admin-controlled doctor registration with identity verification
- Doctor Notes: Healthcare professionals can add, edit, and share medical notes
- Search Functionality: Doctors can search patients by name, email, or phone number
- Medical History: Comprehensive tracking of temperature readings and medical notes
- Parent-Doctor Communication: Seamless sharing of health data and medical records
- Language: Java
- Platform: Android (minSdk 24, targetSdk 33)
- Build System: Gradle (Kotlin DSL)
- Architecture: Service-based architecture with background data processing
- Firebase Authentication: User authentication and email verification
- Firebase Firestore: NoSQL database for real-time data storage
- Firebase UI: Pre-built UI components for Firestore integration
- Bluetooth Low Energy (BLE): Wireless sensor data transmission
- Embedded Hardware: EFR32BG22 Thunderboard with:
- Si7021 relative humidity and temperature sensor
- ICM-20648 6-axis inertial measurement unit (IMU)
com.github.PhilJay:MPAndroidChart- Data visualization chartscom.opencsv:opencsv- CSV data exportcom.firebaseui:firebase-ui-firestore- Firebase UI componentscom.sun.mail:android-mail- Email functionality
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββ
β Embedded Board β BLE β Android App β HTTP β Firebase β
β (EFR32BG22) ββββββββββΊβ (Java/Android) βββββββββββΊβ Firestore β
β β β β β β
β - Temperature β β - BLE Service β β - Users β
β - IMU Sensor β β - Data Process β β - Babies β
β β β - UI Activities β β - Temps β
βββββββββββββββββββ ββββββββββββββββββββ β - Notes β
ββββββββββββββββ
-
BLEDataService: Handles BLE communication with embedded sensors
- GATT service discovery and characteristic management
- Real-time data reception via notifications/indications
- Data parsing and broadcasting to other components
-
DataProcessService: Processes and manages sensor data
- Temperature aggregation and mean calculation
- Fall detection algorithm (acceleration magnitude analysis)
- Automated cloud upload with configurable intervals
- Data retention policy enforcement
-
Firebase Integration: Cloud backend services
- User authentication and authorization
- Real-time database synchronization
- Role-based data access control
Firestore
βββ users/
β βββ {userId}/
β βββ email
β βββ userType (Admin/Doctor/Parent)
β βββ approvalStatus
β
βββ babies/
β βββ {babyId}/
β βββ name
β βββ dateOfBirth
β βββ familyInfo
β βββ temps/ (subcollection)
β β βββ {timestamp}/
β β βββ current_temp
β β βββ mean_temp
β β βββ timestamp
β βββ notes/ (subcollection)
β βββ {noteId}/
β βββ content
β βββ doctorId
β βββ timestamp
- Android Studio (latest version recommended)
- Android SDK (API level 24 or higher)
- Firebase project with Firestore and Authentication enabled
- EFR32BG22 Thunderboard or compatible BLE device
- Physical Android device with BLE support (for testing)
-
Clone the repository
git clone https://github.com/priyavrat7/Health-Monitoring-System.git cd Health-Monitoring-System -
Set up Firebase
- Create a new Firebase project at Firebase Console
- Enable Firestore Database and Authentication (Email/Password)
- Download
google-services.jsonand place it inapp/directory - Configure Firestore security rules for your use case
-
Configure the Project
- Open the project in Android Studio
- Sync Gradle files
- Update
applicationIdinapp/build.gradle.ktsif needed
-
Build and Run
./gradlew assembleDebug
Or use Android Studio's Run button to install on a connected device
- Authentication Rules: Configure email/password authentication
- Firestore Rules: Set up appropriate security rules:
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // Add your security rules here } }
- Registration: Create an account with email and password
- Baby Profile: Add your baby's information (name, DOB, contact info)
- Connect Device: Scan and connect to the BLE sensor board
- Configure Settings: Set upload interval and data retention period
- Monitor: View real-time temperature and acceleration data
- View Charts: Check temperature trends over time
- Receive Alerts: Get notified for fever or fall detection
- Registration: Sign up with professional credentials
- Admin Approval: Wait for admin to approve your account
- Search Patients: Find babies by name, email, or phone
- View Data: Access temperature charts and historical data
- Add Notes: Create, edit, and share medical notes with parents
- Approve Doctors: Review and approve doctor registration requests
- Manage Users: Oversee user accounts and access
- Upload Period: Configure how often temperature data is uploaded to cloud (default: 1 second)
- Data Retention: Set how long to keep temperature records (default: 30 seconds)
- These can be adjusted in the app's settings interface
- Fever Threshold: 38Β°C (configurable in
DataProcessService.java) - Fall Detection: Acceleration magnitude threshold (default: 70, configurable)
ChildHealthCareProject/
βββ app/
β βββ build.gradle.kts # App-level build configuration
β βββ google-services.json # Firebase configuration
β βββ src/main/
β βββ AndroidManifest.xml
β βββ java/com/example/childhealthcareproject/
β β βββ BLEDataService.java # BLE communication service
β β βββ DataProcessService.java # Data processing & cloud sync
β β βββ ParentActivity.java # Parent user interface
β β βββ DoctorActivity.java # Doctor user interface
β β βββ LoginActivity.java # Authentication
β β βββ RegisterActivity.java # User registration
β β βββ [Other activity classes]
β βββ res/ # Resources (layouts, drawables, etc.)
βββ build.gradle.kts # Project-level build configuration
βββ settings.gradle.kts # Project settings
βββ gradle/ # Gradle wrapper files
- All user authentication is handled through Firebase Authentication
- Firestore security rules should be configured to enforce role-based access
- BLE communication uses standard GATT security
- Sensitive data is stored securely in Firebase Firestore
The project includes basic test structure:
- Unit tests:
app/src/test/java/ - Instrumented tests:
app/src/androidTest/java/
To run tests:
./gradlew test # Unit tests
./gradlew connectedAndroidTest # Instrumented testsfloat totalMag = Math.sqrt(acc[0]Β² + acc[1]Β² + acc[2]Β²);
if (totalMag >= threshold) {
// Trigger fall notification
}- Collects temperature readings over a configurable period
- Calculates mean temperature for the period
- Uploads aggregated data to reduce cloud storage usage
- Automatically queries and deletes records older than retention period
- Uses Firestore batch operations for efficient deletion
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is part of academic coursework. Please refer to the license file for details.
- Priyavrat Dev Sharma - Initial work - GitHub
- Han Cat Nguyen - Co-developer
- McGill University, Department of Electrical and Computer Engineering
- Firebase team for excellent documentation and services
- Silicon Labs for EFR32BG22 development board support
- Project Report - Detailed technical documentation
- Firebase Documentation
- Android BLE Guide
- Repository: https://github.com/priyavrat7/Health-Monitoring-System
- Issues: Report a bug or request a feature
Note: This application is designed for educational and research purposes. For medical use, ensure compliance with healthcare regulations and consult with healthcare professionals.