Introduction

Mechanical ventilator is a device designed to provide artificial breathing for patients with lung disease and respiratory failure. A ventilator can fulfill the function of respiration in whole or in part. Ventilator respiration can be spontaneous, assisted or controlled. In spontaneous respiration, patients determine their own respiratory rate and tidal volume. In assisted respiration, patients decide their respiratory rate but tidal volume is determined by the ventilator. In controlled ventilation, both the rate of respiration and tidal volume are determined by the ventilator. Each model of ventilation has different ranges of setting. More modern and developed machines provide the operators with more options in respiration settings. Though modern ventilators appear to be complex, they determine effective ventilation protocols for patients [1].

Pulse oximeter is an indispensable part of modern medicine as a reliable, non-invasive and painless means of measuring oxygen saturation in arterial blood (SpO2) and pulse of the patient. It has been used since 1930 to follow oxygen saturation in operation rooms, post-anesthesia care units (PACU), intensive care units and emergency services. It is possible to follow oxygen saturation (SpO2) via a pulse oximeter and, for healthy individuals, fluctuations in PaO2 (partial pressure of oxygen in arterial blood evaluated by arterial blood gas analysis) correspond to SpO2 changes [29]. Pulse oximeter is easy to apply and can give instantaneous and accurate information about the condition and vital signs of patients, which accounts for why it has been accepted widely in a number of medical branches [10]. Measuring oxygen saturation (SpO2), pulse oximeter has been routinely used in neonatal intensive care units (NICU) since the 1980s and has been guiding the manual setting of FiO2 [11]. Oxygen saturation of hemoglobin in arterial blood can be measured by taking blood sample as well. For arterial blood gas analysis, taking blood sample may be painful for the patient and can cause infection, serious injury, local hematoma, artery rupture, hemorrhage, aneurism and embolization. Besides, health personnel are under risk because of blood-borne infections such as Hepatitis B, C, and HIV [9, 12]. Therefore, nothing is more important than monitoring oxygen saturation in arterial blood especially during the treatment of unconscious or disabled patients [6, 13].

Having evaluated the fluctuations of oxygen saturation (SpO2) and the heart rate variability at 15-s intervals within 60 s after incremental increases of FiO2 during resuscitation of infants younger than 29 weeks requiring two different forms of ventilation (CPAP-Continuous Positive Airway Pressure, PPV-Positive Pressure Ventilation), Tereza Lamberska et al. conclude that SpO2 and heart rates increased in parallel with the incremental increases of FiO2 [14].

The novelty of our research is the operation of ventilator and pulse oximeter synchronously in order that the ventilator can calculate FiO2 and PEEP on its own. This calculation is done by a fuzzy-logic-based controller designed for the ventilator. Patient’s duration of ventilation (Time-I ve Time-II) and SPO2 value on the pulse oximeter were taken as its input membership function. FiO2 and PEEP were used as the output membership functions. With fuzzy logic, all these values can be preprocessed and reduced to a limited number of membership functions. We used a fuzzy-logic-based microcontroller as it gives the required results in a faster way with short software. The fuzzy-logic-based software operates within an embedded computer system which controls the ventilator. The designed ventilator synchronously communicates with the pulse oximeter and automatically performs what the physicians and nurses need to do to start up and/or switch off the device according to the changes in patients’ status. That is the original aspect of this paper because all these procedures are performed the values read on pulse oximeter.

Design of the ventilator

The block diagram of the designed mechanical ventilator is given in Fig. 1. In the diagram; sensors, valves, microcontrollers and the other parts are shown with numbers and also explained at the bottom of Fig. 1.

Fig. 1
figure 1

Block diagram of the designed ventilator synchronized with pulse oximeter (1- regulator, 2- inspiration valve(proportional valve), 3- expiration valve, 4- flow sensor, 5- PIC18F4550 microcontroller, 6- embedded computer system, 7- LCD monitor, 8- pulse oximeter, 9- mixer tube, 10-pressure sensor, 11- oxygen sensor)

