key: cord-1041284-b343ldgs authors: Vivas Fernández, Francisco José; Sánchez Segovia, José; Martel Bravo, Ismael; García Ramos, Carlos; Ruiz Castilla, Daniel; Gamero López, José; Andújar Márquez, José Manuel title: Res(Uhu)Rge: A Low Cost and Fully Functional Ventilator Indicated for Application in COVID-19 Patients date: 2020-11-27 journal: Sensors (Basel) DOI: 10.3390/s20236774 sha: 317cf6c240148b42f2ef8bd45c495a846492865c doc_id: 1041284 cord_uid: b343ldgs Although the cure for the SARS-CoV-2 virus (COVID-19) will come in the form of pharmaceutical solutions and/or a vaccine, one of the only ways to face it at present is to guarantee the best quality of health for patients, so that they can overcome the disease on their own. Therefore, and considering that COVID-19 generally causes damage to the respiratory system (in the form of lung infection), it is essential to ensure the best pulmonary ventilation for the patient. However, depending on the severity of the disease and the health condition of the patient, the situation can become critical when the patient has respiratory distress or becomes unable to breathe on his/her own. In that case, the ventilator becomes the lifeline of the patient. This device must keep patients stable until, on their own or with the help of medications, they manage to overcome the lung infection. However, with thousands or hundreds of thousands of infected patients, no country has enough ventilators. If this situation has become critical in the Global North, it has turned disastrous in developing countries, where ventilators are even more scarce. This article shows the race against time of a multidisciplinary research team at the University of Huelva, UHU, southwest of Spain, to develop an inexpensive, multifunctional, and easy-to-manufacture ventilator, which has been named ResUHUrge. The device meets all medical requirements and is developed with open-source hardware and software. On March 11th, The World Health Organization (WHO) declared SARS-CoV-2 (COVID-19) a pandemic. As of 1 September 2020, the WHO had reported more than 4,500,000 confirmed cases in Europe and more than 220,000 deaths, almost 15% of which occurred in Spain [1, 2] . While most patients are asymptomatic or suffer from mild symptoms (flu-like symptoms), approximately 10-15% of patients suffer from moderate or severe respiratory disorders, while approximately 5% of patients suffer very severe respiratory symptoms, which require admission to the critical care unit (CCU) [3, 4] . These patients develop bilateral pneumonia or acute respiratory distress syndrome (ARDS), which causes an elevated pulmonary inflammatory process that leads to progressive deterioration/collapse of the lungs and to the death of the patient [5, 6] . material cost and the manufacturing time (this would mean tens of times less than commercial equipment with similar characteristics). Finally, it is important to note that the objective of this project was not to develop a commercial product that met the highest medical standards, but to provide a rapid technical solution that met the basic requirements for use in patients with moderate to severe respiratory failure. The paper is organized as follows: Section 2 explains the principle of operation of the developed ventilator. Section 3 describes the hardware architecture of the device, the proposed control algorithm, as well as the user interface, which will be further medically tested and validated in an artificial lung and in a test with an animal (following applicable Spanish regulations), in Section 4 and Appendix C, respectively. In both sections, the ventilator performance is discussed, highlighting the main aspects regarding its operation. Finally, in Section 5, the main conclusions of the research are addressed. ResUHUrge is a BiPAP (bi-level positive airway pressure)-type ventilator, with independent regulation of intrathoracic pressure, i.e., one level during inspiration, IPAP (inspired positive airway pressure), and another during expiration, EPAP (expired positive airway pressure) [8, 28] . The difference between IPAP and EPAP is known as pressure support ventilation (PSV). The possibility of working with different pressures between EPAP and IPAP is fundamental, since it allows the clinician to increase ventilation per minute, thus achieving adequate tidal volumes demanded by the patient and avoiding pulmonary barotrauma [8, 29] . The ventilator works by generating a constant flow according to the maximum pressure selected (up to 35 cm H 2 O). This flow is regulated by a solenoid valve that diverts the flow towards the patient, regulating both the maximum inspiratory pressure (IPAP) and the pressure at the end of expiration (EPAP). For the correct regulation of operating pressures, IPAP and EPAP, depending on the needs and breathing times of the patient, it is necessary to define the conditions that determine the transition between inspiration and expiration cycles. These conditions are defined as inspiratory trigger and cycling [30, 31] . The inspiratory trigger is defined as the condition that allows determining the beginning of inspiration and the end of expiration, and therefore defines the expiration time (Exp Time ) and the imposition of the IPAP pressure setpoint [16, 30] . On the other hand, the cycling condition determines the end of inspiration and the beginning of expiration, that is, it defines the inspiration time (Insp Time ) and the imposition of the EPAP pressure setpoint [16, 30] . Both conditions can be given by airflow (assisted mode) or by time (controlled mode). Based on the inspiratory trigger and cycling conditions, ResUHUrge allows two modes of ventilation to be implemented as needed, assisted mode and controlled mode; see Figure 1 . Sensors 2020, 20, x FOR PEER REVIEW 3 of 20 than commercial equipment with similar characteristics). Finally, it is important to note that the objective of this project was not to develop a commercial product that met the highest medical standards, but to provide a rapid technical solution that met the basic requirements for use in patients with moderate to severe respiratory failure. The paper is organized as follows: Section 2 explains the principle of operation of the developed ventilator. Section 3 describes the hardware architecture of the device, the proposed control algorithm, as well as the user interface, which will be further medically tested and validated in an artificial lung and in a test with an animal (following applicable Spanish regulations), in Section 4 and Appendix C, respectively. In both sections, the ventilator performance is discussed, highlighting the main aspects regarding its operation. Finally, in Section 5, the main conclusions of the research are addressed. ResUHUrge is a BiPAP (bi-level positive airway pressure)-type ventilator, with independent regulation of intrathoracic pressure, i.e., one level during inspiration, IPAP (inspired positive airway pressure), and another during expiration, EPAP (expired positive airway pressure) [8, 28] . The difference between IPAP and EPAP is known as pressure support ventilation (PSV). The possibility of working with different pressures between EPAP and IPAP is fundamental, since it allows the clinician to increase ventilation per minute, thus achieving adequate tidal volumes demanded by the patient and avoiding pulmonary barotrauma [8, 29] . The ventilator works by generating a constant flow according to the maximum pressure selected (up to 35 cm H2O). This flow is regulated by a solenoid valve that diverts the flow towards the patient, regulating both the maximum inspiratory pressure (IPAP) and the pressure at the end of expiration (EPAP). For the correct regulation of operating pressures, IPAP and EPAP, depending on the needs and breathing times of the patient, it is necessary to define the conditions that determine the transition between inspiration and expiration cycles. These conditions are defined as inspiratory trigger and cycling [30, 31] . The inspiratory trigger is defined as the condition that allows determining the beginning of inspiration and the end of expiration, and therefore defines the expiration time ( ) and the imposition of the IPAP pressure setpoint [16, 30] . On the other hand, the cycling condition determines the end of inspiration and the beginning of expiration, that is, it defines the inspiration time (Ins ) and the imposition of the EPAP pressure setpoint [16, 30] . Both conditions can be given by airflow (assisted mode) or by time (controlled mode). Based on the inspiratory trigger and cycling conditions, ResUHUrge allows two modes of ventilation to be implemented as needed, assisted mode and controlled mode; see Figure 1 . Assisted mode is characterized because in this case, the patient determines the respiratory cycle and the ventilator assists the patient throughout the breathing cycle, providing the required airflow. The ventilator provides bi-level pressure support, activating positive pressure (IPAP) in response to spontaneous inspiratory effort and cycles to positive expiratory pressure (EPAP) during expiration. Assisted mode is characterized because in this case, the patient determines the respiratory cycle and the ventilator assists the patient throughout the breathing cycle, providing the required airflow. The ventilator provides bi-level pressure support, activating positive pressure (IPAP) in response to spontaneous inspiratory effort and cycles to positive expiratory pressure (EPAP) during expiration. At the onset of inspiration, the patient makes an inspiratory effort that slightly reduces intrathoracic pressure and increases inspiratory flow with a high positive value slope [30] . Accordingly, the inspiratory trigger condition is defined by a value of the derivative of inspiratory flow equal to or greater than the sensitivity setting (trigger level), activating the inspiration phase ( Figure 2) [31, 32] . At the onset of inspiration, the patient makes an inspiratory effort that slightly reduces intrathoracic pressure and increases inspiratory flow with a high positive value slope [30] . Accordingly, the inspiratory trigger condition is defined by a value of the derivative of inspiratory flow equal to or greater than the sensitivity setting (trigger level), activating the inspiration phase ( Figure 2) [31, 32] . The trigger level can be selected according to the patient's respiratory conditions so that the selected value maintains a compromise between vulnerability to false triggers and the inspiratory effort required by the patient, which may result in the patient failing to synchronize with the ventilator [16, 33] . The cycling variable ends the inspiratory phase. A breath can be cycled by one of several variables including time, flow, volume, or pressure [30, 34] . In this case, the cycling condition is defined as a percentage of the peak flow level reached during the inspiratory process (usually between 20 and 30%); see Figure 2 . This condition determines the end of the inspiratory process, establishing enough time frame for the pressure setpoint change due to impending lung saturation. Finally, for safety reasons, if the patient does not initiate a spontaneous breath in the time determined by the alarm control (apnea), 10 s, the ventilator starts a time-triggered and cycled breath (inspiratory time), limited by the pre-set IPAP level, initiating controlled mode. On the other hand, controlled mode ( Figure 1 ) is used when the patient is not able to support breathing by himself/herself. Unlike assisted mode, this mode is characterized by time-controlled cycles and triggers that guarantee patients a minimum or desired number of breaths based on the programmed or maximum inspiratory/expiratory times (Equations (A1) and (A2), respectively, Appendix A), selected according to the patient's requirements for inspired volume and oxygen saturation [16, 35] . Time-cycling can be used, for example, when the patient is sedated or cannot breathe on his/her own. In fact, once the clinician has selected the trigger level, the ventilator automatically carries out the breathing control, thus ensuring the patient's ventilation. Finally, within controlled operation mode, the device allows the implementation of APRV ventilation mode, by choosing the required inspiration-expiration ratio. The main element of the ventilator is a high-flow, high-static pressure centrifugal fan (1, Figure 3 ), with enough capacity to meet the needs in terms of the mass flow for patients with respiratory distress. The regulation of the fan is based on a three-phase speed PWM controller for brushless motors, which is programmed to produce the maximum airflow, maintaining a constant regime at The trigger level can be selected according to the patient's respiratory conditions so that the selected value maintains a compromise between vulnerability to false triggers and the inspiratory effort required by the patient, which may result in the patient failing to synchronize with the ventilator [16, 33] . The cycling variable ends the inspiratory phase. A breath can be cycled by one of several variables including time, flow, volume, or pressure [30, 34] . In this case, the cycling condition is defined as a percentage of the peak flow level reached during the inspiratory process (usually between 20 and 30%); see Figure 2 . This condition determines the end of the inspiratory process, establishing enough time frame for the pressure setpoint change due to impending lung saturation. Finally, for safety reasons, if the patient does not initiate a spontaneous breath in the time determined by the alarm control (apnea), 10 s, the ventilator starts a time-triggered and cycled breath (inspiratory time), limited by the pre-set IPAP level, initiating controlled mode. On the other hand, controlled mode ( Figure 1 ) is used when the patient is not able to support breathing by himself/herself. Unlike assisted mode, this mode is characterized by time-controlled cycles and triggers that guarantee patients a minimum or desired number of breaths based on the programmed or maximum inspiratory/expiratory times (Equations (A1) and (A2), respectively, Appendix A), selected according to the patient's requirements for inspired volume and oxygen saturation [16, 35] . Time-cycling can be used, for example, when the patient is sedated or cannot breathe on his/her own. In fact, once the clinician has selected the trigger level, the ventilator automatically carries out the breathing control, thus ensuring the patient's ventilation. Finally, within controlled operation mode, the device allows the implementation of APRV ventilation mode, by choosing the required inspiration-expiration ratio. The main element of the ventilator is a high-flow, high-static pressure centrifugal fan (1, Figure 3 ), with enough capacity to meet the needs in terms of the mass flow for patients with respiratory distress. The regulation of the fan is based on a three-phase speed PWM controller for brushless motors, which is programmed to produce the maximum airflow, maintaining a constant regime at all times, which is crucial to increasing the lifetime of the fan. To reduce the disturbances associated with a turbulent flow from the fan, a laminar flow filter is used (2, Figure 3 ). all times, which is crucial to increasing the lifetime of the fan. To reduce the disturbances associated with a turbulent flow from the fan, a laminar flow filter is used (2, Figure 3 ). Airflow control is accomplished by using a low-cost three-way resin solenoid valve designed specifically for the application (3, Figure 3 ). The design of this solenoid valve is based on the use of a controlled rotating element and a watertight chamber with an inlet (centrifugal fan) and two outputs (patient and outside) specially designed to reduce the disturbances in the mass flow during the transitions from one state to another ( Figure 4 ). This design allows the total or partial airflow generated by the turbine to be diverted either to the patient or to the outside depending on the opening of the valve. As a valve control element, a low-cost, high-speed servomotor PWM with high static torque is used. The use of servomotors with high static torque allows reducing the disturbances in the output flow caused by air injection from the fan. The relative position of the servomotor will allow defining the percentage of mass flow, thus allowing the control of airflow and pressure delivered to the patient, according to the control loop, which will be explained later. Airflow control is accomplished by using a low-cost three-way resin solenoid valve designed specifically for the application (3, Figure 3 ). The design of this solenoid valve is based on the use of a controlled rotating element and a watertight chamber with an inlet (centrifugal fan) and two outputs (patient and outside) specially designed to reduce the disturbances in the mass flow during the transitions from one state to another ( Figure 4 ). In order to satisfy the patient's oxygen saturation needs, the use of active oxygenation by means of medical oxygen may be required. To this end, a Venturi (4, Figure 3 ) is used, which produces negative pressure at its inlet, which allows passive suction and homogeneous mixing of oxygen from a typical low-pressure oxygen inlet, resulting in a mixture of oxygen-enriched air. The Venturi used is based on a resin design (Figure 5a ), specially designed according to the characteristics of the flow generated, which allows a maximum FiO2 of 80% to be guaranteed (Figure 5b ). The channeling of enriched air to the patient is done by means of a medical-grade corrugated PVC tube, which incorporates a bacterial-viral filter to avoid contamination of the device and channeling (6, Figure 3 ). Finally, the filter incorporates an air leak line, which is fundamental and necessary to guarantee the air evacuation and CO2 elimination during the patient's exhalation, due to the use of positive EPAP pressures. For the correct management and control of the ventilator, an acquisition and control system was designed (5, Figure 3 ). This system is able to condition and read the analog output variables of the different sensors, as well as the implementation of the control logic, communications, and alarm management required. In order to ensure proper operating conditions at all times, and implement the control loops, the ventilator incorporates sensors to measure oxygen concentration (7, Figure 3 ), as well as the mass flow (9, Figure 3 ) and air pressure of the patient's supply circuit (8, Figure 3 ). The output of the This design allows the total or partial airflow generated by the turbine to be diverted either to the patient or to the outside depending on the opening of the valve. As a valve control element, a low-cost, high-speed servomotor PWM with high static torque is used. The use of servomotors with high static torque allows reducing the disturbances in the output flow caused by air injection from the fan. The relative position of the servomotor will allow defining the percentage of mass flow, thus allowing the control of airflow and pressure delivered to the patient, according to the control loop, which will be explained later. In order to satisfy the patient's oxygen saturation needs, the use of active oxygenation by means of medical oxygen may be required. To this end, a Venturi (4, Figure 3 ) is used, which produces negative pressure at its inlet, which allows passive suction and homogeneous mixing of oxygen from a typical low-pressure oxygen inlet, resulting in a mixture of oxygen-enriched air. The Venturi used is based on a resin design (Figure 5a ), specially designed according to the characteristics of the flow generated, which allows a maximum FiO 2 of 80% to be guaranteed (Figure 5b ). In order to satisfy the patient's oxygen saturation needs, the use of active oxygenation by means of medical oxygen may be required. To this end, a Venturi (4, Figure 3 ) is used, which produces negative pressure at its inlet, which allows passive suction and homogeneous mixing of oxygen from a typical low-pressure oxygen inlet, resulting in a mixture of oxygen-enriched air. The Venturi used is based on a resin design (Figure 5a ), specially designed according to the characteristics of the flow generated, which allows a maximum FiO2 of 80% to be guaranteed (Figure 5b ). The channeling of enriched air to the patient is done by means of a medical-grade corrugated PVC tube, which incorporates a bacterial-viral filter to avoid contamination of the device and channeling (6, Figure 3 ). Finally, the filter incorporates an air leak line, which is fundamental and necessary to guarantee the air evacuation and CO2 elimination during the patient's exhalation, due to the use of positive EPAP pressures. For the correct management and control of the ventilator, an acquisition and control system was designed (5, Figure 3) . This system is able to condition and read the analog output variables of the different sensors, as well as the implementation of the control logic, communications, and alarm management required. In order to ensure proper operating conditions at all times, and implement the control loops, the ventilator incorporates sensors to measure oxygen concentration (7, Figure 3 ), as well as the mass flow (9, Figure 3 ) and air pressure of the patient's supply circuit (8, Figure 3 ). The output of the The channeling of enriched air to the patient is done by means of a medical-grade corrugated PVC tube, which incorporates a bacterial-viral filter to avoid contamination of the device and channeling (6, Figure 3 ). Finally, the filter incorporates an air leak line, which is fundamental and necessary to guarantee the air evacuation and CO 2 elimination during the patient's exhalation, due to the use of positive EPAP pressures. For the correct management and control of the ventilator, an acquisition and control system was designed (5, Figure 3) . This system is able to condition and read the analog output variables of the different sensors, as well as the implementation of the control logic, communications, and alarm management required. In order to ensure proper operating conditions at all times, and implement the control loops, the ventilator incorporates sensors to measure oxygen concentration (7, Figure 3 ), as well as the mass flow (9, Figure 3 ) and air pressure of the patient's supply circuit (8, Figure 3 ). The output of the sensors used is represented by a differential low voltage amplitude analog signal. The main characteristics of the sensors used are shown in Table 1 . The conditioning circuit of the sensors' output signals is based on high-performance, high-gain instrumentation amplifiers, Model INA126P from the manufacturer Texas Instruments ® . The gain of each instrumentation channel is selected according to the maximum expected output of its sensor and the input range of the analog-to-digital converter of the microcontroller used (0-5 VDC). Figure 6a ,b show the amplified analog output of the oxygen concentration and pressure sensors, along with the linear expression used for their modelling, respectively. and the input range of the analog-to-digital converter of the microcontroller used (0-5 VDC). Figure 6a ,b show the amplified analog output of the oxygen concentration and pressure sensors, along with the linear expression used for their modelling, respectively. For the specific case of the flow sensor, a Hamilton Medical ® flow sensor and differential pressure sensor are used. The amplified output is reconditioned to allow the measurement of inspiratory (positive) and expiratory (negative) flow values. For this purpose, a zero and gain correction circuit is used, using operational amplifiers, Model OPA2227 from the manufacturer Texas Instruments ® , in a differential configuration, so that the output signal of the amplifier is superimposed on a continuous 2.5 VDC component, meaning that the limit values of the sensor (positive and negative maximums) coincide with the limits defined by the measurement range of the microcontroller's ADC (0-5 VDC). Figure 6c shows the amplified analog output of the flow sensor along with the polynomial expression used for its modelling. The ATmega2560 microcontroller was used. The programming of this microcontroller was entirely developed in the Arduino IDE environment. The control of ResUHUrge was performed by using an HMI consisting of a specifically developed graphical user interface (GUI) and buzzers for audible alarms (12, Figure 3 ), which can be managed through its integrated 22″ touch screen (13, Figure 3 ) or through its integration with a local network or an Internet connection (through an Ethernet cable or WiFi), even being able to become its own WiFi network and independent Internet hotspot. Its WiFi communication capabilities enable a For the specific case of the flow sensor, a Hamilton Medical ® flow sensor and differential pressure sensor are used. The amplified output is reconditioned to allow the measurement of inspiratory (positive) and expiratory (negative) flow values. For this purpose, a zero and gain correction circuit is used, using operational amplifiers, Model OPA2227 from the manufacturer Texas Instruments ® , in a differential configuration, so that the output signal of the amplifier is superimposed on a continuous 2.5 VDC component, meaning that the limit values of the sensor (positive and negative maximums) coincide with the limits defined by the measurement range of the microcontroller's ADC (0-5 VDC). Figure 6c shows the amplified analog output of the flow sensor along with the polynomial expression used for its modelling. The ATmega2560 microcontroller was used. The programming of this microcontroller was entirely developed in the Arduino IDE environment. The control of ResUHUrge was performed by using an HMI consisting of a specifically developed graphical user interface (GUI) and buzzers for audible alarms (12, Figure 3 ), which can be managed through its integrated 22" touch screen (13, Figure 3 ) or through its integration with a local network or an Internet connection (through an Ethernet cable or WiFi), even being able to become its own WiFi network and independent Internet hotspot. Its WiFi communication capabilities enable a full remote control of the ventilator, as well as the visualization of all data, so the presence of medical staff with the patient to manage and consult the ventilator is not required, which will reduce infection possibilities and decrease the time necessary to deliver care. The touch screen control, the communication management (via Ethernet cable or WiFi), as well as the interface between the GUI and the acquisition and control system are based on the use of a Raspberry Pi microcomputer (10, Figure 3) . Finally, according to the power requirements of the different devices that make up ResUHUrge, two low-cost medical-standard 5 VDC and 12 VDC power supplies are used (11, Figure 3 ). Figure 7 shows the general power supply architecture of the ResUHUrge prototype. Sensors 2020, 20, x FOR PEER REVIEW 8 of 20 full remote control of the ventilator, as well as the visualization of all data, so the presence of medical staff with the patient to manage and consult the ventilator is not required, which will reduce infection possibilities and decrease the time necessary to deliver care. The touch screen control, the communication management (via Ethernet cable or WiFi), as well as the interface between the GUI and the acquisition and control system are based on the use of a Raspberry Pi microcomputer (10, Figure 3) . Finally, according to the power requirements of the different devices that make up ResUHUrge, two low-cost medical-standard 5 VDC and 12 VDC power supplies are used (11, Figure 3 ). Figure 7 shows the general power supply architecture of the ResUHUrge prototype. The main characteristics of the devices that make up the ventilator are listed in Table 1 . The main characteristics of the devices that make up the ventilator are listed in Table 1 . ResUHUrge is a BPAP ventilator, and therefore, its operation is based on pressure regulation, enabling the assistance or control of the patient's breathing cycle. This is done by setting the pressure setpoint according to the respiratory phase, IPAP for inspiration and EPAP for expiration. This regulation is established through the control of a three-way solenoid valve, whose stem position is determined by the servomotor. In this way, the angle of rotation of the servomotor will determine the opening of the channel and therefore the amount of airflow delivered to the patient and the outside, and indirectly the pressure of the patient line (see 3 in Figure 3 ). For the regulation of pressure and control of the solenoid valve, a PID controller is used. Appendix B includes the PID controller design and the system pressure control scheme. In order to monitor the patient's respiratory parameters, while allowing the regulation of working pressure, operating modes, etc., ResUHUrge has a very intuitive GUI, programmed in Python, and specifically designed for the application to comply with the requirements of medical specialists in mechanical ventilation. The GUI (13, Figure 3 ) consists of two panels, the control panel, where the main respiratory variables are controlled and monitored, and the alarm panel, from which the critical values of the parameters are detected and configured according to the patient and ventilation requirements. In order to monitor the patient's respiratory parameters, while allowing the regulation of working pressure, operating modes, etc., ResUHUrge has a very intuitive GUI, programmed in Python, and specifically designed for the application to comply with the requirements of medical specialists in mechanical ventilation. The GUI (13, Figure 3 ) consists of two panels, the control panel, where the main respiratory variables are controlled and monitored, and the alarm panel, from which the critical values of the parameters are detected and configured according to the patient and ventilation requirements. Figure 8 shows the remote connection point and the app designed for mobile phones. (a) (b) Similarly, controls are available for the selection of ventilation modes (assisted or controlled). Within the functionality of the controlled ventilation mode, the APRV ventilation function is allowed (see Figure 9a ). In addition to the previous controls, the GUI also shows other very useful data, such as the actual ventilation mode, the real IPAP and EPAP value, the patient's breathing frequency (BF), according to Equation (A4), Appendix A, the I/E ratio, the tidal volume or volume inspired by each inspiration (mL), according to Equation (A5), Appendix A, the volume of inspired air (L/min), Equation (A6), Appendix A, the percentage of oxygen supplied to the patient, from 21% in a normal atmosphere to that prescribed by the clinician, the real-time graph of the respiratory pressure (cm H2O), the respiratory flow (L/min), and the respiratory volume (L) (see Figure 9a ). Appendix A contains the formulation for the calculation of ventilatory parameters. Similarly, controls are available for the selection of ventilation modes (assisted or controlled). Within the functionality of the controlled ventilation mode, the APRV ventilation function is allowed (see Figure 9a ). In addition to the previous controls, the GUI also shows other very useful data, such as the actual ventilation mode, the real IPAP and EPAP value, the patient's breathing frequency (BF), according to Equation (A4), Appendix A, the I/E ratio, the tidal volume or volume inspired by each inspiration (mL), according to Equation (A5), Appendix A, the volume of inspired air (L/min), Equation (A6), Appendix A, the percentage of oxygen supplied to the patient, from 21% in a normal atmosphere to that prescribed by the clinician, the real-time graph of the respiratory pressure (cm H 2 O), the respiratory flow (L/min), and the respiratory volume (L) (see Figure 9a ). Appendix A contains the formulation for the calculation of ventilatory parameters. The alarm panel is an important function in terms of safety and comfort for both patients and medical staff. In this sense, ResUHUrge has been designed to guarantee safe conditions for the patient and therefore integrates analysis logic to detect and configure alarm conditions related to the main respiratory variables: the maximum and minimum breathing pressure (which can be configured), the minimum and maximum inspiratory volume, tidal volume, and inspired volume per minute (can be configured), the maximum BF (can be configured), or if, on the contrary, the patient presents apnea, that is, it detects if there is no breathing in a time interval defined by the clinician (see Figure 9b ). Finally, Table 2 summarizes the main functional characteristics of the ResUHUrge ventilator. In order to validate the performance of the ResUHUrge prototype, several experimental tests were conducted. All of them were carried out following the applicable Spanish regulations. Firstly, the developed acquisition system was validated and calibrated by comparing the values of the main respiratory variables with a professional flow analyzer Model Flow LAB PF-302 from the manufacturer IMT Medical ® , used for calibrating high-performance commercial ventilators ( Figure A2, Appendix C) . Subsequently, the behavior of the ventilatory modes was tested and validated on a ventilator tester (professional artificial lung) Model VT-2 from the manufacturer BIOTEK ® , which allows the simulation of any degree of respiratory compliance and resistance related to the degradation of a patient's respiratory capacity ( Figure A2, Appendix C) . In this case, a total of eight tests were performed with different ventilatory conditions, compliance values, and airway resistance, with the aim of validating the operation of the developed ventilator against different patient conditions. For each test, ResUHUrge was programmed with different ventilatory parameters and compared with the average values obtained from the professional flow analyzer (Flow LAB) for tests lasting three minutes. Table 3 shows the results obtained for the different experimental tests. In this case, the professional flow analyzer was used to simulate different levels of static compliance, associated with lung elasticity. In the different experimental tests, simulations were made to validate the behavior of ResUHUrge in the case of the ventilation of healthy lungs (50 mL/mbar), as well as lungs affected by severe ARDS (≤30 mL/mbar). On the other hand, several airway resistance values were used, with the aim of simulating different patient conditions, from low resistance (5 mbar/L/s) to high values (≥20 mbar/L/s), corresponding to high obstruction. Finally, in Tests 7 and 8, validation tests of APRV mode under adverse ventilatory conditions were performed. On the other hand, and following the applicable Spanish regulations, the medical validation of the device was performed through animal testing. Appendix C describes the development of the animal test carried out and includes the results obtained in arterial blood gasometry. According to the ventilatory conditions (compliance and airway resistance), we can distinguish between two types of tests (see Table 3 ), healthy lung tests (1 and 4) and lung tests in case of distress (2, 3, and 5 to 8), characterized by high compliance and reduced airway resistance and low compliance and high airway resistance, respectively. In the first instance, for the most favorable cases (Tests 1 and 4) and cases with moderate to severe distress and medium PSV (Tests 2, 7, and 8) , ResUHUrge demonstrated sufficient capacity to ventilate the simulated patient, reaching the required IPAP and EPAP pressures, with high values of inspired volume (~4-5 L, Tests 1 and 4). In particular, Tests 3 and 7-8 showed the effectiveness of ResUHUrge in the ventilation of a very critical patient (compliance 10 mL/mbar and resistance >50 mbar/L/s), and the correct application of APRV mode (identified by the 12/1 I/E ratio), even in cases of high airway (Table 3) . Finally, it is important to emphasize simulation in the worst ventilation conditions (Tests 5 and 6). In these cases, the high PSV required and the demanding conditions of the patient (reduced compliance and high resistance) mean that the centrifugal fan does not have sufficient ventilatory capacity to reach the maximum pressure (which, if necessary, would be very easy to solve simply by changing the centrifugal fan for a higher power one), and therefore, close maximum values are reached, depending on the ventilatory conditions of the simulated patient (IPAP = 28.5 cm H 2 O and IPAP = 25.5 cm H 2 O for Tests 5 and 6, respectively). According to medical criteria and recommendations, the maximum IPAP conditions reached in these critical cases can be considered sufficient for the ventilation of critical patients, since the use of very high pressures can be harmful because of the risk of creating barotraumas. In view of the above, it was proven that ResUHUrge is capable of ventilating patients even in cases of extreme pulmonary deterioration, characterized by very low compliance values and very high airway resistance, responding even in the most unfavorable cases. These results were validated by comparison with the values obtained by a professional flow analyzer (Flow LAB), with a measurement error within the tolerance range for this type of device. On the other hand, according to the test carried out with an animal (see Appendix C), the use of ResUHUrge increased the level of oxygenation in the blood, while reducing the concentration of CO 2 in the blood and expired air to standardized values. This is clearly reflected in the results of the gasometry. Regardless of the animal's condition, ResUHUrge demonstrated the ability to maintain proper ventilation at all times, easy operation, accessibility to adjustment controls, and easily understandable alarm system limits. At the height of what is known as the second wave of COVID-19, pharmaceutical laboratories are fighting against time in the development of a vaccine against the virus. Until that happens, it is important to have personnel resources and medical material to deal with the virus until the vaccine becomes a reality. In order to cope with the most severe symptoms caused by the SARS-CoV-2 virus, the use of mechanical ventilators has proven to be an effective tool in the treatment of ARDS, increasing the probability of survival in the most critical cases. In response to the lack of medical equipment, this article presents a ventilator device prototype, ResUHUrge, which has been developed to meet all necessary medical criteria for use even in intensive care units. ResUHUrge is a BIPAP, pressure-controlled-type mechanical ventilator that allows the monitoring and control of the main respiratory parameters, including airway pressure (up to a maximum pressure of 28 cm H 2 O in this unit, but that can be easily increased by changing the centrifugal fan in later versions), airflow to the patient, inspiratory volume, breathing frequency, FiO 2 (up to 80% in this unit, but that can be easily increased by redesigning the Venturi in later versions), and the I/E ratio, among others. Its high flow capacity, easy handling, ergonomics, remote connectivity, and the implementation of additional functions, such as APRV mode, make ResUHUrge stand out as a fully functional and highly technological prototype compared to prototypes proposed in the scientific literature. The experimental results obtained from the tests with a professional artificial lung and flow analyzer, and finally with an animal, showed the excellent performance of the device. Additionally, it was medically validated and supported by the intensive care unit of the Juan Ramón Jimenez University Hospital, Huelva (southwest of Spain). In particular, the excellent characteristics of ResUHUrge and its low cost would enable the production of a sufficient number of ventilators to deal with respiratory diseases (such as COVID-19, among others) in their initial stages, before entering the ICU, and before endotracheal intubation. The non-invasive ventilation (NIV) enabled by ResUHUrge is applicable to both acute and chronic patients. NIV offers important advantages, such as the possibility of avoiding intubation and invasive ventilation with their potential complications. It is also more comfortable for the patient, does not require deep sedation, and allows the defense mechanisms of the upper airway to be preserved. In patients with acute respiratory failure, NIV reduces tracheal intubation, morbidity, mortality, and hospital stay. In chronic patients, it can improve symptoms, quality of life, and certain physiological parameters. In summary, ResUHUrge is presented as a low-cost, high-performance ventilator that can be used in COVID-19 patients and others. It is especially indicated for use in respiratory diseases, where one of the best treatments for patients is the best possible ventilation. where, in this case: u(t) = control signal for solenoid valve. e(t) = error in the patient's line pressure. The designed control loop makes use of the error in the patient's line pressure (e(t)), calculated from the pressure setpoint (IPAP or EPAP, depending on the respiratory cycle), and the pressure value measured through the installed sensor. Finally, attending to the servomotor used, the controller output is represented by the duty cycle of a 50 Hz PWM signal, which determines its rotation angle. Figure A1 shows the system pressure controller scheme. The designed control loop makes use of the error in the patient's line pressure (e(t)), calculated from the pressure setpoint (IPAP or EPAP, depending on the respiratory cycle), and the pressure value measured through the installed sensor. Finally, attending to the servomotor used, the controller output is represented by the duty cycle of a 50 Hz PWM signal, which determines its rotation angle. Figure A1 shows the system pressure controller scheme. In order to be able to apply the proposed PID controller, it is necessary to discretize Equation (A7) so that it can be programmed in the microcontroller. Based on the above, discretizing the previous expression using the forward Euler method, (A7) is written for the k-th sample as (A8). where: : sampling period (s). , and : PID parameters to adjust. From Expression (4) and its evaluation in the previous sampling period, a recursive expression is obtained that allows the calculation of the discrete PID, Equation (A9). In order to be able to apply the proposed PID controller, it is necessary to discretize Equation (A7) so that it can be programmed in the microcontroller. Based on the above, discretizing the previous expression using the forward Euler method, (A7) is written for the k-th sample as (A8). where: T s : sampling period (s). K p , T i and T d : PID parameters to adjust. From Expression (4) and its evaluation in the previous sampling period, a recursive expression is obtained that allows the calculation of the discrete PID, Equation (A9). The parameters were adjusted experimentally, following the criteria of experienced doctors, according to the desired response time under different pressure setpoints and patient conditions. The parameter values of the designed discrete PID are listed in Table A1 . This test consisted of using the developed ventilator as a ventilatory support system applied to a pig under a normal lung condition (assisted mode) and severe distress induced (controlled mode) by means of a pulmonary washing with 2800 mL of physiological serum 0.9%. In order to check the effects of mechanical ventilation on the gas concentration in blood, pleural probes were used to perform arterial gasometry every 30 min. The parameters under study were related to the concentration and partial pressures of O2 and CO2 in the blood, which determine the correct oxygenation during inspiration and the correct elimination of carbon dioxide during expiration. In this case, to measure the level of oxygenation in the blood, the arterial pressure of O2 in the blood (PaO2) is used as the reference parameter. For the concentration of CO2, the blood pressure of CO2 (PaCO2) and the concentration of CO2 in exhaled air (ETCO2) are studied. The results of the gasometry and the ventilatory parameters used in the animal test are shown in Figure A3a In order to check the effects of mechanical ventilation on the gas concentration in blood, pleural probes were used to perform arterial gasometry every 30 min. The parameters under study were related to the concentration and partial pressures of O 2 and CO 2 in the blood, which determine the correct oxygenation during inspiration and the correct elimination of carbon dioxide during expiration. In this case, to measure the level of oxygenation in the blood, the arterial pressure of O 2 in the blood (PaO 2 ) is used as the reference parameter. For the concentration of CO 2 , the blood pressure of CO 2 (PaCO 2 ) and the concentration of CO 2 in exhaled air (ETCO 2 ) are studied. The results of the gasometry and the ventilatory parameters used in the animal test are shown in Figure A3a ,b, respectively. In order to check the effects of mechanical ventilation on the gas concentration in blood, pleural probes were used to perform arterial gasometry every 30 min. The parameters under study were related to the concentration and partial pressures of O2 and CO2 in the blood, which determine the correct oxygenation during inspiration and the correct elimination of carbon dioxide during expiration. In this case, to measure the level of oxygenation in the blood, the arterial pressure of O2 in the blood (PaO2) is used as the reference parameter. For the concentration of CO2, the blood pressure of CO2 (PaCO2) and the concentration of CO2 in exhaled air (ETCO2) are studied. The results of the gasometry and the ventilatory parameters used in the animal test are shown in Figure A3a Once the distress was induced (Sample 3, Figure A3 ), the arterial oxygen pressure was drastically reduced (PaO2 from 520 mmHg to 110 mmHg), while there was a considerable increase in the concentration of CO2 in the blood and expired air (PaCO2 from 42 mmHg to 75 mmHg and ETCO2 from 47 mmHg to 59 mmHg), which reflects a reduction in the capacity of alveolar gas exchange and therefore lung degradation. To counteract this effect, ventilation with high FiO2 levels and IPAP Once the distress was induced (Sample 3, Figure A3 ), the arterial oxygen pressure was drastically reduced (PaO 2 from 520 mmHg to 110 mmHg), while there was a considerable increase in the concentration of CO 2 in the blood and expired air (PaCO 2 from 42 mmHg to 75 mmHg and ETCO 2 from 47 mmHg to 59 mmHg), which reflects a reduction in the capacity of alveolar gas exchange and therefore lung degradation. To counteract this effect, ventilation with high FiO 2 levels and IPAP pressures (0.8, 30 mbar respectively) was performed in order to compensate for the loss of lung capacity (Samples 4 and 5, Figure A3b ). In successive samples, the recovery of the blood oxygenation pressure level (PaO 2 > 100 mmHg) and the reduction of the CO 2 concentration (PaCO 2 ≤ 50 mmHg, ETCO 2 ≤ 45 mmHg) can be checked, indicating the recovery of the correct gas levels in the animal (Samples 4 and 5, Figure A3 ). Finally, prior to the euthanasia of the animal, the FiO 2 was reduced, with the aim of analyzing the recovery of the pig's respiratory capacities. According to the results (Sample 6, Figure A3 , irreversible damage to the lungs was reflected by a reduction of blood oxygen pressure values to pre-distress levels, but with the use of high IPAP support pressure (PaO 2 = 105 mmHg) and a slight increase in pressures and CO 2 concentrations in blood and expired air (PaCO 2 = 50 mmHg and ETCO 2 = 42 mmHg). World Health Organization Regional Office for EUROPE Development of a Portable, Ultra-Rapid and Ultra-Sensitive Cell-Based Biosensor for the Direct Detection of the SARS-CoV-2 S1 Spike Protein Antigen COVID-19 pandemic and non invasive respiratory management: Every Goliath needs a David. An evidence based evaluation of problems Role of Helmet-Delivered Noninvasive Pressure Support Ventilation in COVID-19 Patients Helmet CPAP to Treat Acute Hypoxemic Respiratory Failure in Patients with COVID-19: A Management Strategy Proposal Challenges and solutions in meeting up the urgent requirement of ventilators for COVID-19 patients COVID-19 disease: Invasive ventilation CPAP in term neonate with respiratory distress syndrome. Early Hum. Dev. 2020 A ventilation parameters waveform study by using a simple ICU ventilator circuit COVID-19 disease: Non-Invasive Ventilation and high frequency nasal oxygenation New modes in non-invasive ventilation Low-Complexity System and Algorithm for an Emergency Ventilator Sensor and Alarm Prototyping of a Cost Effective and Portable Ventilator Prototyping of artificial respiration machine using AMBU bag compression Invasive mechanical ventilation in the emergency department Quick Thinking Turns out Low-Cost Ventilators Home PAP devices in patients infected with COVID-19 COVID-19: How to transform a noninvasive ventilation device in a critical care ventilator Closed-Loop Mechanical Ventilation Using Feedback from Optically Isolated Analog Sensors A lung for all: Novel mechanical ventilator for emergency and low-resource settings Modelling, Prototyping and Closed Loop Control of a Mechanical Ventilator for Newborn Babies Development and Application of Miniaturized Emergency & Transport Ventilators Mechanical Ventilator Milano (MVM): A Novel Mechanical Ventilator Designed for Mass Scale Production in Response to the COVID-19 Pandemic Remote design and manufacture through the example of a ventilator Tension pneumomediastinum in patients with COVID-19 Management of Respiratory Distress Syndrome due to COVID-19 infection Non-invasive ventilation in the ED: Whom, When, How? Turk Te Design and Study of a Portable High-frequency Ventilator for Clinical Applications Transitioning from an ICU ventilator to a portable home ventilator Mechanical Ventilation Strategies Targeting Different Magnitudes of Collapse and Tidal Recruitment in Porcine Acid Aspiration-Induced Lung Injury Initial emergency deparment mechanical ventilation strategies for COVID-19 hypoxemic respiratory failure and ARDS Patient-ventilator asynchrony: Automatic detection of autopeep Invasive and non-invasive mechanical ventilation Mechanical Ventilation This research was possible thanks to the work of many people and institutions. Among where: Vol min : inspired volume per minute (L/min). Equation (A7) shows the general formulation of a continuous-time PID controller.u(t) = K p e(t) + 1 T i t 0