1 Introduction

Characterizing upper airway obstruction during normal sleep could give us an important data about the types of the disease related to breathing and sleep disorders. Observing the features of the upper airway dynamics is an important step at the treatment planning. Because, the knowledge of mutual patterns of the upper airway dynamics of respiratory events may lead to a new diagnostic method for patient-specific treatment planning [1, 2].

Sleep apnea (SA) is characterized by recurrent upper airway obstruction during sleep associated with arterial blood desaturation, sympathetic nervous system activation, and cardiovascular impairment. Untreated patients with SA have increased mortality rates compared to the general population [3]. SA, characterized by repetitive breathing stops during sleep, is highly common, and it is a difficult disease to detect [4]. Sleep apnea is known to be a respiratory disease and approximately affecting 10% of the adult population [5]. Sleep-disordered breathing in elderly population is more prevalent, and it involves a longer event than young and middle-aged groups [6]. It can also be seen with other diseases like epilepsy [7], obesity [8], and venous thromboembolism (VTE) [9] and trigger them. So, the people suffering from SA cannot feel the benefits of a restful sleep due to effects caused by a collapse (total or partial) of the upper airways of the respiratory system [10].

The importance and the need for respirators and ventilators have shown once again itself due to the new coronavirus (Covid-19) pandemic, which has recently spread around the world and has been declared as a Global Pandemic (worldwide epidemic) by the WHO (World Health Organization.)

Although it is not known exactly how the coronavirus may react in which person, some people are at greater risk with the coronavirus and they are more affected by Covid-19. Although SA is not associated with the risk of contracting Covid-19, it is a severe risk factor for Covid-19. In contrast, among Covid-19 positive patients, SA is associated with higher risk for hospitalization [11].

The relationship between SA and the risk of Covid-19 infection and the need for hospitalization and respiratory failure has revealed that patients with Apnea have an eightfold higher risk. Accordingly, among patients with Covid-19 infection, it has also been reported that SA nearly doubles the risk of hospitalization and respiratory failure [12].

It was also concluded that sleep apnea increases the risk of Covid-19 and may contribute to poor outcomes by worsening or causing lung damage. Therefore, there is a significant relationship between SA and death from Covid-19 [13].

SA is an additional risk for serious disease development in patients with Covid-19, and patients with SA have been observed to have an increased risk of developing adult respiratory distress syndrome following non-cardiac surgery [14].

It is known that the intensity of using polysomnography (PSG) in sleep laboratories for the diagnosis of SA before the Covid-19 pandemic has decreased significantly compared to its use during the pandemic. In addition, staff levels in sleep medicine services decreased significantly compared to pre-pandemic staff levels, and a significant increase in telemedicine services was observed. In light of the Covid-19 pandemic, it became obvious that there is a need to revise existing technologies for SA and use new and different medical monitoring devices [15].

During the Covid-19 outbreak, non-emergency sleep laboratory services are delayed in many settings due to the limited availability of the healthcare resources. Therefore, it has become imperative to consider telemedicine as a potentially effective alternative for early detection and intervention and to prevent emergencies in inadequate SA monitoring and treatment during the current pandemic [16]. The use of telematic techniques is useful for establishing a diagnostic and therapeutic strategy for SA [17]. There are a number of papers published in the literature about Electronic Health Records (EHR) systems such as Al-Zubaidie [18], Rivero-García[19], and Dubovitskaya[20]. The common point of these publications is the suggestion to find a solution to preventing legitimate users from exceeding their privileges as well as preventing attackers from accessing patient data in the EHR system. It is also stated in these publications that the actions to be taken to protect personal health data have disadvantages such as delays and extra costs in the system. In this study, the focus is on the electronic circuit and system design rather than data security, since the cost-efficient system design and emergency intervention may be required especially in case of apnea and death risk.

Telemedicine can play a vital role in the monitoring and treatment of SA and similar diseases. It is obvious that some precautions should be taken for what should be seen in sleep clinics. This is a risky and troublesome situation. Therefore, new procedures and new remote monitoring medical devices are required to monitor such patients [21, 22].

