Raspberry Pi Based COVID -19 Ventilator and Health Monitoring Device

Ashwini Kumar Sinha


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)

Fig 2. No beat
Fig 3. Showing Beat Rate
Fig 4.
Fig 5.
Fig 6.

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).

Fig 7
Fig 8.
Fig 8
Fig 9
Fig 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:-

5V 5V
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

  • SSD1306 Chart 
  • Max30100

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.

Fig 11.
Fig 12
Fig 13

Next, connect the components as shown in the circuit diagram.

Fig 14.Connection

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.

Fig 15.
Fig 16. Change the port name in code
Fig 17.



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. 

Fig 18.the code to move servo and press BVM bag of ventilator

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 Code


Enter your email address:

Delivered by FeedBurner


  1. Sir
    I am interested in involving and going for constructing
    The full assembly and loading the software
    The Corona kit which appeared in your above
    Article .
    If any body willing to finance ,I can take responsibility to supervise the project until testing and compliance.
    I am an electrical and power electronics
    Engineer .
    Gopal Raju

    • You can improve it further and cam makes the design into a finished product with some mechanical construction and code modification.IF you need any help in construction you can modification can ask me

  2. Hi, thanks for sharing your project. What I don’t get, how could the servo apply any force with this little leverage?
    I understand that you might be on a low budget but in terms of mechanical construction, it would be nice to see a finished prototype. Thank you very much.

    • Mechanical construction can be modified to get more force by attaching the lever to the servo and another end of the lever to be fixed on another side

  3. Sir
    I am interested in involving and going for constructing
    The full assembly and loading the software.
    I am an computer science
    Engineer student .

    • this is a concept DIY having the demo how you can design your own ventilator, here servo motor is used to exert force on the BVM bag or ballon to push the air in and out helping in respiration. The pipe is connected to BVM bag, not to the servo motor


Please enter your comment!
Please enter your name here