The regulator (1) reduces the high-pressure gas coming from oxygen and medical air reservoirs to 6 bars and conveys it to the ventilator. The volume and pressure of the air to be delivered to the patient is adjusted by the proportional valve (2). The expiration valve (3) opens so that the patient can exhale the breath s/he inhales. The medical air and oxygen is mixed in the mixer tube (9). The volume, oxygen rate, and pressure of the air that the patient receives are measured by flow sensors (4), the oxygen sensor (11) and pressure sensors (10) with respectively. PIC18F4550 microcontroller (5) reads data from the sensors and opens/closes the valves. The software required to control the ventilator and to display the results on an LCD screen (7) exists within the embedded computer system (6). The pulse oximeter (8) measures the patient’s pulse and oxygen saturation and the results of those are transmitted to the microcontroller (5) and the pulse oximeter (8). The fuzzy-logic-based software to calculate the oxygen rate and respiration frequency of the air to be delivered to the patient according to his/her pulse and oxygen saturation is also placed in the embedded system (6).

Microcontrollers require some simple peripheral circuits when they are used for circuit designs. For example, power supply is used to supply required energy for both microcontroller and its neighboring circuits [1517]. Power supplies must be isolated from mains and have a limited current and voltage output in order to protect the patient. Switch mode power supply provides further advantages for the isolation between the mains and human body [18]. All the integrated circuits were powered with +5 V DC. The peak current consumption of the system was 2.4 A. Therefore, a 3 A current and 5 V DC step-down switching regulator was used for the circuit [19].

PIC18F4550 microcontroller was used to read data from the sensors and the pulse oximeter, to convey these data to the embedded system through a USB port, to receive the results produced by the fuzzy software in the embedded system again through the USB port and to open and close the valves in the air ways. The principal reasons why this microcontroller was preferred are as the following:

  1. 1-

    PIC18F4550 microcontroller supports I2C communication (it was used to read data from AirFlow and pressure sensors),

  2. 2-

    It can communicate via USB without any integrated device or circuit (23rd and 24th pins, in order to communicate with the embedded system),

  3. 3-

    It supports serial communication (pins tx-25 and rx-26, in order to communicate with the oximeter),

  4. 4-

    It comprises an Analog-to-Digital Converter (A/D) Module (it was used to read data from the oxygen sensors) [20]

Microcontroller software necessary to read data from sensors and communicate with the embedded system was developed using Proton Basic programming language.

The block diagram of the electronic card for the ventilator can be seen in Fig. 2. With this electronic circuit,

  • Data can be read from 4 airflow sensors and 4 pressure sensors with I2C protocol,

  • PIC18F4550 microcontroller can check the proportional valves,

  • SpO2 data and pulse rate can be obtained from the pulse oximeter via serial communication

  • A USB communication can be conducted between the microcontroller and the embedded system.

Fig. 2
figure 2

Block diagram of the mechanical ventilator

The Odroid-U3 device developed by the “odroid” firm was preferred since its characteristics are as the following: Linux operating system 1.7GHz Quad-Core CPU, 2GByte RAM, 10/100Mbps Ethernet with RJ-45 LAN Jack, 3 × High speed USB2.0 Host ports, Audio codec with head phone jack on board, GPIO/UART/I2C ports, XUbuntu 13.10 or Android 4.x Operating System, Size: 83 × 48 mm, Weight: 48 g including heat sink. The package includes the main board and the heat sink.

Java programming language was used to develop the software in the embedded system. Java was preferred as it is a platform free language. The embedded system employs Linux operating system and the software developed in Java works in this operating system. The software system developed for the embedded system includes USB communication software between micro-controller and the embedded system, fuzzy logic software to interpret sensor’s data obtained from the microcontroller and SpO2 data, visual software showing respiration and pulse oximeter status of the patient.

Pulse oximeter and its operation principle

Medical sensors, such as electrocardiograms, pulse oximeters, sphygmomanometers and arrhythmia detectors, are widely used to monitor vital signs of patients [21]. Pulse oximeter is a non-invasive device which does not emit heat or radiation. Pulse oximeters are composed of two LEDs (Light Emitting Diodes) and one photo diode sensor. The finger of the patient is placed between these LEDs and photo diode. From the photo diode, the micro-processor reads the amount of light emitted from the led that goes through the finger [22]. The wavelength range of red LED is 640–660 nm, wavelength range of infrared LED light is 930 and 940 nm [6]. Red and infrared light sent from LEDs are transmitted to the photo detector on the other side of the tissue, and the absorption of light is determined. Venous blood seems blue and arterial blood seems red because absorption spectrums of oxygenized hemoglobin (HbO2) and reduced hemoglobin have different features. Red light is absorbed by hemoglobin and ultraviolet one is absorbed by oxyhemoglobin. At each light frequency, the amount of light emission varies according to oxygenation level of hemoglobin in the tissues. At 660 nm, oxyhemoglobin absorbs light less than reduced hemoglobin and at 940 nm, reduced hemoglobin absorbs light less than oxyhemoglobin. Finally, light sensor receives the difference between two LEDs and calculates blood oxygen concentration [23, 24].

