# Simple BiPAP Controller: low-pressure + high-flow

At this point I can't remember if my intent was to actually build a ventilator, although at the time I seem to remember a relative lack of posts on StackExchange pertaining to ventilator design, despite it being all over the news.

I think my goal with this post was in some way to contribute to open-sourcing ventilators. It turns out I did not know how complex a ventilator was, and as a result I discovered my basic design was missing a few parts although the basic functioning of it could potentially conform to the guidelines for pressure controlled ventilation (PCV) however missing a few parts thus making it most accurately a BiPAP machine. At this point the details aren't really all that important (and they are all in the guidelines), since I don't think I will ever build this thing. So anyway, my idea; here are some doodles I hope they are self explanatory:

ascii art schematic of the Party-Balloon BiPAP:

     (close-circuit when balloon is full)
....switch..................
.    __\__                 .
.   /     \            ____._____
.  / party \          |Controller|
.  |balloon|           ----.-----
.  \       /               .
.   \     /                .
.    \_ _/                 .
.     /_\             ............
.     ||              .          .exhaust
regulator=T=====++=======++=====T==========/switch
_I_   solenoid         ||   solenoid  (open-circuit when exhaust flows)
/   \   valve           ||    valve
|     | (inhale)         ||   (exhale)
|     |                 (oo)
| air |                  \?/
|     |                   T patient
|_____|                  /\


controller logic table:

switch  switch      inhale      exhale
party   exhaust     solenoid    solenoid
0       1           1 open      0 closed    done exhale: begin inhale
1       1           1 open      1 open      balloon full: begin exhale
1       0           0 closed    1 open      exhaling: stop air intake
0       0           0 closed    1 open      continue exhaling: air flowing


here's my new improved truth table:

                  ----controls----
State e b  next exhaust_s intake_s
0     0 0   1     open     closed
0     0 1   1     open     closed
0     1 0   0    closed     open  stay inhale phase
0     1 1   1     open     closed begin exhale phase
1     0 0   1     open     closed stay exhale phase
1     0 1   1     open     closed
1     1 0   0    closed     open  begin inhale phase
1     1 1   1     open     closed

State = 0 = inhale-phase, State = 1 = exhale-phase
exhaust flap: e = 1 = closed-flap, e = 0 = flowing-exhaust
balloon switch: b = 1 = balloon-full, b = 0 = not-full


...and associated logic diagram & karnaugh map (done in GIMP):

...and my resulting digital logic / logic-gate circuit (Logisim):

So there, I came up with a very basic logic diagram. I'm not sure the rest of the idea is sound though; I took a lot of inspiration from Macgyver.

• how would you implement this on breadboard? - begin with a circuit diagram. – Andy aka Mar 25 '20 at 9:55
• How do you control the patient to synchronize their breathing with your machine? – Elliot Alderson Mar 25 '20 at 12:07
• I think perhaps I might need a denouncer. I'm going to leave that alone. – Elliot Alderson Mar 25 '20 at 12:08
• If you had cast this question as a generic digital design problem I would have been inclined to help, but designing medical devices comes with its own set of ethical considerations. Thinking that you can DIY a ventilator leads to situations where people ingest aquarium chemicals because some idiot on TV suggested that he had a feeling that it might help. Do your homework or leave it to the professionals. – Elliot Alderson Mar 25 '20 at 14:22
• Respectfully, I think the real professionals dealing with this crisis don't need this post to deal with it. So yeah, I think it's pretty harmless to remove coronavirus from your title. Perhaps I would clean up the title in general a bit, you can add tags on the question space instead of the title. – Wesley Lee Mar 25 '20 at 15:43

This is basically a link-only answer, so it may well be downvoted and/or removed.

Here is a set of specifications for makeshift systems that might be acceptable for emergency short term use, according to the UK government. Note the mandatory safety devices, overpressure and a whole bunch of other things will cause more damage (including instant death) than help.

The control is not really a difficult project. Keeping it from killing the patient if the slightest thing goes wrong is the issue. Not to mention the issues with intubation.

In my estimation this is not a very suitable DIY project.

Here is a set of professional treatment standards put forward as good practice by the Jack Ma Foundation and Zhejiang University School of Medicine. Parts of it may be useful.

• They work fine for me from the links above. Maybe they're blocked wherever you are. – Spehro Pefhany Mar 25 '20 at 16:57