Fuzzy Logic Controller of New Strategy of Biomedical Measurements

—Monitoring patient’s condition represents one of the crucial tasks in any biomedical center to ensure the stability of the patient state. Healthcare sector quality demands are exponentially rising. These demands are concerned with designing expert systems for medical diagnosis. Also, the use of fuzzy sets theory in the medical field is to solve some medical problems. This paper proposes a simple strategy of bio measurements and its behavior through fuzzy logic model. The proposed design is constructed using three different types of data transfer-based sensors and microcontroller. The fuzzy logic model is designed and practically tested. The generated results are compared to those of the (Omron RS3 - HEM-6130-E Omron mc-246-e) device from OMRON company. Four hundred people aged between 3 and 72 years old were examined by the proposed system. All results are compared using fuzzy logic model in MATLB. Using statistical analysis, the average data measurements for each sensor in the designed device were recorded; the output results were found to be of close enough (less than 1% error) to the reference readings. The system can be used at home due to its low cost, easy to use, and high accuracy.


Introduction
Health represents one of the main challenges for humanity. It is a crucial yardstick of human development that allow every individual to be the leader of a social and economically fruitful life. In other words, health is not merely the absence of disease or infirmity, but it is a state of complete physical, mental, and social well-being. Disease, illness, and sickness are the possible forms of making the human body to lose his health [1][2][3][4][5].
In recent scenario of life, healthcare problems, including lung failures, coronary heart diseases, and obesity, are rapidly increasing. Hence, overcoming from all such problems is the demand of the hour. Engineering has the responsibility of finding solutions for complex problems in real world. In this regard, the domain of engineering and technology facilitate the designing and developing of the useful applications in our daily life. Biomedical engineering can be considered as a bridge connecting fields in engineering to those in medicine. The development of biomedical engineering is responsible for improving healthcare diagnosis, monitoring and therapy. Thus, intelligent and low cost health monitoring systems have to be developed for providing those who are suffering from such chronic diseases more comfortable life. As an advanced technology, embedded computations, wireless communications, wearable and portable remote health monitoring tools can be used in implementing such type of systems [6][7][8][9].
In any realistic process, ambiguity is often present. This non-literal nature may engender from the construction of the data inputs and in the explanatory rules used for describing the relationships between the informative features. In this situation, fuzzy logic has an inference style that empowers the human to apply reasoning capabilities in artificial knowledge-based systems. Fuzzy logic yields a means for transferring linguistic data into control actions and consequently, it exhibits a high level of computation. This strategy of data processing has more flexibility and generality in the formulation and solution of problems. Additionally, it is not only suitable for the solution of linear problems, but it is also helpful for exploring the complexities of non-linear ones. Moreover, by including all the input facts, it is beneficial in achieving sharp decisions. Furthermore, fuzzy logic emphasizes the precision of clinical data by including scalar quantities in the argumentations and providing conclusions which give partial truth in results [10][11][12].
As the people are becoming more conscious about their health problems, the demand for well-equipped hospitals and diagnostic centers is augmenting day by day. On the other hand, monitoring patient's condition represents one of the crucial tasks in any biomedical center to guarantee that patients are in good and stable conditions. In this regard, sensors are allocated to monitor physical or environmental conditions and to cooperatively pass their data through the network to a main location. Owing to recent technological advances in sensor networks, low-power devices, low power integrated circuits, and wireless communications have greatly contributed to the implementation of low-cost, light-weight as well as intelligent sensor nodes. These nodes have the capability of sensing as well as processing and are qualified for circulating more than one vital signs or parameters. The new sensors can be integrated into a wireless network or in body area network for health monitoring. The more recent wireless networks are bidirectional and capable of enabling control of sensor activity [13][14][15].
This paper presents a new system for bio measurements using sensors and microcontroller. This system is designed through a fuzzy logic model and practically tested. This practical test is carried out on patients aged between 3 and 72 years old. A fuzzy model, based on the results derived from the implemented design, through the measurements of the heartbeat rate, temperature and blood pressure using different types of sensors, is established. A group of 400 patients is used to develop this model and another group of the same number of patients is used to test it. The results of fuzzy logic are compared to those obtained by other one of the standard designs.
The structure of this paper is arranged as follows. In section II, we review the previous work in the field of the manuscript. Section III is concerned with the design structure of the proposed system. Section IV discusses our simulation results whilst section V includes our concluded remarks.

