Autobonics logo
    / Projects /  Hardware & Software

    Apnea Aware: Sleep Monitoring System

    Departments:
    ECE,
    CS,
    EEE,
    IT
    Level:
    Apnea Aware: Sleep Monitoring System
    Apnea Aware: Sleep Monitoring System
    Apnea Aware: Sleep Monitoring System
    Apnea Aware: Sleep Monitoring System
    Project Apnea Aware: Sleep Monitoring System
    Project Apnea Aware: Sleep Monitoring System
    Project Apnea Aware: Sleep Monitoring System
    Project Apnea Aware: Sleep Monitoring System
    Project date: 3/9/2024

    Apnea Aware: Sleep Monitoring System is a cost-effective solution using machine learning to detect and assess Obstructive Sleep Apnea through SpO2, heart rate, and accelerometer data, providing critical information to both patients and doctors via a web interface.

    Topics:
    Topic iotTopic mcTopic sensorsTopic 3dTopic aiTopic website
    Technologies used:
    Technology flutterTechnology espTechnology fusnTechnology frbsTechnology numpyTechnology scikit
    Project by:
    Soorya S Pai
    SEREEN SABU
    Liya
    About this project
    Abstract

    Sleep apnea remains a prevalent and serious disorder that significantly impacts patients' health and quality of life. This report presents the design and implementation of the "Apnea Aware: Sleep Monitoring System," which aims to provide a cost-effective solution for monitoring and detecting obstructive sleep apnea (OSA). By integrating a machine learning (ML) algorithm and developing a web interface for both patients and doctors, this project seeks to facilitate early detection and timely intervention. The system primarily focuses on analyzing data from key physiological parameters such as SpO2 levels, heart rate, and accelerometer readings. This innovative solution is designed to improve health outcomes for individuals suffering from sleep apnea.

    Introduction

    Sleep apnea is characterized by repeated interruptions in breathing during sleep, lasting at least 10 seconds. With its three main forms—Obstructive Sleep Apnea (OSA), Central Sleep Apnea (CSA), and Complex Sleep Apnea—OSA is the most common and troubling, primarily due to airway obstruction caused by relaxation of throat muscles. The disorder poses substantial health risks, including cardiovascular issues, stroke, anxiety, and depression, thereby emphasizing the necessity for early diagnosis and intervention.

    Risk factors contributing to the development of sleep apnea include obesity, heavy alcohol consumption, and smoking habits. Considering these substantial health implications, the purpose of this project is to establish a user-friendly, cost-effective sleep monitoring system that leverages the latest advancements in technology, including machine learning.

    Objectives

    The goal of the "Apnea Aware: Sleep Monitoring System" project is to create an efficient solution to monitor sleep apnea, particularly OSA. Our specific objectives include:

    1. Develop a hardware platform that captures vital physiological data (e.g., heart rate, SpO2, accelerometer readings).
    2. Construct an ML model using the Random Forest algorithm capable of predicting the severity of sleep apnea by calculating the Apnea-Hypopnea Index (AHI).
    3. Create an intuitive web interface for patients to visualize their data and for doctors to access patient reports easily.
    4. Promote accessibility and affordability of sleep monitoring solutions for patients and healthcare providers, potentially reducing the long-term health burden.
    Features of the Project
    • Hardware Design & Assembly (Fusion360): The design of the hardware platform enables efficient monitoring of patients’ vital signs during sleep.
    • Backend System for Storage and Retrieval (Firebase): Implementation of a robust backend for secure data storage that allows seamless retrieval of patient information.
    • Patient Web Interface Development (Flutter): A user-friendly web platform where patients can view their health data, including the results of their sleep monitoring.
    • Doctor Web Interface Development (Flutter) - Video Calling Feature: A separate access point for doctors that supports remote consultations and reviews patient data.
    • Sleep Monitoring Hardware Device: Comprising the ESP32 microcontroller and various sensors (mic, heart rate, SpO2, accelerometer), this device captures necessary physiological readings.
    • ML Algorithm Development for Sleep Apnea Detection: The integration of machine learning to enhance detection capabilities through the analysis of the collected data.
    • Data Collection and Processing: Thorough procedures to ensure accurate data capture and preprocessing before being input into the machine learning model.
    • AHI Index Calculation & Severity Categorization Feature: The system calculates the AHI Index to categorize the severity of sleep apnea into mild, moderate, or severe.
    • Final Conclusion Features: The application generates a detailed report summarizing the severity level based on the AHI results, enhancing the prediction interval heuristically.
    Final Outputs

    The project culminates in several deliverables, including a hardware prototype, mobile and web applications, comprehensive source code, and a detailed circuit diagram. These deliverables ensure that users receive a well-rounded product with sufficient support for implementation and usability.

    Components Used

    The following components were utilized in the development of the Apnea Aware system:

    ImageComponent NameQuantityPrice (₹)
    LILYGO T-Display ESP32LILYGO T-Display ESP32 WiFi Bluetooth Development Board11590
    MPU6050 AccelerometerMPU6050 Accelerometer & Gyro Sensor1113
    MAX30100 Pulse OximeterMAX30100 Pulse Oximeter Heart Rate Sensor Module1115
    INMP441 MEMS MicrophoneINMP441 MEMS High Precision Omnidirectional Microphone Module I2S1215
    Rechargeable LiPo Battery950 mAh 3.7V single cell Rechargeable LiPo Battery1350
    OLED Display Module0.96 Inch I2C/IIC 4pin OLED Display Module BLUE1170
    4mm SPDT Slide Switch4mm SPDT 1P2T Slide Switch15
    FDM 3D Printing ServiceFDM 3D Printing Service250 gm5
    Innovativeness/Social Relevance/Real World Application

    The Apnea Aware system is designed with social relevance in mind, addressing a widespread health issue impacting millions globally. Traditional diagnostics for sleep apnea often require extensive setups and may be inaccessible to many patients due to costs and logistics. By creating an integrated sleep monitoring system that is both cost-effective and easy to use, we empower patients and healthcare providers alike.

    The usage of the Random Forest algorithm enhances the accuracy of sleep apnea detection, which can ultimately lead to timely diagnostics and improved sleep health outcomes. The inclusion of web interfaces for both patients and doctors facilitates improved communication, allowing for remote consultations and making healthcare more accessible.

    In the broader context, such innovations may also pave the way for a more extensive array of wearable health technologies, bridging gaps in real-time health monitoring and patient care.

    Conclusion

    The "Apnea Aware: Sleep Monitoring System" exemplifies how technology can be harnessed to tackle critical health issues like sleep apnea through innovative, user-friendly solutions. Our project’s multidisciplinary approach integrates advanced machine learning techniques with robust hardware and software development to address the challenges posed by sleep disorders. By focusing on accessibility and affordability, we aim to make a meaningful impact on the lives of individuals suffering from sleep apnea, ultimately contributing to enhanced healthcare outcomes and improved awareness of sleep-related health issues. Through ongoing enhancements and potential integration with other health monitoring technologies, the project aspires to remain at the forefront of innovation in sleep health.

    Apnea Aware: Sleep Monitoring System Project Report

    Project Overview

    Sleep apnea is a serious disorder that leads to interrupted breathing during sleep, affecting individuals significantly. The Apnea Aware: Sleep Monitoring System aims to develop a cost-effective solution focusing primarily on Obstructive Sleep Apnea (OSA) detection using a combination of Machine Learning algorithms and advanced sensory hardware. This document provides a comprehensive overview of the development phases of the project, detailing each step taken to create a reliable and efficient sleep monitoring solution.


    Development Phases
    Phase 1: System Design and Initial Setup

    The initial phase focused on identifying the necessary components and designing the fundamental architecture of the system. The components include:

    • MPU6050 Accelerometer & Gyro Sensor
    • MAX30100 Pulse Oximeter Heart Rate Sensor Module
    • INMP441 MEMS High Precision Omnidirectional Microphone Module
    • ESP32 Development Board
    • 950 mAh 3.7V Single-cell Rechargeable LiPo Battery

    3D Design of Hardware Components

    A crucial step in the project was to create a 3D design of the hardware system using Fusion 360, which included integrating sensors for effective monitoring of different parameters.

    3D design of hardware components


    Phase 2: Circuit Diagram and Component Integration

    As part of the design process, the team successfully developed a circuit diagram that connects all the components for accurate data collection.

    Circuit diagram of the project

    The circuit integrates the sensors, which are pivotal in gathering critical physiological data, including SpO2 levels, heart rate, and movement during sleep.


    Phase 3: Hardware Updates and Power Management

    During the hardware updates, the team made significant enhancements, particularly in the power management aspect, optimizing energy usage.

    Power management update

    These improvements are crucial for maintaining the functionality of the sleep monitoring system while ensuring efficient performance over long periods.


    Phase 5: Integration and Testing

    Following the successful development of the ML model, the project transitioned into the integration phase, where hardware and software components were combined to create a unified system.

    The integration process involved:

    • Connecting sensors to the ESP32 microcontroller.
    • Setting up a Flask server to deploy the predictive model for real-time predictions.

    Integration process


    Phase 6: Web Interface Development

    To facilitate both patients and doctors in monitoring progress, a web interface was developed using Flutter, providing an intuitive platform for accessing sleep data and healthcare checks.

    Web Interface Features:
    • Real-time display of heart rate and SpO2 graphs.
    • Interactive movement graphs utilizing gyro data.

    Heart rate graph integration

    The patient interface allows for seamless navigation and easy interpretation of monitoring data, ensuring users can track their health comprehensively.


    Phase 7: API Development and Real-time Data Retrieval

    In this phase, a real-time prediction API was developed, enabling the system to display predictions based on incoming sensor data, enhancing user engagement with immediate feedback.

    API development

    Key characteristics of the API include:

    • Continuous data stream processing for accurate health monitoring.
    • Seamless integration of various sensor inputs to predict sleep apnea events.

    Phase 8: User Communication Enhancement

    Recognizing the importance of communication in healthcare, the team implemented a video calling feature, enabling real-time consultations between patients and doctors.

    Video call feature

    This enhancement provides a platform for:

    • Remote consultations.
    • Quick feedback on sleep patterns and necessary adjustments to treatment plans.

    Phase 9: Final Testing and Deployment

    In the final phase, comprehensive testing was conducted to ensure system reliability and accuracy in detecting and categorizing sleep apnea events.

    This included:

    • Evaluating the integration of software and hardware.
    • Conducting tests to ensure the accuracy of predictions and data retrieval mechanisms.

    Upon successful testing, the project transitioned to deployment.

    Final testing

    Platform for patient access is hosted at Apnea Aware.


    Conclusion

    The Apnea Aware: Sleep Monitoring System represents a significant advancement in sleep apnea diagnosis and management. Through a structured development methodology, from initial design to final deployment, the integration of cutting-edge technology ensures accurate monitoring, predictive analytics, and improved communication between patients and healthcare providers. This project not only aims to enhance the understanding of sleep disorders but also strives for feasible solutions by utilizing affordable technology combined with innovative software solutions.

    Ongoing enhancements and user feedback will continue shaping the platform, ensuring a valuable tool accessible to individuals managing sleep apnea effectively. Stay tuned for more updates as we progress further in enhancing functionalities to support efficient sleep monitoring and management.