Pulse oximeter design

In the designed Pulse Oximeter, the rate of wave lengths of red and infrared (Red/IR) LEDs read from the output of photodiode (Red / IR) was calculated by using Eq. 1 and this ratio value and graphic are given in Fig. 3 (Empirical Calibration for R versus S) were used to calculate SpO2 value.

$$ \mathrm{Ratio}=\left(A{C}_{RED}/D{C}_{RED}\right)/\left(A{C}_{IR}/D{C}_{IR}\right) $$
(1)
Fig. 3
figure 3

Relationship between SpO, SaO2 and Ratio(R/IR) (emprical calibration) [25, 26]

AC: Pulsating arterial component of red and infrared LEDs,

DC: Non-pulsating components of red and infrared LEDs [26, 27].

While SpO2 in Fig. 3 refers to the oxygen saturation in the blood measured by the oximeter device [28, 29], SaO2 is the oxygen saturation in the blood measured by arterial blood gas analysis [30]. In other words, both measure the same thing in different ways.

The block diagram of the designed pulse oximeter is shown in Fig. 4. As it can be seen from the Fig. 4, the values read on the pulse oximeter were transmitted to the ventilator via serial communication, and the fuzzy-logic-based software within the ventilator was set to calculate the FiO2 and PEEP values to be delivered to the patient.

Fig. 4
figure 4

Blok diagram of the designed pulse oximeter

The pulse oximeter circuit mounted on the Printed Circuit Board (PCB) is shown in Fig. 5. This circuit is connected to a 12 V power supply which also supplies the ventilator. Part 1 lowers this voltage to 3.3 V to supply the circuit. Part 2 is the micro-controller, namely the brain of the pulse oximeter. The software developed for the pulse oximeter operates this microcontroller as well. Part 3 is the header socket where the LCD screen to show the results produced by the pulse oximeter is mounted. The results produced by the pulse oximeter can also be seen on the ventilator screen. In Part 4, there is a D-SUB connector with 9 pins to which the pulse oximeter probe is connected. In Part 5, there is a connector with 3 pins used to establish serial connection with the ventilator. These three pins are pinRx, Tx, and GND pins. In Part 6, the male header connector with 5 pins is used to program microcontroller. These three pins are MCLR, Vcc, GND, Clock and Data pins.

Fig. 5
figure 5

Pulse oximeter circuit mounted on PCB

Range of the SpO2 value

In intensive care units (ICU), SpO2 is expected to be above 96 %, and more than desired oxygen can be given [28]. Since the biggest danger for patients with ARDS (acute respiratory distress syndrome) is multiple organ dysfunctions, providing supportive ventilation modes so as to optimize the hemodynamic function and oxygen supply is crucial in management of these patients. An optimal mechanical ventilation should target plateau airway pressure (Ppl) < 30–35 cmH2O, FiO2 < %60, SpO2 > %90 [31]. Wen-TsaiSung et al. generated a classification for SpO2 values as in Table 1 [24].

Table 1 Blood oxygen concentration classification table

Berry DC et al. [2] classified the ranges of SpO2 values as in Table 2. Hypoxemia mentioned there means an abnormally low level of oxygen and PaO2 in the blood [30].

Table 2 Interpretation of pulse oximetry readings [2]

Gary B. et al. [32] analyzed the SpO2 range of 37,593 patients (males: 47 %) from four hospitals and reached the following results with regard to oxygen saturation in blood:

  • Although the mean SpO2 for these patients was 96.4 %, it ranged from 70 % to 100 %.

  • Median SpO2 was 97 % (95–98 %) and males and females had similar means.

  • Figure 6 shows the distribution of SpO2 values for four different hospitals (PHT-Portsmouth Hospitals, UHCW-University Hospitals Coventry and Warwick Shire, RSH-Royal Shrewsbury Hospital, PRH-Princess Royal Hospital) separately and in total. It is observed that distributions are all close to each other.

  • Mortality for 37,593 patients was observed to be 5.27 %. Figure 7 shows the relation between the distribution of SpO2 values for 37,593 patients who inhaled the air and the hospital mortality rates.