Related Work
This section involves an overview of the different research papers that are associated with various medical developed architectures as well as those concerned with enhancement of the existing techniques. In all different biomedical engineering areas, the ultimate goals are to ameliorate the quality life, minimize the impact of disease on the everyday life of individuals, and support an appropriate infrastructure. In other words, the improvement of healthcare diagnosis, monitoring and therapy is the responsibility of the development of biomedical engineering, due to which providing quality health service to one and all is the novel strategy of the health line. This new technology is driven by the vision of a wireless biomedical monitoring system, where body sensors monitor the vital parameters (blood pressure, ECG, temperature and heartbeat rate) and transmits data to the central control via cable free communication network. In this situation, periodic health monitoring, or preventative care, allows people to discover and treat health problems early before they have consequences. Particularly, for risk patients and long-term applications, such a strategy exhibits more freedom, comfort, and opportunities in clinical monitoring [16][17][18][19].
B. Patil et al presented a design and an implementation of wireless biomedical parameters monitoring system based on different biomedical sensors and microcontroller unit arduino UNO with zigbee [1]. Qingchao Gong et al. outlined a real-time detection system of photoelectric pulse signal based on Bluetooth transmission [2]. N. Sivasankari et al illustrated a WI-FI based smart communication system to achieve remote health monitoring applications, in which the sensor unit record several parameters such as body temperature, heart beat rate, blood pressure, glucose from patient [3]. T. Heng et al. performed a blood pressure monitoring device with wireless system which links to computer and records the reading automatically. In such device, XBee is chosen to be the blood pressure measuring unit and transmits it, wirelessly, to the computer [4]. K. Nisha et al have designed a simple heart rate monitor system based on arduino board which displays the output on an LCD display and simultaneously transmitting the data to a smart phone via Bluetooth [5]. B. Mallick et al introduced a new technique of measuring the heart rate through a fingertip and arduino. It is based on the principal of photophelthysmography (PPG) which is non-invasive procedure of measuring the variation in blood volume in tissue employing a light source along with a detector [6]. V. Thomas et al proposed the design of a non-invasive wireless heart rate and blood pressure remote monitoring system based on an embedded board and Bluetooth wireless technology. The real time biomedical signal is sensed and measured using an optical circuit based, in its operation, on the PPG technique [7]. S. Karkra et al described the use of arduino in designing an health recognized system [8].