Apnea was defined as an absence of airflow for > 10 s. There are three types of SA; obstructive sleep apnea (OSA), central sleep apnea (CSA), and mixed sleep apnea (MSA). OSA is defined as the absence of nasal airflow for > 10 s associated with inspiratory effort. CSA is defined as with > 50% of the event labeled as the central type rather than the obstructive type. MSA is a combination of the previous two types of apnea [23]. Anatomically based treatments are not a complete solution for apnea.

The current gold standard assessment for screening SA is PSG. PSG shows frequent isolated apnea that occurs in non-rapid eye movement sleep. PSG requires an overnight stay in a sleep laboratory where the patients are equipped more than 18 sensors. The complex nature of PSG, its high cost, requires expert knowledge and limited facilities to run PSG which have resulted in long waiting list [24]. Therefore, there are many studies about a novel solution to sleep apnea detection in the literature [25,26,27,28]. However, in 2017, the AASM (American Academy of Sleep Medicine) published and approved a guide on the use of home sleep apnea tests compared to sleep laboratory-based PSG and concluded that although available literature was still insufficient to propose home testing for the diagnosis of SA, further research in this area should be encouraged [29]. The following statements were used for home sleep apnea test (HSAT); “If an appropriate HSAT device could be shown to be a suitable alternative to PSG, it could potentially circumvent many of these barriers and improve the quality and efficiency of care for pediatric patients with SA.”

There are numerous vital studies for monitoring patients at home, and these studies are used by people with different needs, such as elderly or disabled people, and/or with chronic diseases, among other such as in [30,31,32,33].

As reported earlier, in other studies, an intelligent self-adjusting pillow is proposed for apnea event detection [34], a sound monitoring system is proposed in order to detect an apnea event by using a smartphone [35], and a new telemedicine system for remote monitoring of CPAP therapy [36].

There have been several studies based on GSM to devise and monitor breathing activity during sleep. Iovanovici et al. [37] presented architecture for monitoring of sleep disorders. But the proposed solution is integrated via a set of web services into the server and is currently under the test phase, and it is not available for public use.

In the other study, a support vector classifier (SVC) was used to extract feature sets and detect apnea episodes from the patient’s single-channel night ECG. Android operating system (OS)-based universal mobile telecommunication system/mobile communication (GSM/UMTS) was preferred as the computing platform [38].

Al-Naji et al. [39] aim to detect the irregular breathing syndromes, including central apnea by tracking of thorax moves. The authors monitored patient status from different distances using an ultrasonic PING sensor and microcontroller. However, the patient’s sleeping position during sleep cannot be compatible with the sensor used. In addition, Gharghan et al. [40] developed a human vital signs monitoring system (HVSMS) that includes Global Positioning System (GPS), GSM, and acceleration sensors. But this study mostly focused on power consumption and battery life of the system, and the main purpose of the study was to minimize the power consumption.

Sara Balderas-Diaz et al. [41] developed a service-based system for diagnosis of patients with sleep apnea–hypopnea. The proposed system allows a greater outreach to the population and reducing waiting lists in hospitals. However, the proposed system needs to be experimented and evaluated with different users in order to analyze the benefits and address the potential improvements.

Our study focuses on a novel portable real-time low-cost sleep apnea monitoring system utilizing the GSM network in the Covid-19 era. The proposed system is a remote monitoring and telemedicine system to detect the apnea event in real time, and to provide information of the sleep position, pulse, respiratory and oxygen saturation to the medical specialists by establishing a direct contact. As soon as abnormal conditions are detected in the light of these parameters, the condition is reported (instant or in the form of short reports after sleep) to the patient relatives, the doctor’s mobile telephone or to the emergency medical centers (EMCs) through a GSM network to handle the case depending on the patient’s emergency condition. This study aims to design a remote monitoring system for sleep apnea to ensure patient safety and ease the workload of doctors in the Covid-19 era.

2 Material and Method

The accuracy of wearable real-time SA measurement system and detection algorithm based on the acceleration sensor was clinically tested in our previous study [42, 43]. The contributions of this study can be summarized as follows:

