Close
0%
0%

Digital Manometer/CPAP Machine Monitor

Ever wake up in the morning found your CPAP mask is off? This device will alarm you if you have unintentionally removed mask during sleep.

Public Chat
Similar projects worth following
CPAP (Continuous Positive Airway Pressure) therapy is the most common form of treatment for Obstructive Sleep Apnea (OSA). It is important to wear the CPAP mask all the time while sleep in order for the therapy to effective, and also to meet the CPAP compliance criteria required by the insurance companies.
However many people have issues while adjusting to sleeping with a CPAP mask, including the problem of waking up consistently to find their CPAP mask off.
This project is about making digital manometer to monitor the air pressure inside the CPAP piping. It will display the real time air pressure inside the CPAP piping, and device will give out an audible alarm when the CPAP mask in likely off or there presents large air leak during the therapy.

A manometer is a device to measure pressures. In the normal condition during the CPAP therapy, there is a significant change in the air pressure inside the CPAP piping due to breathing as patient inhale and exhale the air. If there is a large air leak or the mask is off, the air pressure fluctuation in the piping will become much smaller. So essentially we can check the mask status by constantly monitoring the air pressure inside the CPAP piping with a manometer.

Digital Manometer

In this project MPXV7002DP Integrated Silicon Pressure Sensor is used as a transducer to convert the air pressure to digital signals. The MPXV7002DP breakout board is widely available as a pressure differential sensor to measure the airspeed of RC models and is relatively cheap. This is the same technology inside commercial CPAP machines.

MPXV7002DP is a monolithic silicon pressure sensor designed for a wide range of applications. It has a measuring range of air pressure from -2 kPa to 2 kPa (approximately +/- 20.4 cmH2O), which covers nicely the typical pressure levels for treating Obstructive Sleep Apnea range from 6 to 15 cmH2O.

MPXV7002DP is designed as a differential pressure sensor and have two ports (P1 & P2). In this project, MPXV7002DP is used as a gauge pressure sensor by leaving the backside port (P2) open to the ambient air. This way pressure is measured relative to the ambient atmospheric pressure.

MPXV7002DP will output an analog voltage from 0-5V. This voltage is read by the Arduino analog pin and covert to corresponding air pressure using the transfer function provided by the manufacturer. The pressure is measured in kPa, 1Pa = 0.10197162129779 mmH2O. The results then are displayed on the LCD screen in both Pa (Pascal) and cmH2O.

CPAP Machine Monitor

Study shows breathing movements are symmetrical and did not change significantly with increasing age. The average respiratory rate is 14 during quiet breathing for both sexes. The rhythm (inspiration/expiration ratio) is 1:1.21 for men and 1:1.14 for women during quiet breathing.

The raw data of air pressure measurements from the CPAP piping goes up and down as people breath and also has many 'spikes' since Arduino 5.0V supply is quite noisy. Therefore the data needs to be smoothed out and evaluated over time in order to reliably detect the pressure changes introduced by inhalation and exhalation.

Several measures are taken by the Arduino sketch to process the data and monitor the air pressure. In a nutshell, the Arduino sketch uses the running average library by Rob Tillaart to first calculate the moving average of the air pressure measurements in real-time to smooth out the data points, then calculate the minimum and maximum observed air pressure every a few seconds to determine whether the mask has been disconnected by checking the differences between the peak and trough levels of air pressure. So if the incoming data line becomes flat, then it is likely that there's a large air leak or the mask has been disconnected, an audible alarm will sound to wake up the patient to make necessary adjustments. See the data plots for the visualization of this algorithm.

cpap sensor v2.3.stl

Digital Manometer Case Sensor body

Standard Tesselated Geometry - 1.20 MB - 07/22/2019 at 15:03

Download

cpap box back v3.stl

Digital Manometer Case Back plate

Standard Tesselated Geometry - 1.42 MB - 07/22/2019 at 15:03

Download

cpap box v2.stl

Digital Manometer Case

Standard Tesselated Geometry - 560.04 kB - 07/22/2019 at 15:03

Download

CPAP_Monitor_Demo.ino

Arduino Sketch

ino - 6.52 kB - 07/22/2019 at 15:01

Download

  • 1 × MPXV7002DP breakout board
  • 1 × Arduino Nano V3.0 with I/O expansion board
  • 1 × Serial LCD 1602 16x2 module with IIC/I2C adapter blue or green
  • 1 × 12x12x7.3mm Momentary Tactile Push Button Switch with a keycap
  • 1 × DC 5V Active Sound Buzzer

View all 8 components

  • 1
    Parts and Schematics

    All the parts are available from Amazon.com and the BOM are provided above.

    Additionally, the sensor body and the case which consists of device box and back panel need to be 3D printed using the STL files below. The sensor body should be printed in vertical position with support to for best results.

  • 2
    Build and Initial Testing

    First prepare all the parts for final assembly. Solder the pins to the Nano board if needed then install the Nano board to the I/O expansion board. Then, attach or solder the jumper wires to the button switch and the buzzer. I used some leftover servo connectors instead of jumper wires. For MPXV7002DP, you can either use the wire that comes with the breakout board without soldering or solder the wire to the breakout board as shown in the picture. Also, cut about 30 mm silicon rubber tubing and attach it to the topside port (P1) on the MPXV7002DP.

    Once the parts are prepared, the final assembly is very simple due to the use of the I/O expansion board and the serial I2C LCD.

    Step 1: Install the MPXV7002DP breakout board to the 3D printed sensor body. Inert the open end of the silicon tubing to the measurement hole then secure the board with 2 small screws. Connect the sensor to the S pin at port A0 on the expansion board.

    • Analog --> A0
    • VCC --> V
    • GND -- > G

    Step 2: Connect the LCD to the Nano expansion board S pins at port A4 and A5

    • SDL -->A4
    • SCA -->A5
    • VCC --> V
    • GND --> G

      Step 3: Connect the Buzzer and Switch to the expansion board port D5 and D6

      • Switch: to port 5 between S and G
      • Buzzer: to port 6, the positive to S and the ground to G

      Step 4: Final assembly

      Secure the sensor body to the back plate with 4 M3 screws, then install the LCD screen and the Nano expansion board and secure them with small screws. Push the button switch and the buzzer into the case and secure them with hot glue.

      Step 5: Programming

        1. Add the libraries to your Arduino IDE. The libraries can be found at: LiquidCrystal-I2Cand RunningAverage.
        2. Connect your Arduino to the computer and install the Arduino sketch.

        That's it. Now power the unit up with either USB or apply 9-12V power to the DC port on the expansion board (recommended). If the LCD display back-light is on but the scree is blank or the letters are hard to read, adjust the screen contrast by turning the blue potentiometer on the back of the LCD I2C module.

        Finally attach the the back plate to the front case with 4 M3 screws.

      1. 3
        Simple Manometer Test Set Up

        I was curious about the accuracy of this digital manometer and built a simple test stand to compare the meter readout to a classic water manometer. With an electric air pump controlled by a motor speed controller, I was able to generate variable air pressure and took the measurements simultaneously by both digital and water manometers connected in series. The pressure measurements are pretty close at various.air pressure levels.

      View all 4 instructions

      Enjoy this project?

      Share

      Discussions

      Michael wrote 03/04/2020 at 07:37 point

      I've put all the things together here, but am still debugging  a few parts that are not working.  Really looking forward to having this around!  Thank you.

        Are you sure? yes | no

      Similar Projects

      Does this project spark your interest?

      Become a member to follow this project and never miss any updates