Obstructive Sleep Apnea (OSA) is a common sleep disorder that often goes undiagnosed. It causes breathing to stop and restart repeatedly during sleep, which can increase long-term risks for heart and metabolic health. Polysomnography is the standard method for diagnosing OSA. However, it relies on lab equipment, overnight supervision, and trained technicians, making it expensive and mostly impractical for use at home. This work proposes an IoT-based system for preventing, detecting, and alerting about sleep apnea. The goal is to allow affordable, continuous monitoring at home. The design uses an ESP32 microcontroller connected to a MAX30102 pulse oximetry sensor, an INMP441 digital MEMS microphone, and an MPU6050 motion sensor. Together, these devices capture data on SpO? levels, heart rate, snoring, body posture, breathing movement, and respiratory rate. The system filters and normalizes these signals, converting them into Mel-Frequency Cepstral Coefficients (MFCC) and Short-Time Fourier Transform (STFT) features. This data goes to a hybrid CNN-BiLSTM-XGBoost model, which evaluates sleep quality and the severity of apnea, categorizing it as Normal, Mild, Moderate, or Severe. If a Severe episode is detected, the system uploads the information to Firebase Cloud, retrieves the patient\'s location from a NEO-6M GPS module, and sends an emergency SMS to registered caregivers via a SIM800L GSM module. It also gently wakes the patient using a micro speaker that plays a softly rising tone and activates a relay-controlled mini air pump for additional support.
A thematic review of related IoT, wearable technology, deep learning, contactless systems, and cloud-based monitoring supports the proposed design and explains the integrated sensing- to-response process. Since this paper discusses a proposed system instead of one that has been built and tested, it emphasizes design intent and expected functionality, rather than actual results.
Introduction
The text presents an IoT- and AI-based system for home monitoring, detection, and emergency response for Obstructive Sleep Apnea (OSA). Sleep apnea causes repeated interruptions in breathing during sleep, which can reduce blood oxygen and contribute to problems such as high blood pressure, heart disease, daytime fatigue, and reduced cognitive performance.
The current gold-standard diagnostic method, Polysomnography (PSG), is accurate but expensive, equipment-intensive, and generally limited to specialized sleep laboratories. Wearables, CPAP machines, manual observation, and contactless monitoring offer alternatives, but each has limitations related to accuracy, continuous use, cost, environmental interference, or lack of emergency response.
The proposed system aims to address these limitations by combining:
ESP32 as the main microcontroller.
MAX30102 for oxygen saturation (SpO?) and heart-rate monitoring.
INMP441 microphone for detecting snoring and breathing sounds.
MPU6050 for body position and movement.
AI models, including MFCC/STFT feature extraction, CNN, BiLSTM, and XGBoost, for sleep-quality assessment and apnea-severity classification.
Firebase Cloud for storing monitoring data.
GPS and GSM for location tracking and SMS emergency alerts.
A micro-speaker to gently wake the patient during severe events.
A mini air pump as a proposed supportive physical intervention.
The literature review groups existing research into six areas: IoT/cloud monitoring, wearable devices, AI/deep learning, contactless radar/Wi-Fi sensing, EEG-based sleep staging, and home/edge-based monitoring. Existing studies demonstrate useful advances in individual areas, but most systems do not integrate sensing, AI classification, cloud storage, location tracking, caregiver notification, and physical intervention into one platform.
Main research gap
The key gap identified is the absence of a low-cost, integrated, home-based system that can continuously monitor multiple physiological and behavioral signals, classify apnea severity, and automatically move from detection → cloud recording → location identification → caregiver alert → patient intervention.
Conclusion
This paper describes the design of an IoT-Based Sleep Apnea Prevention, Detection, and Emergency Alert System. It combines low-cost embedded sensing, AI-based severity classification, cloud synchronization, and an automated emergency response pathway into a single platform that can be used at home. The system uses the MAX30102, INMP441, and MPU6050 sensors, all connected to an ESP32 microcontroller. It routes severe event detections through Firebase Cloud, shares GPS locations, sends GSM SMS alerts, gently wakes users with a micro-speaker, and controls a mini air pump via a relay. This design addresses the gaps in AI-IoT integration and emergency response capabilities found in existing studies. Since this paper presents a proposed system rather than a tested one, it does not include figures for accuracy, precision, or performance. Future work will focus on integrating and calibrating hardware, collecting controlled data to train and evaluate the CNN-BiLSTM- XGBoost pipeline, measuring GPS/GSM response delays, and testing the usability of the Firebase-based dashboard for caregivers.
The proposed system could provide better access to ongoing, affordable sleep apnea monitoring. The design aims to ensure timely notifications for caregivers during severe events, subject to the validation mentioned above
References
[1] J. Jennifer, \"IoT Based Sleep Apnea Prevention and Detection,\" M.Tech Project Report, Sathyabama Institute of Science and Technology, Chennai, India, May 2023.
[2] A. Terawatpothong, H. Hotokezaka, N. Yoshida, and I. Sirisoontorn, \"Diagnostic Utility of Upper Airway Ultrasonography in Adults with Suspected Obstructive Sleep Apnea: A Systematic Review,\" MDPI, 2026.
[3] S. V. Sabarish and V. Vishnu, \"Obstructive Sleep Apnea Detection Using Machine Learning and GUI Techniques,\" Bachelor of Engineering Project Report, Sathyabama Institute of Science and Technology, Chennai, India, Apr. 2023.
[4] C.-C. Chang, A.-H. Hsiao, L.-H. Shen, K.-T. Feng, and C.-Y. Chen, \"Attention-based Learning for Sleep Apnea and Limb Movement Detection using Wi-Fi CSI Signals,\" arXiv preprint arXiv:2304.06474, 2023.
[5] S. A. Sumona and W. B. N. Aurthy, \"A Novel Low-Cost Monitoring System for Sleep Apnea Patients,\" in Proc. International Conference on Electrical, Computer and Communication Engineering (ECCE), 2023.
[6] P. Fonseca et al., \"Estimating the Severity of Obstructive Sleep Apnea Using ECG, Respiratory Effort and Neural Networks,\" IEEE Journal of Biomedical and Health Informatics, vol. 28, no. 7, pp. 3895–3906, Jul. 2024.
[7] S. Tsumoto et al., \"Automatic Sleep Stage Classification for Sleep Apnea Patients Using an In-Home Sleep Electroencephalography Device,\" in Proc. IEEE International Conference on Big Data, 2024.
[8] R. Duan and H. Jin, \"A Sleep Apnea Detection Method Based on Tiny Machine Learning,\" 2024.
[9] S. Dong, B. Wang, C. Gu, and Y. Guo, \"Accurate Noncontact Sleep Apnea- Hypopnea Detection Using a K-band Biomedical Radar,\" 2024.
[10] M. Olsen et al., \"A Deep Transfer Learning Approach for Sleep Stage Classification and Sleep Apnea Detection Using Wrist-Worn Consumer Sleep Technologies,\" IEEE Transactions on Biomedical Engineering, vol. 71, no. 8, pp. 2506–2518, Aug. 2024.
[11] \"Automatic Monitoring of Obstructive Sleep Apnea Based on Multi-modal Signals by Phone and Smartwatch,\" 2024.
[12] A. Abd-alrazaq et al., \"Detection of Sleep Apnea Using Wearable AI: Systematic Review and Meta-Analysis,\" Journal of Medical Internet Research, vol. 26, e58187, 2024.
[13] A. Aniyan, L. Sam, S. Sabu, and S. S. Pai, \"Apnea Aware: An Intelligent Sleep Monitoring and Intervention System for Obstructive Sleep Apnea,\" 2024.
[14] X. Gao et al., \"Single-Channel EEG Algorithm for OSA Screening via Sleep Staging and Respiratory Event Detection,\" in Proc. IEEE Biomedical Circuits and Systems Conference (BioCAS), 2025.
[15] D. Luszczynski et al., \"Sleep Apnea Detection on a Wireless Multimodal Wearable Device Without Oxygen Flow Using a Mamba-based Deep Learning Approach,\" arXiv preprint arXiv:2512.00989, 2025.
[16] S. Aftab et al., \"Respiratory Asynchrony and Airway Narrowing in Asthma and Sleep Apnea: A Modeling Approach,\" 2025.
[17] A. Aqueel, O. Farooq, and Y. U. Khan, \"Sleep Apnea Event Detection Using EEG Band Entropy Features and Machine Learning,\" 2025.
[18] H. T. Yen, V.-P. Hoang, Q.-K. Trinh, V. S. Doan, and G. Sun, \"Sleep Apnea Patient Monitoring Using Continuous-wave Radar,\" 2025.
[19] P. Adlino, P. Jadhav, P. Pawar, and A. Prayag, \"Integration of AI and IoT Technologies for Non-Invasive Sleep Apnea Detection and Monitoring,\" International Journal of Research and Scientific Innovation (IJRSI), vol. XII, no. XI, pp. 1765–1767, Nov. 2025.
[20] P. Nipattanon and C.-W. Lin, \"Event-based Detection of Obstructive Sleep Apnea via YOLOv8 Nano and ECG Spectrograms: Integration with Home Sleep Apnea Test and Edge Computing,\" in Proc. IEEE, 2025.