Design Structure
Sensors play an integral role in numerous modern industrial applications, including everyday monitoring of activities such as transport, air quality, medical therapeutics, and many more. Modern sensors with capabilities of integrated information and communications technology (ICT), which are known as smart sensors, have been recently emerged. Additionally, remarkable progress has been made in computational capabilities, storage, energy management, and a variety of form factors, connectivity options, and software development environments. These technologies have been developed in parallel with a significant evolution in sensing capabilities. The emergence of biosensors, that are now employed in a variety of consumer products, such as tests for pregnancy, cholesterol, allergies, and fertility, is a good witness to this. Our scenario of designing is based on microcontroller (ATmega328P) that is used to measure heart rate, blood pressure and body temperature as shown in Fig.(1). Several types of sensors are employed in carrying out these measurements as: a pulse sensor to measure the heart rate, an IR sensor to measure also the heart rate, a strain gauge sensor to measure the blood pressure, a pressure sensor to measure also the blood pressure, and 2 types of temperature sensors to measure the body temperature. The circuit diagram used to achieve these bio-measurements is illustrated in Fig. (2).
The microcontroller (U1) is of type ATmega328P, which is considered as the backbone of the design. The eight LEDs in the circuit are used as indicators to the reading on the LCD display and sensors. LED D1 is green to indicate the normal state, LED D2 is yellow to indicate the average state, while LED D3 is red to indicate the dangerous state. LEDs D4 to D8 are used to indicate the transmitted data from the sensors. The LCD displays the result of readings, using the reset variable resistance Rv1. C1 and C2 are capacitors while X1 is 4MHz crystal oscillator used as a clock generator to U1. The temperature sensor 1 (two wire body temperature sensor) and sensor 2 (LM 35DZ) are connected to the analog-to-digital converter (ADC1) pin in U1. The pressure sensor (BMP085) and the strain gauge sensor are connected to the analog-to-digital converter (ADC2) pin in U1. The strain gauge sensor is connected to a Wheatstone bridge circuit with a combination of four active piezoelectric sensors full bridge. It is also connected to the ADC2 pin in U1. The complete Wheatstone bridge is fed with a stabilized DC power supply, along with an additional conditioning adjustment, which can be set to zero at the null point of measurement. As stress is applied to the bonded piezoelectric, a change in the resistance will take place and unbalance of the Wheatstone bridge will be resulted. As a consequence of this action, an output signal will be excited. The magnitude of such signal is proportional to the stress value. Sensor resistance will be changed when there is a vibration, and this changing will make the Wheatstone bridge unstable. As the signal value is small, in the order of a few millivolts, the signal conditioning will provide amplification for the signal level to be increased. To measure the blood pressure (Systolic), a valve, tube and motor are used.
The remaining part of the setup circuit consists of two sensors to measure heart rate. One is IR sensor and the other is pulse sensor. The IR sensor is connected to the analogto-digital converter (ADC3) pin in U1. The transmitting part of this sensor is clipped to one of the fingers of the subject. The detecting part of this sensor, on the other hand, is a photo-transistor which measures the change of the blood volume through the finger artery. The other sensor of heart rate measuring is the pulse sensor. This sensor is connected to the analog-to-digital converter (ADC0) pin in U1. It detects this transmitted light beam and measures the change of the blood volume through the finger artery. The outputs of both sensors are entered to U3 which is used as a difference amplifier the output of which can be used as an indication of the difference between responses of the two sensors.
As the signal value is small, in the order of a few milli-volts, the signal conditioning provides amplification to increase the signal level. Both U1 and the operational amplifier LM358 (U3 to U6) are connected to the LCD display to show the output results. The dip switch (DSW1) is used to allow the changing from sensor to another. The power is supplied from a 9V or 5V DC plug pack.
After discussing the electronic components of the proposed strategy, let us now go to discuss the construction of fuzzy logic model. In this regard, the fuzzy logic has two types:Mamdani type and Sugeno type. For the purpose of employing it in the future researching, we select Sugeno type. This type is used to predict inputs and outputs and relate between them. The model has three basic steps:  25  185  95  185  93  30  188  92  183  92  35  180  89  178  89  40  172  87  172  87  45  175  87  170  87  50  165  88  163  87  55  157  88  157  90  65  140  80  138  79  70  140  80  140  80  71  150  80 150 80  22  175  98  22  175  25  185  95  25  185  30  188  92  30  188  35  180  89  35  180  40  172  87  40  172  45  175  87  45  175  50  165  88  50  165  55  157  88  55  157  62  153  90  62  153  65  140  80  65  140  70  140  80  70  140  71 150 80 71 150 The first step is to save inputs and outputs, and determine the degree of similarity in accordance with each of the appropriate fuzzy sets via membership functions. Table I.a  and Table I.b show the extracted data of the heart beat rate without and with effort conditions using different types of sensors. Under the same conditions of measurements, the reference values are incorporated among the contents of these tables for the purpose of comparison.  132  128  81  81  80  17  122  122  120  82  82  81  18  124  124  121  85  85  83  19  120  120  120  87  87  80  29  120  120  120  84  84  79  30  124  124  121  80  80  82  31  125  125  122  82  82  80  32  123  123  120  81  81  78  33  123  123  120  82  82  83  46  120  120  121  82  82  84  49  129  129  130  84  84  81  55  130  130  125  87  87  85  65  136  136  141  84  84  81  67  136  136  133  87  87  90  71  131  131  127  87 87 92 The recorded data indicates that both the under-examination sensors give values close to the corresponding ones in the case of reference device. Table II illustrates the recorded data of blood pressure (BP) using different types of sensors. The recorded data for Systolic BP, using BMP085 and Strain gauge, show that the obtained values are close to each other. However, in comparison with the reference value, there is a difference. For Diastolic BP using BMP085 and Strain gauge, the recorded values are close to each other. However, in comparison with the reference value, there is a deviation. Table III displays the average body temperature measurements. In this situation, the same results are obtained by the two sensors and are similarly to those recorded by the reference device. a) This model was tested with different types of membership functions "Trapezoidal, Generalized bell shaped, Gaussian" for each of the five inputs. These inputs include temperature, heart rate with effort, heart rate without effort, systolic BP and diastolic BP. The output of this model is Health Status (st). The generated fuzzy inference system structure contains 82 fuzzy rules to specify the diagnostics status. The Gaussian membership function gives the best results whilst the Trapezoidal function has the worst ones. b) The basic rule is required as a matrix for input and output variables. For each matrix element, there is a distinct relation between its input and the corresponding output. This relation has two objects: OR or AND. In our construction we use AND operator to fuzzy the inputs.  Now, by using MATLAB, the obtained results are analyzed. Additionally, the fuzzy tools are used to make a comparison between the different algorithms. To facilitate this comparison, it is convenient to transform these results into mathematical formulas. The easiest type of these formulas is that of linear form. This is actually what we are doing in our research. Eqs. (1)(2)(3)(4) represent the comparison between the reference device results and those that are generated by the IR and pulse sensors. Figs. (3 & 4) are devoted to draw these results. The displayed results of these figures show that the obtained results of IR sensor and those achieved by pulse sensor are very close to the results of the reference device. To confirm the validity of the derived formulas and the recorded results, a random point on the curve is taken and compared with the indicated results to see to what extend the two values are similar. Figs.(3a & 3b) illustrate the predicted linear equation between the age and the IR sensor results for measuring the heart beat rate (with and without effort conditions). y= 0.02x + 168 (1) y=0.004x + 86 (2) y=0.0086x + 89 y=0.0177x + 168 (4)  y=0.0051x + 82 (6) y=0.0051x + 82 (7) y=0.011x + 124 Fig. 8. Temperature, as a function of age, measurements using: Eqs. (9)(10)(11) demonstrate the comparison between the reference device results and those that are generated by temperature sensors 1 & 2. Fig. (8) illustrates these results. From the candidates of this figure, it is noted that the temperature sensors 1 & 2 attain the same results. To confirm the validity of the derived equations and the recorded results, a point on the curve is randomly chosen and compared with the indicated results to see to what extend the two values are comparable. Figs. (8a & 8b) show the predicted linear equation between the age and the temperature (in degrees Celsius) obtained by sensor 1 and sensor 2, respectively, for measuring the body temperature. y= 0.00018x + 37 (9) y=0.00017x + 37 (10) y= 0.00018x + 37 (11) Tests are applied to all formulas to detect the accuracy. If the value X from the reference device is taken as 47, the results of Eqs. (1)(2)(3)(4) are 175, 90, 87 and 175, respectively, as Figs.(3a-5b) indicate. On the other hand, if a 47 is taken as a value of X for the contents of the reference device, the result of Eqs. (5)(6)(7)(8) are 125, 82, 125 and 82, respectively, as Figs.(6a-7b) illustrate. Additionally, for the same value of X (x=47) for the reference device outcomes, Eqs. (9-11) display 37.5, 37.5 and 37.5, respectively.

