Cheap Stepper Controller for Emergency Ventilator

Hi Folks! I've been volunteering my time creating a very cheap emergency ventilator that squeezes a BVM (bag-valve-mask, aka ambu bag) to supply Covid-19 victims with air. I have a working prototype which you can see in the video at the bottom of the post. I come from a 3D printing background, so right now I'm controlling the stepper motor with a spare MKS SBase, smoothieware, and a few lines of basic gcode (G0 X450, G0 X0, repeat ad infinitum). What I'd like to control it with is something like an Arduino Uno, a single stepper driver, and 3 or 4 potentiometers. The three pots control the depth of the squeeze, the speed of the squeeze, and the frequency of the squeeze. A current MIT project shows 4 knobs on their device, and my best guess on that is that the fourth knob controls dwell time (how long the ventilator pauses between squeezes). The problem is, I've never coded for an Arduino and barely even used one. Can I use some basic potentiometers as inputs to achieve this? Can an ATmega 328P issue enough instructions fast enough to something like a DRV8825 to drive a single Nema 17 at something close to its max usable speed? Lastly, I would love a few pointers on which resources I can find to develop the code necessary. Alternatively, if a bored Arduino pro would like to volunteer their time and just donate some workable code, that would be fantastic.

Here's a list of project goals:

  • Keep the hardware as cheap as possible
  • Drive the stepper motor and the arduino off a single 24v power supply (voltage divider for the arduino?)
  • Easily control frequency, depth, speed and dwell time of the stepper motor with knobs/potentiometers
  • Code needs to have acceleration built in to prevent exceeding the Nema 17's torque capabilities

And here is the video of the first prototype:

I should note I'm working with a local EMT and he has also advised that managing pressure in the lungs and ensuring that they are not over-pressured is extremely important. With that in mind, we also planned to add a pressure sensor and a buzzer to indicate when the pressure is exceeded or falls below a lower threshold.

Oh, and depending on what's possible, maybe a fifth or sixth potentiometer to set the minimum and maximum pressure thresholds before the alarm sounds.

Seems complicated.

A simple windshield wiper motor would work with timing like you have in your car for intermittent operation.

However, you need to add many fallback features for this to even being close to acceptable.

I recommend that you take a look at the existing projects and see if you can help out with one of those, or failing that maybe use some of the information they have published for your own project. Some groups are quite far along with this already, so there's no need to spend time reinventing and getting medical consultation for things that someone else already has done and made open source.

There is a list of DIY ventilator projects, with some analysis, here:

Far better to have one DIY respirator project that gets finished and put in use than 100 half finished projects that never get used.

Great initiative, thanks for sharing, I like the video. All the big companies are working on devices to satisfy demand in Europe and USA which will certainly bear fruit. Nobody seems interested yet in developing a low cost ventilator for LMICs (Lower and Middle Income Countries). If this virus sweeps across the world it will mutate more rapidly so that those who have developed immunity can catch the new strains.

I am using conventional bellows - got a sample on the way via our factory in China - and a wiper motor to lift the bellows to draw in air. The diameter of the bellows is 144mm so with a pulley on the output shaft of 40mm diameter I can rotate the output shaft by 270 degrees to deliver a tidal volume of about 1200 mL. Tidal volume is the volume of a single breath

As the motor lifts the bellows drawing in gas, the oxygen content can be managed by allowing only oxygen in (and shutting off atmosphere) for a proportion of the lift. For example, 40% oxygen means 25% of the lift so 25% oxygen, 75% air means 40% oxygen overall as air is already 21% oxygen

I am using an MPX10DP pressure sensor, a bridge with a differential output of around 35mV full scale and an offset of around 30mV. Full scale is 10kpa, which is 100cm of water. Maximum pressure should be 35mL of water. I am using the 2 Op Amp LM358 with the first being a difference amplifier with gain the second with offset and gain to use most of the 5 volt range for A/D

With the Arduino you can set the respiratory rate and tidal volume with a potentiometers. Also, patient specific maximum pressure. Analogue display of pressure would be good. Also, pressure controlled inspiration as an alternative to tidal volume.

More advanced, haven’t worked out yet, is to control PEEP and let the patient initiate taking a breath before the ventilator forces it – crucial to weaning a patient off a ventilator.
Happy to share more detail if anyone is interested.

It doesn’t matter who wins this race, the winner is the human race.