1. A novel portable real-time low-cost sleep apnea monitoring system was designed and implemented to telemonitor apnea patients in their home and detects the events of a patient with a large communication range using the GSM network.

2. Newly developed telemedicine system can detect the apnea events and send this information (momentary or in the form of short reports after sleep) to the patient relatives, the doctor’s mobile telephone or to the emergency medical centers (EMCs) through a GSM network.

3. The system has been strengthened with additional equipment such as air pressure sensor (MPX10DP), pulse (Heart Rate) sensor, blood oxygen saturation sensor (Max30100), and GSM (SIM900A chip). The system uses breathing data, respiratory-related movements, sleep positions, pulse information, and SpO2. The architecture of the proposed microcontroller based diagnostic system and electrical circuit are shown in Fig. 1 and Fig. 2, respectively.

Fig. 1
figure 1

Monitoring system architecture

Fig. 2
figure 2

Electrical circuit of system

Assessment of the validity of the proposed system for monitoring apnea events was performed on the study group between the ages of 20 and 60. The study group consists of six patients (three males (50%) and three females (50%)) with different characteristics ([mean] age, 36.3; height, 169.6 cm; and body weight, 81.4 kg). General characteristics of the study groups formed are explained in Ref [42]. The patients in the study group have sleep apnea in varying grades (mild OSA, middle OSA, and heavy OSA) and randomly selected from the hospital. The study adhered to the Declaration of Helsinki ethical principle. The protocol was approved by the ethics committee of Ondokuz Mayis University, and the patient informing form for all subjects was obtained after a full explanation of the research procedures before commencing the experiment.

3 Measurement Subsystem

All data measured by the sensors (acceleration, heart rate, breathing, and SpO2) are recorded on the SD card or can be transferred to the computer via USB. The circuit board of the measurement and monitoring system is shown in Fig. 3. The sensors are connected to the microcontroller by a wire.

Fig. 3
figure 3

Hardware of measurement and monitoring system

Respiratory air flow and volume data can be measured by the differential air pressure sensor (MPX10DP) which provides a linear voltage output and by using a nasal apparatus with headband. MPX10DP is less affected by temperature, small in size, cheaper than its counterparts and durable for long periods of duration. So, it has been used in many respiratory applications [44, 45].

MAX30100 (Maxim Integrated, USA) is an integrated pulse oximetry and heart-rate noninvasive measurement biosensor. This sensor consists of red and infrared led (red led with a wavelength of 660 nm and infrared led with 880 nm wavelength), an optical receiver and low-noise analog signal processing, as well as a built in 50 Hz filter. The heart rate is being measured when only infrared LED is on. In order to measure SpO2, both LEDs must be turned on.

According to the working principle of this sensor, the light sources and optical receiver are placed side by side, and signal measurements are calculated from reflected light intensity and compared the light absorption characteristics of blood under these wavelengths [46, 47].

MAX30100 sensor is attached on the forefinger clip, which can fit the thumb to allow easy and simple measurement. Patient’s forefinger will be put on the red and infrared LED which is located on the surface of the sensor.

The MAX30100 is configured by using inter-integrated circuit (I2C) protocol. This protocol can be set in many parameters (analog numerical cycle resolution, sampling rate, reporting time, and the red and infrared led current values) that regulate the operation of the sensor. The most suitable parameters for the sensor were calibrated according to the literature [48]. Figure 4 also shows the structure of the oxygen saturation and heart-rate detection.

Fig. 4
figure 4

Basic working principle of MAX30100 Sensor

The flow card of the system is shown in Fig. 5.

Fig. 5
figure 5

Flow card of the system

4 Recording and Alert Subsystem

Wearable real-time sleep apnea patient alerting system based on the acceleration sensor was experimentally tested as presented in our previous study [42]. The patients in that study group have sleep apnea (SA) in different grades. All the apnea events were detected, and all the patients were successfully alerted. In addition, the proposed system is able to detect the supine lying position, which is the most common apnea position in apnea patients. Furthermore, the proposed system aims to inform and interfere with different people over the GSM network when the patient cannot wake up.

