hammockman / breather Goto Github PK
View Code? Open in Web Editor NEWVentilators for the Masses
Ventilators for the Masses
What do we want our device to cost? Note that this is parts only - we assume labour and plans come for free.
Jo and Ra had a talk yesterday and worked on a valve solution where either:
We thought about finding components in three grades: medical, cheap, repurposed. The repurposed option is where people take components from household items - e.g. washing machines.
Jo is looking into components. The parts list was:
Part | Number | ||
---|---|---|---|
Controller | 1 | ||
Standard hospital pneumatic fittings | 2 | ||
Manual pressure regulator | 3 | ||
Solenoid valve | 3 | ||
O2 meter (flow, concentration, pressure) | 2 | ||
Inline HEPA filter | 1 | ||
Exhaust HEPA filter | 1 | ||
Box | 1 | ||
Batttery | 1 | ||
Power supply | 1 |
@hammockman, can you come up with a concept, quite different to #3, and fill in here? Would ideally like to choose between them on 26th.
Jo, I think u mentioned solenoid valve on outlet might not be a goer. Was it diff pressure? Can u elaborate, esp useful to @hammockman
Currently there's nothing to tell the operator when the UI is not getting messages from the ventilator.
The breath counter used to serve this role.
Maybe the besty thing is to pop up a warning if no mqtt message is received for more than a 15s period?
There were some errors using write_byte yesterday (from bmp085.py).
Not a major worry now - this issue is just for reporting further occurrences (need to copy error messages next time!).
Changes to bpm from GUI are registered on MQTT but breathe.py doesn't seem to update. can you check this out @hammockman ?
mosquitto_sub -h localhost -t breathe/inputs/bpm
20
16
We probably need some humidity control.
From wikipedia: "According to that standard, the minimum water content of inspired respiratory gas is ca. 33 mg/dm³ and the maximum respiratory gas temperature is ca. 42 °C."
A bubble humidifier seems like the simplest solution.
This is an issue to deal with design of the controller software, and which hardware it has to interface to. Specific bugs should have their own issues.
We are using a Raspberry Pi 3B+ with a separate LCD screen.
The software has to read various sensors and control 2-6 valves. It also has to have at least two major modes:
There are many variations on these modes, but keeping things simple at this stage is a must.
Here are some is a plot of typical pressures and times (lots more on the web):
This looks like a very good solution and a very impressive use of low cost gear for a sophisticated problem. Well done!
We generally have piped air and O2 with different fittings depending on the country of origin of the equipment.
I am not sure what the pressure is at the wall.
Some of the ventilators run on oxygen only and entrain air. These are on cylinders or from the wall supply.
The Raspberry Pi wireless solution is great as a future proofing solution. The software is the expensive bit for the commercial ventilators which also run their own screens and inputs.
In any other time, taking a prototype into a hospital environment and plugging it into the supplies might be the next step.
Simulating a patient’s lungs, cough, spontaneously assisted ventilation would be a refinement.
It could be a very easy CPAP circuit, which has been found to be useful in COVID-19 experience overseas, preventing full ventilation.
To get us going, let's just get the system controlling the volume of air in the pipework between the insiration valve, v_i, and the expiration valve, v_e. This includes the patient's lungs which are compliant, so the volume changes during the cycle.
In each mode below the system has two pressure set points - inspiration pressure, p_i, and exhalation pressure, p_e. The other operator settings are tidal volume V_t, and breaths per minute BPM (which gives breath time in seconds t_b = 60/BPM).
Mode | Name | Description |
---|---|---|
1a | Pressure-time | Set BPM, controller regulates to p_i for half the time and p_e for half the time. |
2a | Pressure-assist | As per 1a, but BPM setting is increased if patient inspiration is sensed before t_b. |
3a | Tidal volume | Set tidal volume and minimum BPM. System regulates at p_i until either tidal volume or t_b/2 is reached, and then regulates at p_e for the same amount of time (we can't measure volume on exhalation). |
3b | Scary tidal volume | As per 3a but inspiration can start if patient inhalation is sensed. This is presumably scary as we risk breath stacking. |
In all cases there are a number of monitored variables with alarm conditions.
A wee status for today:
Sensor status (planned sensors):
Sensor | Physical | Electrical |
---|---|---|
Insp. temperature | Y | Y |
Insp. pressure | Y | Y |
Insp. flow | Y | N |
O2 sensor | Y | N |
Insp. humidity | N | N |
To do:
Notes:
We are currently using DHT11, but reading shows DHT22 is a better choice for low/high relative humidities (0-20%, 80-100%).
Have hooked up Pressure/temp sensor, AD lines, 12v power supply and bus-like thing, and 12v relay. Photo shown below - the valve seems to switch ok up to 5 Hz, haven't tried higher.
Out of here now for the avo and probably evening as it is Kylie's brithday.
To do tomorrow:
Variable speed duct fan (rangehood's, extractor fans, ...) + pressure/flow sensors + control computer + one-way and blow-off valves.
MQTT probably a simple way forward.
On raspberry:
sudo apt install -y mosquitto mosquitto-clients
sudo systemctl enable mosquitto.service
For python use paho-mqtt should be enough
Probably two topics - one for data out from breather, another for changing settings.
Notes from a quick discussion with Rob Everitt (ICU, Waitemata DHB)
While running overnight (>6000 breaths) the following error resulted. Probably not worrying about now, except to report further incidences here.
Traceback (most recent call last):
File "breathe.py", line 73, in <module>
p
M.publish('breathe/sensors/current', json.dumps(deque2dict(S.current_values)), retain=True)
File "breathe.py", line 38, in deque2dict
for d in q:
RuntimeError: deque mutated during iteration
pi@manawa-ora-1:~/breather/Design/Final/Code $
Hot wire anemometers can't distinguish flow direction (sign) so computing tidal volume from their output requires making assumptions. Not such a great idea. Improve?
After a talk to Lance:
Humidifiers are standard medical components, so we should design our humidifier with same interface. Any takers to investigate this?
The competition puts emphasis on 3D printing. This is limiting as 3D printing tech is not common in many parts of the world. So our "farming equipment" version has merit.
What about if we provide STL files for either each (1") fitting we use, or combination parts? This would allow people to either buy from their local shop, and/or print their own bits.
The FAQ sheet says a fully functioning prototype needs to be finished by March 31st. With the lockdown this means we might have to buy/order parts tomorrow, and/or modify our design to accommodate the lockdown. This is a) a hassle and b) realistic in terms of designing and building something that can be built in such a situation.
rather than operating over normal network the ui-broker-ventilator comms should run over a secure vpn. feasibility? complexity? fragility?
The current app has security/safety holes. Many, many of them.
breathe/#
messages to broker@racleave, there's a bare bones version of the app pushed at 0a26576. It uses three threads:
I've not tried running it on manawa-ora-1 yet (its not talking to me, off maybe?) but start it up with
$ python3 breathe.py
and kill it by
$ mosquitto_pub -t breathe/runstate -m quit
Take a squiz asap and let me know if this is what you were imagining.
Just saw Joseph's 5 concepts.
This is what we have in issue #3. It seems mainly good to me although I think we could dispense with flow and O2 meters on the exhaust side...and maybe pressure? We should have the bits for this once deliveries come through
I think a downside of this is that the common line with the pressure sensors will risk the patient redrawing their last breath - although if there is a flap valve at the Y-connector this problem is much reduced as only a small volume has "incorrect" air. It requires a flap valve in a third party component though, which is not exactly prudent.
This is smart. Pros: Doesn't need air supply, motor acts as valve and positive supply, and if we know motor rotation can give precise delivery profiles, and effectively a volume measurement. Cons: Less simple than solenoid valves, and no O2 enrichment
Also smart. Can probably be ranked w.r.t 3 according to number, cost of parts and complexity. How can we make these motors uber cheap/accessible?
Similar to 4, yes? But even simpler.
I think the 3-5 variants are better than 1, and I'd rate 2 the lowest. Ranking 3-5 should be able to be done using a matrix.
Questions:
Can we use a simple 12v solenoid and a beam to do the see-saw shutoff of concept 4?
Can we use 3 solenoid valves in place of the motor cam valve? Then we get 3!=6 settings, or 7 if one includes all closed.
Well done on shopping everybody :)
John is going to start an inventory spreadsheet, so we know what we have in parts. We know vaguely what I have in the shed.
I think we should add to the inventory approximate costs of things. Rather than detailing everything, what about each item over $20 gets a price tag in the inventory, and other things get nothing or maybe a group amount.
Comments welcome!
The O2 sensor I bought is 2-wire. I wish I'd bought the 3 or 4 wire version, as the 2-wire version doesn't have a heater and they need to come up to 300 deg C before they work.
Will look at pulling one out of a local car (Jon's, Kylie's, Steffan's, Jo's, in that order).
Until then we can use the 2-wire one as the mechanical template.
breathe
needs to be able to be restarted/monitored by both JH and in Mourea.
Either:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.