At this time of COVID-19 outbreak, the demand for ventilator and health monitoring devices has increased with each passing day. To overcome the shortage of these devices, we don’t have any other good solution yet that can help us in fulfilling this requirement. we can try to design own RaspberryPi COVID -19 Ventilator.
So, today we have decided to make a small ventilator prototype using Raspberry Pi. It will also be capable of monitoring our health and provide data about our heartbeat and SPO2 levels.
Our ventilator prototype uses a servo motor that applies pressure on an air sack (BVM bag), thus pushing oxygen-concentrated air into the lungs. When the servo motor comes back to its earlier position, it results in pressure being released from the air sack (BVM bag), making it retain its original shape. This helps to draw out CO2 from the lungs (similar to the process of breathing in and out). The entire ventilator mechanism of respiration should be in sync with a patient’s normal respiratory rate. This can be achieved by changing the speed of the servo motor in the program. We have also used the MAX30100 sensor that gives us live data about the rise and fall of pulse rate and oxygen level in the blood of a patient. By implementing Raspberry Pi and any standard LCD display, we can observe the pulse rate and blood oxygen percentage as a graph on the display screen. (Refer Fig 2,3,4,5)
So let’s start our project by collecting the following components for RaspberryPi COVID -19 Ventilator:
Bill Of Material
We also need extra cardboard and pipe for mechanical construction.
NOTE:-Here, I am using a balloon instead of a test lung and a BVM bag. But for good results, please use a BVM bag and standard test lung. You will also need to make some mechanical changes to the BVM bag for it to work properly.
Do keep in mind that this DIY project should be implemented only under strict medical supervision.
Now let’s begin our project with some mechanical arrangement and construction.
Construction of ventilator
Here, we will take any cardboard and fix the BVM bag on its flat surface. (Refer Fig 7). Now we will take one end of a pipe and insert that into the opening of the BVM bag (here I have used a flattened balloon). The other end of the pipe will be attached to the standard test lung (here also I have used a balloon). Now we will place another cardboard piece on top of the BVM bag so that one side of the BVM bag is fixed to one end of the cardboard and its other side with a servo motor shaft.(Refer Fig 7,8,9,10).
After the mechanical construction, now let’s go for the electronic construction and codingConnect the RPi with the servo motor in the following way:-
|GPIO 17 (Gpio zero pin number)||SIGNAL PIN (Yellow Wire)|
The Health Monitoring System
For coding of the health monitoring system, open the Arduino IDE, go to Library manager and install the following required libraries
After their successful installation, we can start coding.
First, we will initialize the libraries in the code and create two variables, val1 and val2.
Next, we will create a setup function that will start the OLED display and the MAX30100 sensor. It will also set the graph length and breadth.
Then we will create a loop function that checks data from the MAX sensor, displays it on the OLED and also sends that to the serial port.
Next, connect the components as shown in the circuit diagram.
Now for visualizing the live graph and health data, we will setup the Processing 3 in Raspberry Pi. To do so, open the Raspberry Pi and run the given system in terminal.
curl https://processing.org/download/install-arm.sh | sudo sh
Next, open the Processing 3 (Refer Fig 15). Get the code named ”rolling graph.pde” from the Arduino Library extras folder and then paste that in the Processing IDE in Raspberry Pi.
Now power the Raspberry Pi and then connect it with the display. Run the code for ventilator and then run the code for health data i.e. “rollinggraph.pde” in the Raspberry Pi Processing. Also, connect the Arduino with MAX30100 into the Raspberry Pi USB port.
When the code for the ventilator runs, the servo motor shaft starts moving and results in pressure being added on the BVM BAG. Hence, oxygen goes through the pipe and flattens the lung. Then the servo motor comes back to its original position, restoring the BVM bag to its previous stae. This continuous process simulates the contraction (breathing in) and relaxation (breathing out) of a human lung.
For health data visualization, simply put your finger on the MAX sensor. As soon as it will start to glow, the live graph of the data health will be obtained.
NOTE:- To change the breathing rate of the ventilator, add the time delay in the code .
Also for health data monitoring, change the port name to the port name of Arduino. Here my Arduino port name is ttyACM0.]
Congrats, Our prototype of RaspberryPi COVID -19 Ventilator is ready.
Download Source Code
This article was first published on 24 April 2020 and was updated on 7 May 2021.