5 Communication Subsystem

Today, with the rapid development of wireless communication technology, mobile phones have become usable in many systems around the world (health, fall tracking, military, medical, transportation, etc.) [49, 50]. Our wireless communication subsystem has a SIM900A chip, a SIM (Subscriber Identity Module) card and a dual band antenna (SMA antenna). It works on frequencies 900/1800 MHz with the service provider with the help of SIM card. The chip can search these two bands automatically. GSM shield enables an Arduino board to connect to the internet, make voice calls, or send and receive SMS using the GPRS wireless network. This shield is compatible with Arduino mega.

The commands are sent from the microcontroller using USART (Universal Synchronous Asynchronous Receiver Transmitter) serial communication [51]. GSM shield supports communication through RS232 with DB9 Connector, TTL Pins. Its operation temperature is between -40 °C and + 80 °C.

GSM shield must be fed externally (AC and DC solder points also available on board). In case the external source is not connected, the current drawn from the USB is insufficient when it finds a network from GSM shield. Another point to be considered here is that the SIM card to be inserted into GSM shield should not ask for a pin code. For this reason, when the SIM card is inserted in the phone, it is necessary to enter the SIM settings and not to ask for a password.

When the apnea event detected, an SMS will be sent automatically to the patient’s privative doctor or relatives to be informed about the patient’s condition. SMS consists of the respiratory data, pulse, SpO2, accelerations, lying position, recording information, and total apnea count.

If the patient is unable to get out of the apnea (despite the alert system) or if the apnea event reaches a serious condition, instead of SMS, it goes directly to call mode and thus offers the patient a chance to intervene immediately. The system can also call the emergency service and ask for help with a voice message recorded before.

Thus, thanks to this system, it is possible to record and monitor sleep during the night and provide the opportunity to intervene the patient in emergency situations.

6 Experimental Results

Figure 6 is a part of the real data from our sleep apnea monitoring system based on the GSM network device. It measures percentage of oxygen (SpO2), pulse rate (in heart beats per minute), accelerations on the diaphragm (on the XYZ axis), and nasal pressure (through a mask).

Fig. 6
figure 6

Monitoring of apnea episodes, SMS case, and normal–abnormal breathing

At the moment in time that no airflow and no respiratory effort for 10 s, oxygen levels are steady above 95% and the heart rate is at a restful 58 beats per minute (apneic event). The waveform data part above is (about 7 min view) from a person with obstructive sleep apnea (OSA). OSA occurs when the soft palate and tongue relax, collapsing the airflow for at least 10 s. The oxygen levels become erratic and decrease below 95%. The pulse rate can race above 80 beats per minute. When oxygen saturation levels drop, the heart responds by increasing the heart rate.

When Fig. 5 is carefully examined, it can be seen that following the apnea episode, the oxygen level rises in the next breath, the effort of breathing increases, the diaphragm movement occurs, and the heart rate slows.

As soon as apnea was detected (at least 10 s breathless), the system sends the first text message to the registered numbers (SMS1). The time allocated to send the message is set to 1 s (considering the possibility of delays due to GSM operators). When the patient remains breathless, a second text message is sent in the 10th second in progress (SMS2). If the patient still cannot wake up, however, the device will operate in call mode and will call the registered numbers to transmit the previously recorded voice message (CALL1).

In the graphic in Fig. 6, there is no information showing the call status since no patient was observed during the recording. However, this feature was tried during the test phase demo studies, and it was observed that it successfully runs.

Performance of real-time low-cost sleep apnea monitoring system based on the GSM network for the patients (H1, H2, H3, H4, H5, and H6) is given in Fig. 7 separately. The system, equipped with several peripheral units, can detect apnea events successfully for the all patients. This means that the system can monitor the apnea situation for any patients in real time. After being breathless for 10 s, the system sends the first SMS to the registered number. After the second 10 s, the second SMS is sent.

Fig. 7
figure 7figure 7figure 7

