According to the National Sleep Foundation, more than 18 million American adults have obstructive sleep apnea (OSA). OSA occurs when the back muscles of the throat relax while sleeping, causing the airway to narrow, resulting in snoring. These muscles could also completely block the flow of air to the lungs. When the brain detects a lack of oxygenation, it sends an impulse to the muscles forcing them to restart the breathing process. While this is a normal process that often happens to healthy people, patients with OSA may repeat this process hundreds of times during the night without being aware of this problem.
Some symptoms of OSA are daytime drowsiness, headaches, and irritability. People with sleep apnea also tend to be overweight. This syndrome is more common among men than women. The most common treatment for sleep apnea is a method of pushing air through the airway called continuous positive airway pressure (CPAP). The main goal of this device is to provide constant positive pressure to the respiratory system in order to prevent muscles from obstructing the airway (Figure 1).
Constant airflow pressure can be obtained by the continuous monitoring of the system pressure in conjunction with the ventilator motor control speed regulation. The main goal is to control the output pressure and not the airflow.
Due to the nature of this syndrome, the CPAP must be placed near the patient during sleep. Therefore, it needs to be noise free and avoid toggling that might disturb the patient’s sleep.
The CPAP counts with a humidifier chamber that increases the amount of vapor in the air to avoid drying out the airways or skin in the case of leakage in the mask. The most common humidifier for this application is the heater-humidifier. The humidity level can be adjusted by the patient.
The user interface needs to be as simple as possible, yet provide the physician with accurate feedback. The device must be robust and able to be used for extended periods of time. As shown in Figure 1, the patient is required to wear a mask throughout the night. As this method is not ideal, the CPAP includes features that allow a patient to get used to this impediment.
For example, some CPAP devices include algorithms that decrease the air pressure during exhale and increase during inhale.
Algorithms can also be applied to allow the device to adjust functionality during different levels of sleep. Ramp pressure algorithms can also be programmed to help the patient fall asleep. The ventilator can also be switched off if the mask slips off during sleep, causing a loss in air pressure.
Figure 2 shows a block diagram for a CPAP based on a Kinetis K40 MCU. The K40 MCU includes full-speed USB 2.0 On-The-Go with device charge detect capability and a flexible low-power segment LCD controller with support for up to 320 segments. Devices start from 64 KB of flash in 64-pin QFN packages extending up to 512 KB in a 144-pin MAPBGA package with a rich suite of analog, communication, timing, and control peripherals.
The K40 USB and segment LCD MCUs are Freescale Energy-Efficient Solutions. The K40 includes a flex timer designed to generate PWM signals for BLDC motor control in addition to other peripherals, such as timers, ADC, and PDC used for the phase and voltage readings for a sensorless motor.
The K40 offers a segment LCD controller and touch sensing interface peripherals.
The Kinetis K40 MCU is based on the ARM Cortex-M4 core with DSP capabilities that facilitate pressure control algorithms and a digital filter for pressure sensing.
The system uses the MPXV7002 pressure sensor. This device is inside the 2 kPA range, which is an appropriate pressure for a respiratory system. In addition to the MPXV7002, a differential pressure sensor can be added to the system to detect airflow, monitor breathing behavior, or detect mask displacement.
The humidifier chamber heater can be controlled through a GPIO with a 16-bit ADC channel measuring the temperature.
Freescale offers a variety of software and tools that help reduce development time. These include modular platforms such as Tower System development boards, CodeWarrior IDE, a real-time debug monitor, and data visualization tools such as FreeMASTER.
Luis Puebla is an applications engineer at Freescale, where, for the past seven years, he has primarily focused on the testing and development of tools and software for 32-bit microcontrollers.