Fuzzy Logic Results
The patient is checked for five vital health parameters with the help of portable digital instruments. These measured parameters are then passed, as inputs, to the proposed system. If the outcome exhibits that the patient is abnormal then the appropriate medications are provided. Fig. (9) describes the plane of the steps that must be processed by any healthcare system with a patient. Family-based healthcare services allow full mobility for the patients at their homes. On the other hand, healthcare systems connected besides have the capability of reducing the waiting time for face-to-face contact with physicians. Here, the Gaussian membership function is considered due to its better results. The fuzzy inference system is structured by selecting five inputs namely: temperature, heart rate with effort, heart rate without effort, systolic BP and diastolic BP, respectively, and one output as health status (st). The generated fuzzy inference system structure contains 82 fuzzy rules. In fuzzy language, surface means drawing the relation between rules and the corresponding function. This surface reveals the effect of rounding and approximation processes on the result and shows the accuracy of module based on the MATLAB fuzzy logic design. Alternatively, in fuzzy language, statistics indicate the relation between rules and inputs/outputs. These statistics show to what extent the surfaces generated by the fuzzy inference system closer among themselves. Fig. (10) depicts the five inputs along with the output of the fuzzy system. Based on the recorded results, the fuzzy logic model emerges the statistical graphs shown in that figure. The input and the output surfaces of the fuzzy inference system are demonstrated in Figs. (11 & 12). These surfaces display the relation between rules and Gaussian function in 3D form. Fig.(11a) presents the relation of the (st) against the heart rate with effort and temperature. While Fig.(11b) draws the relation between the (st) as a function of the heart rate without and with effort, Fig.(11c) exhibits the relation between the (st) against the diastolic BP and temperature. Finally, Fig.(11d) plots the relation between the (st) as a function of the systolic BP and heart rate with effort. From these graphs, it is noticed that the normal (st) is represented by the green color and the dangerous case is indicated by the blue color whilst the yellow color is used to indicate the intermediate value between the above mentioned two cases.  On the other hand, Fig.(12a) traces the relation between the (st) against the heart rate without effort and temperature. While Fig.(12b) sketches the (st) as a function of the diastolic and systolic BP, Fig.(12c) depicts the relation between the (st) against the systolic BP and temperature. Finally, Fig.(12d) clarifies the relation between the (st) as a function of the diastolic BP and heart rate without effort. From the displayed graphs of this group of plots, it is obvious that the normal (st) is represented by the green color whilst the dangerous case is indicated by the blue color. With the aid of the yellow color, the intermediate value between the normal and dangerous cases can be outlined.  Tables I, II and III, it is evident that the percentage error between the reference values and the corresponding measured values can be calculated. The error ratio between the reference measurements and those obtained by the two types of sensors are 2.980665951%, 1.589186744%, 2.841520258% and 0.999942532% for heart rate measurements with and without effort. While temperature sensor 1 (LM 35DZ) for measuring body temperature, gave a percentage error of 0.100725222, temperature sensor 2 (body temperature sensor two wire) indicated a percentage error of 0.510341123. On the other hand, the pressure sensor (BMP085) has percentage error of 0.800513613 for systolic and 0.39268211 for diastolic. Additionally, Strain gauge sensor recorded percentage error of 0.800513613 for systolic and 0.39268211 for diastolic as Table IV demonstrated.

Conclusion
The proposed model in this paper is developed using more than one hundred patients and is tested with a similar number. The model is found to be accurate for classification and it is proved to be at least as accurate as the reference model. Using statistical analysis, the average data measurements for each sensor in the designed device were recorded; the output results were found to be of close enough (less than 1% error) to the reference readings. The temperature sensor 1 (LM 35DZ) is preferred than the temperature sensor 2 (body temperature sensor of two-wire). The pressure sensor (BMP085) and the strain gauge sensor have achieved the same results. The percentage error for the first sensor used to measure the heart rate based on the pulse sensor is 2.980665951%, 1.589186744% while the percentage error of the second sensor based on the IR physics is 2.841520258% and 0.999942532%. According to the calculated percentage error, the IR sensor is preferred over the pulse sensor. From this comparison, we conclude that the use of the proposed device can achieve an excellent accuracy where the obtained results are close to the reference readings. From the design structure point of view, the proposed system was built using microcontroller (ATmega328P) and a group of sensors. It can be used at home due to its low cost, easy to use, and high accuracy. Finally, the use of fuzzy logic rule-based classifiers is an effective tool for accurate diagnosis of heart rate, blood pressure and temperature measurements.