Apnea event detection and notification by SMS for the patients (a) H1, (b) H2, (c) H3, (d) H4, (e) H5, (f) H6

To test the CALL feature of the developed system, one healthy subject (26 years, male) was firstly asked to perform normal and abnormal respiration for a period of two minutes. Then, the subject wore peripherals belonging to the device (accelerometer over the abdominal region, air pressure sensor, pulse (heart rate) and blood oxygen saturation sensor, and GSM (SIM900A chip). The subject was lied in the supine position (because apnea is mostly in this position), and he was firstly asked to breathe normally for 15 s and then hold his breath for 15 s followed by slow breathing for 15 s. This performance was repeated 3 times. The breathing signal was recorded using developed device and analyzed. Figure 8 shows an example of SMS.

Fig. 8
figure 8

Apnea SMS data

After 10 s, the third SMS was sent, and instead of sending messages, the CALL feature was activated and called the registered number in the 40th second. Figure 9 shows the working graph of CALL procedure.

Fig. 9
figure 9

CALL event data

Thus, it is obvious that our proposed monitoring system could successfully and effectively detect the apnea events and could send an SMS when the breathing signal falls outside the normal range or when breathing stopped or became irregular.

As a result, in this study, many parameters about sleep apnea monitoring such as heart rate, beats per minute, apnea times, lying position data, the total number of apnea events and total sleep time in bed, acceleration data, and SpO2 were measured and recorded on an SD card successfully. All the apnea events were successfully detected, and all the patients’ relatives were successfully informed by calling or sending a SMS.

7 Discussion

This work proposes a sleep monitoring system based on the Global System for Mobile Communications (GSM) network containing an acceleration sensor as a reliable method of the sleep apnea screening. One of the most important contributions of this study is the ability to send instant SMS about the patient’s condition and to give voice notification by calling the previously registered people in situations that require urgent intervention. This property is essential not only to warn the elderly, disabled, or pediatric patients but also for the patients and their relatives. Also, this system gives an opportunity to remotely monitor the patients at their home and inform the doctors in case of an apnea event during the night. The proposed system provides a versatile, useful, practical, low-cost, and lifesaving solutions better than the most other existing methods for monitoring of sleep conditions.

8 Conclusions

Continuous monitoring of breathing activity plays a vital role in the detection of respiratory-based diseases (SA, COPD, etc.).

This study has presented the safe, portable, and highly accurate vital sign monitoring system which is designed to serve home-based monitoring of human vital signs that contain pulse oximetry (SpO2), differential air pressure sensor (MPX10DP), and heart rate signal measures by using MAX30100 sensor.

Our system is integrated with the GSM network to display vital sign monitoring result in real time, and auto-send notification in case of any abnormality is detected. Thus, based on the created algorithm, it was possible to receive information about the patient’s condition remotely either by SMS or by calling (CALL). Real-time monitoring of a patient allows the patient to intervene in extra cases.

In this study, during the tests performed on six patients, the onset of an apnea event was successfully detected, and the SMS/CALL feature was successfully activated without delay. While recording, it has been observed that some of the patients start breathing after the first SMS, whereas some others needed the second or the third SMS. According to the measurement result, the maximum breathless time is 46 s among the patients, and a SMS is sent every 15 s. In addition, in cases where the patient was breathless for a long time, the CALL feature was actively sought from the relatives of the patient and enabled him to intervene. Developed portable real-time low-cost sleep apnea monitoring system based on the GSM network is expected to get an important place in the biomedical device technology with the ability to alert the patients as well as provide instant information to healthcare workers and the patients’ relatives. Furthermore, the developed system is more economical, comfortable, and convenient than existing systems not only for the patients, but also for the doctors. The patients can easily use this device in their home environment. This study aims to design a remote monitoring system for sleep apnea to ensure patient safety and ease the workload of doctors in the Covid-19 era. It is believed that the hardware approach we propose could be a useful tool to study the population in their home.

As future work, the monitoring system will be extended with the incorporation of new services and biosensors (to view values in graphs). As a further study, developed system is planned to use at hospitals to eliminate the possible side effects encountered in practice.