MakAir: Covid-19 ventilator with a Raspberry Pi

During the covid-19 crisis, The birth of the first open source data enabled ventilator.

makair title

Back to March 20, 2020. Quentin Adam, with some friends living in Nantes, is trying to build a ventilator prototype with 3D printing and Arduino, in response to a shortage of equipment.

Project MakAir is started.

Quentin, a software expert, is struggling with the electronics part and looking for electronics engineers. Among his friends is Mathias, SenX CTO. That is how Mathias asked me to review the electronics part of the project. My first call with Quentin was to help him connect an old pressure sensor to an Arduino, during the late evening of March 20.

The goal was clear: to mass-produce an open-source medical ventilator. Crazy! Looking at the project that day, it looked like an "amateur" project. So I did the first real schematics, the first BOM, the first Radiospares, and Farnell reference list during the weekend, discussing with more and more people on the MakAir Slack.

Read more about the COVID-19 Pandemic and the art of Geo Time Series

Amateur? Not really...

Next Thursday, I understood that the small "amateur" project is quickly getting big. Two electronics companies detached people, and a whole regulatory team was up. In this team, there were some experts in medical devices. We also knew that we were in a shortlist of projects that the French government is looking at closely.

I soon realized that in Nantes, there is no one able to actually make the prototypes. Engineers with prototyping knowledge are scarce, I just know a few of them like me. So, on the 25th during the evening, in a few minutes, I convinced Cherine, a former Renault Sport colleague living near Paris who has the same knowledge of prototyping as me, to join the project as well.

On the 26th, I joined the MakAir core team, choosing to confine myself with 17 other people to make project MakAir a reality. Cherine came from Paris the same day I came from Brest. At the same time in France, 100 people were already helping us remotely.

I brought with me all my personal tools, from soldering iron to oscilloscope, and tons of components.

If I had been told this would last 25 days, I would have brought more than 3 days of clothing!

working in the Palace, Nantes
One sleepless night later, the first functional prototype was up.

Three days later, the CEA (french government agency for atomic energy) is now supporting us. On the 31st of March, we all moved from Nantes to Grenoble CEA facility, traveling on a nearly empty motorway.

The first prototype had basic electronics: STM32 Nucleo, a small 4 lines screen, a few buttons, a good precision pressure sensor, and several servo outputs. This first prototype allows us to make a pig breath for 4 hours on the 3rd of April, only 2 weeks after the project started.

Enters the Raspberry Pi

What we learned from the first test on a pig:

  • The ventilator did the job. The pig was alive and woke up correctly.
  • There is a huge UX problem.
  • The air flow measurement is really helpful.

The experts from the medical world are now used to high-tech screens displaying curves with not only pressure, but real-time air volume blown into the patient lungs. Even in crisis time, we understand that our product does not meet their minimum UI/UX needs.

difference of UX between first MakAir screen and a recent ventilator
Makair prototype on the left, a recent ventilator on the right.
Both can save life, but UX gap is huge!

Always listen to the users. Even if we succeed in mass production of an open-source ventilator, if doctors want curves and measure of the number of air liters entering the lungs, we must do it.

Since the beginning, this project is time driven. We never consider the price, but we always look at worldwide stocks. In a time where lots of plants are closed in Europe, the supply chain is leading the project.

inside the v1 of the MakAir
Scooter lead-acid batteries. Because these are the most available batteries in the word.

So, what is the world's most available touch screen?

farnell stocks
(and 18000 more at radiospares)

As I just said, the supply chain rules the project. MakAir will have a raspberry to display curves. Nice coincidence for an open-source project!

By the way, the mass flow meter sensor was a huge problem. Since the beginning, MakAir did not want to disturb the production of existing ventilators. But this component is on the air way, it should be approved for medical use. In April, it was impossible to source any Sensirion or Honeywell mass flow sensors... Anyway, the next test will be done with a raspberry connected to the STM32.

Enter Warp 10

On the 17th of April, the first batch of ventilators built in the CEA clean-rooms was ready. This batch was used for the 1st clinical tests.

The pressure switches from the technical team to the regulatory team, remotely working on the project since the beginning.

To prepare the next batch, we came back to Nantes. After 25 days, we switched from commando mode (18h/day, 7 days a week) to a more standard week (14h/day, the weekends with the family).

MakAir team in the CEA cleanroom with prototypes
Tyvek sterile clothing in a cleanroom. Could not be better for medical device assembly. Thanks to the CEA.

On the 30th of April, the prototype with a raspberry pi is ready for the next animal test. Two people had to fly to Grenoble CEA with this prototype, but the rest of us, and all the people remotely working on the project wanted to follow the experience.

So, the night before the test, I quickly deployed Warp 10 on the raspberry and wrote a small script to copy data every 10s to another Warp 10 server.

What is Warp 10? It is a time series platform. But unlike other TSDB (Time Series Database), there is a full analysis environment behind, and even a task scheduler. Compress time series, replicate to another server while managing network outage is really easy. Same tooling on the server and the connected object, that what I call easy IoT. To stream data, you just need a few WarpScript functions among the thousand available.

Basically, the WarpScript pseudo code is:

- Read the last value of makair.lastupload GTS
- take the last tick as start
- take now as end
- fetch locally all the makair GTS from start to end
- WRAP all the GTS
- build a script that UNWRAP and UPDATE the data
- do a remote execution of the script with REXEC 
- if the REXEC was a success, store end in makair.lastupload

You can follow the server to server tutorial to implement such a WarpScript, then save it as $WARP10HOME/warpscripts/makair/10000/upload_data.mc2 to schedule an execution every 10s.

To display data in real-time, WarpStudio did the job easily too. Autorefresh of the DataViz every 10s is a built-in function:

autorefresh settings of the MakAir test
In the dataviz tab of WarpStudio.

Around 30 lines of code to allow all the MakAir team to follow the pressure inside the pig lungs in real-time!

real time display
WarpStudio on a 60" 4k display, that's a nice dashboard.

Next steps

MakAir ventilators are designed to store everything in the Warp 10 time series database. They also have built-in WiFi and LoRa. All these features are not yet available, because the priority is still to make an open-source approved ventilator.

Connected features + open-source software is an enabler for doctors and researchers to perform extensive data collection and try new algorithms in the machine. Warp 10 is the best open source time series database to securely store medical data and analyze it. It's not a walled garden.

If you need to connect medical devices to a time series database, just ask us.

MakAir is now entering the second phase of clinical tests. We can consider we are half way to the goal. Keep in mind that among all the projects of ventilators announced by big companies, MakAir is the only one to reach the clinical tests step. 200 people, backed up by CEA and a few french companies are about to make a commercially available open source ventilator...

That's crazy when you think about it!