Close
0%
0%

Open Source CPAP Machine

I'm developing a portable open source CPAP machine to address the current issues of affordability and access to these machines.

Public Chat
Similar projects worth following
Hello, my name is Christopher Dankocsik, and Im an electrical engineer.

CPAP machines are one of the most common ways of treating an obstructive airway condition called sleep apnea. This condition by current estimates affects 900 million people around the world. The consequences of lack of treatment range from cardiovascular issues to daytime tiredness and overall makes the quality of the patient's life worse.

My goal in this project is to:
1) Develop an open-source CPAP machine with both off the shelf hardware and software that anyone can use
2) Provide a convenient Opensource solution with the hopes of making a business out of it so I can make this wide-ranging and reach all the millions who don't have medical resources to access

PCBWay has be generous enough be a sponsor of this project and provide me with their services! With their help, prototyping is gonna be a hell of a lot easier for me!

Go Fund Me Page: https://gofund.me/4787c0bb

The goal is to make a fully open-source CPAP machine with both hardware and software fully available to users. This machine will have all the features a commercial unit has for a fraction of the price and will be able to be acquired by anyone. It's going to be battery-powered at the moment so I can bring it to school with me because I have sleep apnea as well and I want to have something I can use to take naps at school without getting the heart pains I usually get due to lack of oxygen.


  • Open Source CPAP Board V1

    cdankocsik02/26/2023 at 13:59 0 comments

    Hello Every One Ive recently been working on a Prototype board for my continuing my prototyping.  It currently features a 3 phase motor driver , pressure sensor and ESP32 for the logic. Since PCBway is nice enough to give me free prototyping for the board I decided to take this step as it would greatly help me progress in my prototyping. I have some basic test coding for just moving each phase individually and sensing the hall effect sensors for each phase though I don't have something continuously spinning yet :*( .  In the mean time with my test fixture using a pre-built driver I'm going to start working on a PID algorithm for controlling ramp functions and such. Its gonna be a couple month before all of this comes to fruition as I'm extremely pressed for time right now with school and my senior design project (Formula One FSAE) and graduating college as well. Once the summer Hits I can really get this baby going , so stay tuned! Please consider donating as well to my GO-FUND me page as all of this development is coming out of my own pocket :(.

  • Go Fund Me Page

    cdankocsik02/12/2023 at 05:46 0 comments

    I'm a poor college student so having donations would really be helpful to take this as far as I can!

    https://gofund.me/4787c0bb

  • Weekly Project Updates

    cdankocsik02/07/2023 at 17:23 0 comments

    Weekly Progress Updates:

    3/21/2023

    Been busy lately with Working on the Board squared away along with the PI controller for the ramp functions. School nowadays though keeps me really busy along with working more on the business side of things trying to win money through some Pitch competitions our school as for entrepreneurs.

    2/7/2023

    Hello everyone, just wanted to provide a quick update and show I'm still active on the project. School started back for me, so I've had less time to work on this as much as I want to. I'm currently working on a basic control algorithm for the CPAP for ramp functions and next for detecting blockages. 

    As for the BLDC motor driver, its still a little way off though I am to the point where I can start a prototype pcb as it would make slightly easier to work with. Still deciding if I'm ready for that yet as my current prototype while sound in the schematic design the hardware still is slightly misbehaving.

    2/21/2023


    Hey Everyone , Currently just trying to collect some data from my test setup, since I'm having to run around all the time because of college and my senior design project (Formula One FASE), and PCB way is willing to give me free boards, im just gonna go ahead and put my current prototype on a dev board just to make my life easier as I accidentally broke off one of the legs of my pressure sensors now I can't use it :( . So ill provide a schematic in the next week or so

    4/28/2023

    Hey Everyone, sorry for the lack of updates recently. Been really busy with school as I graduate this semester in two weeks so you could imagine how busy I am right now. As soon as I graduate and get a job, I'll continue to post to get this project done. I was gonna start keeping project logs on my you tube channel from now on for progress along with posting on here as well. Hang in there! 

    7/30/2023

    Hey everyone Lack of progress has been slow though its about to start ramping up again. I just got set up at my new job and got a schedule up and running again. Will be posting updates in the next week or so . So stay tuned!

  • CPAP Control Algorithm

    cdankocsik01/07/2023 at 17:59 0 comments

    While I'm developing my own Brush-less DC motor driver board, I decided to additionally go out and purchase an existing motor and driver board so I can begin working on a control algorithm for things like ramp time for pressure setting and auto-pressure adjusting when a blockage has been detected.

    I went and designed my own enclosed casing for the existing motor that I purchased from Ali express. This is by no means a final design, this is purely a test setup for developing the control algorithm while I'm developing my own driver board.

    I currently Have a 12V and 24V versions of the motors and driver boards, I plan on making 2 versions for (one for each) for the final design just to be flexible and give people options. These boards utilize a 0 to 5V signal for setting the speed of the motor, which it currently uses a potentiometer for at the moment. I plan on using an Analog pin from my esp32 ( Using a level shifter to get to 5v) for controlling the speed. Once I get my sensor working I want to make a basic PID algorithm to allow from ramp times for pressure setting then from there start working on the software for detecting blockages and such.


    Im currently running into some difficulties with the pressure sensor, I was trying out analog gauge pressure transducers at first though there so finicky and im not getting good results so I'm going to switch to a differential once in the next upcoming week so stay tuned for updates on that.

    24V Motor Driver Board
    Test setup for Control Algrothim testing
    CPAP motor bottom enclosure
    CPAP 12V Motor controller Board
    Custom Made 12 and 24V Lithium ION packs made from recycled 18650 cells
    CPAP Full Motor Enclosure

  • Brushless DC Motor Controller

    cdankocsik01/07/2023 at 17:07 0 comments

    One of the main functionalities of the CPAP machine will be to control a Brushless DC motor as they are able to generate high amounts of torque necessary to create the desired air pressures for the treatment. To address this I am making a motor driver board which will additionally be open source as well. I currently have the phase diagrams mapped out indicating the position of the shaft at a given position and a basic 3 Phase motor driver working as well. (Note this setup utilizes Hall effect sensors for indicating the shaft position and not back EMF, though in the future I plan on making one for that type of setup as well)


     Now all that's left is to synchronize the two so the motor can know when to activate the proper coils at the proper times and additionally allow our control algorithm once its developed to control the machine's air pressure.


    I'm currently utilizing the ESP32 for hardware control and utilizing the Project IO dev environment in visual studio code for doing all my software development. All the code is still completely usable in the Arduino IDE if that's your preference though the necessary libraries will need to be added.

    Phase Diagram
    Basic Layout of what Coil arragnment needs to be turned on at each appropate sensor readout. Will upload something more comprehensive once fully completed
    CPAP Motor
    3 Phase Motor Driver V1
    Havent added the comparators for the Hall effect sensors yet but will upload a photo when I get that done along with a schmeatic
    3 Phaes Motor driver Breadboard Prototyping
    CPAP Motor Insides

View all 5 project logs

Enjoy this project?

Share

Discussions

Florian Festi wrote 02/19/2023 at 08:40 point

OSCAR (Open Source CPAP Analysis Reporter) at https://www.sleepfiles.com/OSCAR/ is something to have a look at. It may be not that relevant right now. But in the long term you'd want your data to get in there. Writing your own GUI for presenting the data would be just a huge waste of time. May be you can use one of the supported data formats from the beginning.

  Are you sure? yes | no

cdankocsik wrote 02/26/2023 at 13:34 point

Hey, Thanks! I'll definitely check it out! And ya agreed Id rather not write my own GUI using formats standard to the industry would be ideal. I'm actually gonna be attending a seminar this week with some who has worked their whole career in the medical industry so im hoping to get some guidance on meeting medical regulations and potential ways to go about  this

  Are you sure? yes | no

Ed wrote 02/07/2023 at 22:47 point

I am an ex- medical devices engineer and have worked on breathing apparatus in the past. Just want to say best of luck and would happily field a couple of questions. ISO standards 18562 and 13485 are a good reference for benchmarks for this kind of project.

  Are you sure? yes | no

Isaac Wingfield wrote 02/03/2023 at 04:51 point

I once had an "electronic saxophone" that used a small plastic-diaphragm loudspeaker to measure breath pressure. Ran AC thought the voice coil and measured the change in impedance as the diaphragm got displaced; might have used a resonant circuit and measured the frequency -- not sure.

  Are you sure? yes | no

JP Gleyzes wrote 01/11/2023 at 13:50 point

Hi,

I made one during COVID lockdown. It's here fully open source : https://www.b4x.com/android/forum/threads/experimental-powered-air-purifying-respirator.116659/

It's using cheap components. I currently use it when breathing "toxic gas" or painitng...

  Are you sure? yes | no

Florian Festi wrote 01/09/2023 at 10:16 point

If you want this to be easy to build for people for themselves I would not focus on developing a custom board but to use as much off the shelf components as possible. Chances are slim that your own motor driver is better than a generic one. A CPAP machine is basically just a computer/micro controller with a fan, pressure and airflow sensor. May be just use a RaspberryPi/Arduino/ESP/... and plug in these 3 components into the GPIOs.

Even if you opt to do your own board later on this will get you going much faster and will allow you to work on the tricky part (the software).

  Are you sure? yes | no

cdankocsik wrote 01/09/2023 at 17:52 point

Hey Florian, Thanks for the reply I appreciate the criticism and you definitely share a lot of the same concerns that I do at the moment. While I want to make a custom open-source board, I do in the meantime just want to get something working with off-the-shelf parts so I can start testing and developing software. My original approach to this was inspired by seeing so many people having to hack their CPAP machines when if the damn thing was fully open source then they would have so much more control over their machines and their treatment as well.  I just found someone actually did a project exactly similar to mine using off-the-shelf components:

 Low-cost, easy-to-build noninvasive pressure support ventilator for under-resourced regions: open source hardware description, performance and feasibility testing | European Respiratory Society (ersjournals.com) 

I am going to start shifting gears though to just focusing on utilizing off-the-shelf components while I develop my other approach in the background. Currently now working on a test setup now using a ventilator bag so I can start doing some simulating and data collection. 

  Are you sure? yes | no

cos wrote 02/02/2023 at 00:02 point

Hey hows it going. software engineer here. I want to help with this. where are you at? are you tracking this on github or anything? 

  Are you sure? yes | no

Florian Festi wrote 02/19/2023 at 08:32 point

May be just ask politely if they can release their software under a proper Open Source license. As this is a university project they may be happy if it is still going to be used.

  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