Fig. 6
figure 6

Distribution of SpO2 values on air of acute medical admission [32]

Fig. 7
figure 7

The relation between distribution of SpO2 values for 37,593 patients and hospital mortality rates [32]

As it can be seen from the Fig. 7, mortality rates increased for patients whose SpO2 values are lower than 94 %. Mortality rate is the highest in patients with SpO2 values lower than 88 %.

  • It can be seen from the tables that the mean SpO2 is 98 % for patients aged between 18 and 44; 97 % for those aged between 45 and 64, and 96 % for those aged 65 and above.

Figures 6 and 7 show the importance of oxygen saturation. These graphs used for determining membership functions of SpO2.

Designed fuzzy-logic-based controller

Fuzzy logic works well in order to define the uncertainties in the process variable. Also, fuzzy logic control can be designed without mathematical modeling. It can overcome local optima to reach global optima [33]. Fuzzy logic theory is a general mathematical approach that allows partial memberships. Several studies have shown fuzzy logic control to be an appropriate method for the control of complex processes [34]. An approach closer to human reasoning may allow design of better predictive systems, and fuzzy-logic is a powerful tool in that respect [35]. The fuzzy-logic-based controller designed for this research computes and automatically does what physicians are supposed to do according to changing medical states of patients during ventilation.

Design of the fuzzy controller

Two fuzzy controllers were used in the study. When the oxygen density is low, the first controller gradually increases the values of FiO2 and PEEP to bring them back to normal values. When the oxygen density reaches to normal values, the second controller gradually decreases FiO2 and PEEP settings of the ventilator and brings them to targeted values. The block diagram of the fuzzy controller is shown in Fig. 8.

Fig. 8
figure 8

Fuzzy controller block diagram

Fuzzifier and membership function

Fuzzification is the determination of membership functions based on input variables applied on real values to determine the accuracy level of each if-then [36]. It can be defined as an operation that maps a crisp object to a fuzzy set, i.e., to a membership function [37].

The input functions of the first controller are SpO2, Time-I and FSPO2 (First SpO2). SpO2 function is the oxygen density in the blood of the patient read from the pulse oximeter. This data is read by the ventilator from the micro-controller of the pulse oximeter via serial communication. FSPO2 function is the first value read from the pulse oximeter when fuzzy logic acts to increase oxygen saturation in the blood of the patient. FSPO2 is compared with the patient’s SpO2 values at every moment s/he is connected to the ventilator and whether or not any improvement takes place in his/her oxygen saturation is continuously checked by the fuzzy controller. Figure 9 shows the membership function of SpO2 and FSPO2.

Fig. 9
figure 9

SpO2 and FSPO2 Input membership function

With Time-I function, fluctuations in oxygen density of the blood of the patient are checked. If changes are not at an adequate level, the controller gradually increases FiO2 and PEEP values. Membership functions of Time-I and Time-II can be seen in Fig. 10.

Fig. 10
figure 10

TIME-I and TIME-II entrance membership functions

The output functions of the first fuzzy logic controller are FiO2-I and PEEP-I. The output functions of the second fuzzy logic controller are FiO2-II and PEEP-II. The functions at the output of the first fuzzy controller are used to increase oxygen density in the blood of the patient to normal values. After oxygen density in the patient’s blood reaches to normal values, Time-II starts working and the second fuzzy controller steps in. The output membership functions of the second fuzzy controller decrease gradually and reach at targeted FiO2 and PEEP values because it is harmful for the patient when high FiO2 and PEEP values are used for a long period of time. FiO2 function is the oxygen rate of the air delivered to the patient from the ventilator and ranges from 23 % to 100 %. Figure 11 shows the output membership functions of FiO2-I and FiO2-II.

Fig. 11
figure 11

FiO2-I and FiO2-II output membership functions

FiO2 is the oxygen rate of the air delivered to patients supported by a ventilator. In recent years, there has been great interest in the potential clinical benefits of high FiO2 for the prevention of chirurgical area infections (CAI) and for decreasing postoperative nausea and vomiting cases (PONV- postoperative nausea and vomiting). Using high FiO2 can be beneficial for patients under general anesthesia [38]. PEEP (Positive End-Expiratory Pressure) is the positive airway pressure obtained when the patient is exhaling. As its name suggests, PEEP provides positive pressure to prevent the lungs from being completely emptied. Many ventilators have a PEEP setting. PEEP prevents alveoli collapse, decreases lung damage caused by ventilator and increases oxygenization performance of diseased lung [1]. In Fig. 12, PEEP-I and PEEP-II membership functions can be seen. Studies conducted indicate that FiO2 and PEEP values are used to increase oxygen density.

Fig. 12
figure 12

PEEP-I and PEEP-II output membership functions

The second fuzzy controller input membership functions are SpO2, FiO2-I, PEEP-I, and Time-II. Like in the first controller, SpO2 function is the oxygen density in the patient’s blood read from the pulse oximeter. FiO2-I and PEEP-I membership functions are the output function of the first output and the input function of the second controller. The first fuzzy controller gradually increases FiO2 and PEEP settings to bring oxygen saturation in the blood of the patient to normal values. When oxygen saturation in the blood reaches to normal values, the second fuzzy controller gradually decreases FiO2 and PEEP values and reflects them on output functions.

Development of rule base

The rule base for the first fuzzy logic controller was formed by a total of 44 IF-THEN fuzzy rules. That for the second fuzzy logic controller was formed by a total of 26 IF-THEN fuzzy rules.

Examples of rules prepared for the first fuzzy logic controller:

  • 1. Rule: If (SPO2 is FirstAid) and (TIME-I is T1) then (FiO2-I is F6)(PEEP-I is P1).

  • 8. Rule: If (SPO2 is Emergency) and (TIME-I is T2) and (FSPO2 is Emergency) then (FiO2-I is F4)(PEEP-I is P2).

  • 17. Rule: If (SPO2 is Critical) and (TIME-I is T3) and (FSPO2 is FirstAid) then (FiO2-I is F5)(PEEP-I is P1).

  • 29. Rule: If (SPO2 is Emergency) and (TIME-I is T4) and (FSPO2 is Critical) then (FiO2-I is F4)(PEEP-I is P2).

  • 33. Rule: If (SPO2 is Normal) and (TIME-I is T4) and (FSPO2 is Critical then (FiO2 is F2)(PEEP-I is P1).

  • 35. Rule: If (SPO2 is FirstAid) and (TIME-I is T5) and (FSPO2 is FirstAid) then (FiO2 is F6)(PEEP-I is P5).

Examples of rules prepared for the second fuzzy Logic Controller:

  • 1. Rule: If (SPO2 is Normal) and (TIME-II is T1) and (FiO2-I is F6) then (FiO2-II is F5).

  • 12. Rule: If (SPO2 is Normal) and (TIME-II is T2) and (FiO2 is F3) then (FiO2-II is F2).

  • 20. Rule: If (SPO2 is Normal) and (TIME-II is T3) and (PEEP-I is P3) then (PEEP-II is P2).

  • 24. Rule: If (SPO2 is Normal) and (TIME-II is T5) and (PEEP-I is P2) then (PEEP-II is P1).

Inference mechanism and purification

The inference unit that uses fuzzified inputs and the rules stored in the rule base process incoming data and produce an output (fuzzy). As this output is to be used in the outer world (in a real system), it needs to be transformed from fuzzy values into real values. This process is called purification [37]. Mamdani’s fuzzy inference method is the most commonly seen fuzzy methodology. Mamdani’s method was among the first control systems built using fuzzy set theory [34]. In fuzzy-logic-based controllers, input functions and rule base were processed with Mamdani Inference Mechanism and fuzzy results for PEEP and FiO2 were produced. For defuzzification, in other words the conversion of these fuzzy results into numerical results, COG (center of gravity) approach was used because our output functions, FiO2 and PEEP values are to be numerical results rather than fuzzy results as they will be used to regulate the ventilator.

Results

An electronic lung model with a block diagram shown in Fig. 13 was designed to test the equipment. A pressure sensor, an AirFlow sensor, an oxygen sensor, a respiration circuit, and a lung test balloon were used for this process. The verification of electronic lung model was performed by using a spirometer (ZAN 100 Pulmonary Spirometer) and Ventillation Calibration Test Equipment (Model 4040 series). Like in the ventilator in Fig. 2, PIC18F4550 was used to read data from the sensors. The data read from the sensors by the microcontroller were transmitted to the computer and the results were observed. For the pulse oximeter, a circuit was designed to increase and decrease SpO2 with two buttons and it was made to communicate serially with the ventilator.

Fig. 13
figure 13

Electronic lung model

Figure 14 presents a view of the computer software interface pertaining to the electronic lung model. This software was made up by using C# programming language. “UsbLibrary.dll” library was used to control USB ports of the computer with C#.

Fig. 14
figure 14

Computer software interface

For patients with severe hypoxemia, initial FiO2 should be adjusted to 100 %. PEEP is generally used to improve the oxygenation status of patients with hypoxemia resistant to high-level FiO2 [39]. The results obtained are seen in Tables 35.

Table 3 Responds by the first fuzzy logic model to some input values given (Example −1)

As seen in Table 3, oxygen rate of the air delivered becomes 100 % the minute a patient with a very low SpO2 is connected to the ventilator. FiO2 values decrease gradually in parallel with a normalization in SpO2 values. PEEP values do not change as the patient steadily recovers after s/he is connected to ventilator. If the patient did not show any improvement despite the high rate of FiO2, PEEP values would gradually increase. An example of this can be seen in Table 4.

Table 4 Responds by the first fuzzy logic model to some input values given (Example-2)

The data in Tables 3 and 4 were obtained from the first fuzzy logic based controller. This controller starts working when a patient with low SpO2 value is connected to the ventilator to increase his/her blood oxygen concentration. When oxygen density in the blood of the patient is normalized with this controller, the second fuzzy logic based controller steps in to gradually decrease FiO2 and PEEP values increased by the first controller. Examples of the results produced by the second fuzzy controller are given in Table 5.

Table 5 Responds by the second fuzzy logic model to some input values given

Discussion

The values given in the Results section are those read on the electronic lung model. The device designed will be tested on real patients after the required certificates (e.g. CE document) of conformity for medical devices and clinical research are attained. The results obtained on the lung simulation seem to be considerably successful.

Studies indicated that this system can be used especially in the follow-up of infants in newborn units and of patients connected to ventilators after operations. No additional pulse oximeter is needed to use the system designed. The ventilator incorporates two circuits. One of them belongs to the ventilator itself and the other one is for the pulse oximeter, i.e., we designed the ventilator and the pulse oximeter as an integrated circuit. The ventilator comprises a port for the pulse oximeter probe. This port can be used to connect the patient to the pulse oximeter if FiO2 and PEEP need to be adjusted automatically by using the fuzzy logic controller. Moreover, the ventilator includes an option for targeted FiO2 and PEEP. If FiO2 and PEEP settings produced by the ventilator are lower than these targeted values, the patient is given the targeted value. The system stands on the ventilator as an option. The physician following the patient can use this system with his/her patients if s/he considers it appropriate.

As the ventilator we designed works in synchronization with the pulse oximeter, it provides an advantage in conditions when arterial blood gas analysis is not done. According to the results of a study by Rice et al. [5], when arterial blood gas analysis is not performed, SpO2 values read from the pulse oximeter can be used to diagnose ARDS. Besides, as frequent arterial blood gas analysis requires taking excessive amounts of blood sample, it can lead to anemia in critical patients.

According to the results of a study by Coskun et al. [40], pulse oximetry has some important limitations in certain conditions such as hypotension, vasoactive drug use, anemia, acid-base disorders. Under normal conditions, pulse oximeter can be more reliable. However, these results must be reevaluated in patients with impaired parameters. FiO2 and PEEP cannot be calculated automatically in cases when the pulse oximeter cannot be used. Therefore, physicians and nurses by themselves should adjust the air to be delivered to the patient connected to ventilator.

Conclusion

In this study, we have proposed a novel device to measure the percentage of oxygen (FiO2) and the positive end-expiratory pressure (PEEP) to be delivered to the patient. A mechanical ventilator and a pulse oximeter were designed for this purpose. These two devices were operated in synchronization. The amount of oxygen in the air to be delivered to the patient from the ventilator is calculated automatically in this way. This calculation is made by a fuzzy-logic-based controller developed for the ventilator. Oxygen concentration in the blood of the patient is measured by the pulse oximeter. The measured value is conveyed to the ventilator with serial communication and used as an input membership function of the fuzzy-logic-based controllers. The results of the conducted tests were recorded and presented in Tables 35. The results verified the efficacy of the proposed system.