Blood-pH Optical Measurement: A Model to Compensate for the Effects of Temperature

Under physiological conditions, the human body maintains blood pH within [7.36, 7.44] pH. Small deviations from this range can reveal the onset of pathological states and worsen the patient’s condition. This article reports the performance analysis of a real-time, noninvasive pH-measuring system for extracorporeal circulation (ECC). In particular, this study focuses on the analysis of the effects that the measurand temperature may have on the error in estimating blood pH. Even if the blood temperature in ECC is often thermostated at 37 °C, there are treatments in which the blood temperature is varied by a few Celsius degrees, and the exploited measurement principle—fluorescence—is known to be affected by temperature. First, we verified that the temperature-induced error could exceed the maximum permissible measurement error of ±0.04 pH. Hence, a linear-correction factor for temperature compensation was proposed. The results obtained showed how the simple addition to the measuring system of a temperature sensor and the use of a linear-correction factor can effectively allow maintaining the measurement error within the ±0.04-pH range, even when the fluid—phosphate buffer saline (PBS) and blood—temperature is varied in the range [30 °C, 39 °C].


I. INTRODUCTION
E XTRACORPOREAL circulation (ECC) generally refers to medical treatments featuring the blood flowing outside the patient's body, artificially supporting or substituting impaired physiological functions. Such treatments are common for critically ill patients, and, sadly, the COVID-19 pandemic had caused a wide increase in the use of ECC treatments. In fact, extracorporeal membrane oxygenation (ECMO) is clinically recommended in case of COVID-19-related acute respiratory failure [1].
Under physiological conditions, the human body keeps blood pH within a very narrow range: [7.36, 7.44] pH. Deviations from this range generally reveal an altered physiological state, and a few tenths out of it might have harmful consequences on the circulatory, respiratory, and cerebral systems, up to the death of the patient [2], [3], [4]. For these reasons, major health organizations include blood pH among the most important parameters to keep continuously monitored during ECC treatments [5], [6], [7].
Given the relevance of pH monitoring in various fields, several measuring systems based on optical [8], [9], [10], [11], [12], [13] and electrochemical [14], [15], [16], [17], [18], [19] methods have been proposed in the literature for industrial, agrifood, and biomedical applications [20], [21]. Besides, commercial devices are available for blood pH measuring during ECC [22]. However, despite the clinical significance of blood-pH monitoring and the recent technological improvements, the complexity and the associated costs make these measuring systems largely inapplicable in the clinical routine. Indeed, requirements in terms of safety and metrological performances (maximum permissible measurement error of ±0.04 pH) are imposed by health organizations [7], [13]. In addition, economic requirements in routine treatments permit the cost per single treatment of pH monitoring not exceeding a few euros. Since safety requires that all the components that come into contact with the patient's blood are sterile and hemocompatible, in clinical practice, they are substantially all disposable. Being disposable imposes that their overall cost has to be extremely limited, preventing the use of classic pH-measuring systems in these clinical settings. Hence, at present, blood pH is not monitored during routine ECC treatments.
To overcome the aforementioned limits, it was recently proposed a measuring system based on the fluorescence analysis technique, that allows in-line, real-time, and noninvasive monitoring of blood pH during ECC procedures [12], [13]. Such a measuring system has proven to meet the safety, metrological, and cost requirements [12]. In addition, it proved to be robust against changes in hematocrit and blood flow [23]. In this article, we investigated and compensated for the measurement error due to the variation of the quantum efficiency of the fluorophore induced by potential variation of the blood temperature, thus extending the analysis and results previously presented at IEEE International Instrumentation and Measurement Technology Conference (I2MTC) 2022 [2].
During ECC, the blood is generally thermostated at the temperature of 37 • C. Thus, previous studies [12], [13], [23], [24] analyzed sensor performances when operating with blood at such a temperature. However, during ECC treatments, blood temperature may be set to different values, usually lower than 37 • C. Some examples are the following-lowering the temperature: 1) to reduce hemolysis risk; 2) to prevent This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ neurological impairments after cardiac arrest in therapeutic hypothermia treatments [25]; and 3) gradually augmenting blood temperature to recover from hypothermia [26].
The quantum efficiency of fluorophores [27], [28], [29] and the pH of blood [30], [31] are known to vary with temperature. However, the precise temperature sensitivity of fluorophores is the result of several factors. Therefore, to extend the applicability of the proposed measuring system to treatments where the blood is not thermostated at 37 • C, it is necessary to verify that the error introduced by blood-temperature variations is not such that it exceeds the maximum permissible measurement error in clinical settings, that is, ±0.04 pH.
In the proceedings paper [2], a preliminary analysis of the effects of the measurand temperature was performed using phosphate buffer saline (PBS). This is a buffer solution commonly used in biomedical research having osmolarity and ion concentrations matching those of human blood, but presenting costs and test complexity significantly lower than those of blood. Such tests revealed that a PBS temperature variation of just a few Celsius degrees causes an error no longer complying with the maximum permissible measurement error [2]. In light of these results, in this article, a more detailed and deepened analysis is carried out by implementing an ECC setup using bovine blood. Tests with blood confirmed that, if not compensated for, a change in temperature of a few degrees Celsius can introduce an unacceptable measurement error. Thus, in this article, a measurement model able to compensate for temperature variations is proposed and validated in blood. Note that, as described in more detail in the following sections, the blood tests revealed variations different from what was previously obtained in PBS, confirming the importance of tests with blood for the precise assessment of sensors performances in complex chemical environments, such as blood.
In the following, Section II briefly describes the pH-measuring system, the experimental setups, and the activities carried out. The main results that were obtained with PBS and the new results obtained with blood tests are reported in Section III. In Section IV, the results are discussed, and the work's limitations, future developments, and main conclusions are reported.

A. Measuring System
As described in [12], to comply with the challenging cost requirements, the pH-measuring system consists of the following: 1) a (very) cost-effective disposable sensor, namely, the cuvette functionalized with the fluorophore, inserted in the tubing line and 2) a nondisposable optical head that contains all the optics, optoelectronics, and electronics required for the pH estimation through the fluorescence signals analysis. Fig. 1 shows a picture of the prototype-measuring system. The measurement principle is based on the ratiometric fluorescence analysis of a pH-sensitive fluorophore [8-hydroxypyrene-1,3,6-trisulfonic acid trisodium salt (HPTS)], which is the main component of the sensing element, deposited on the disposable plastic surface and in direct contact with the patient's blood [12], [13]. As described in more detail in previous papers [12], [13], the use of a ratiometric fluorophore has allowed for an increase in the robustness of the measuring system compared with the previous version based on a nonratiometric fluorophore, i.e., on fluorescein [32].
In agreement with Cattini et al. [12], the pH measurement is based on the calculation of the ratio (R) of the intensities of the fluorescence emitted by HPTS at a wavelength of 520 nm, when it is excited, respectively, with 465-and 405-nm light sources (LEDs). The pH function of R is overall nonlinear, but according to [12], it can be linearized near the pKa of the fluorophore, which, for HPTS, is located approximately in the middle of the physiological range of blood pH.
To allow the analysis of the temperature effect and its subsequent compensation, the measuring system described in [12] and [13] was enhanced with the addition of a real-time temperature acquisition system. Thus, a custom NTC sensor was positioned in line within the tubing system using a Y-connector. The temperature (T ) was acquired, using an Arduino microcontroller and a Labview VI, simultaneously with R, placing the in-line temperature probe as close as possible (less than 20 cm) to the pH sensor to obtain an estimate of blood temperature [2]. In the PBS setup, the fluid flowed because of a roller pump (MasterFlex L/S, declared flow "accuracy" of ±0.5 • C), and its temperature was closed loop controlled using an heat exchanger (Arex hot plate and VTF digital thermoregulator, VELP Scientifica, declared "accuracy" ±0.5 • C).

B. Experimental Setups
The liquid temperature (T ) was measured by the NTC sensor. The pH of the PBS was modified by means of chemical species (i.e., HCl and NaOH) [2].
Blood tests employed 2 L of bovine blood with the addition of citrate-phosphate-dextrose solution with adenine (CPD-A), an anticoagulant that is often used also in clinical ECC procedures [33].
Blood tests have been performed using an ECC machine (Exiper, Medica S.p.a.) implementing the roller pump, the temperature control system (heat exchanger), and the gas  exchanger. The blood's hematocrit was monitored using a Crit-Line III Monitor (Fresenius Medical Care S.p.a., declared "accuracy" ±1%), and, to avoid clots, the blood in the reservoir was kept stirred by means of a magnetic stirrer. The blood temperature was varied by means of the heat exchanger, and the pH of the blood was varied by acting on the gas exchanger (injecting air to increase the pH, injecting CO 2 to decrease the pH). In both the setups, the reference pH meter (model 9125, by Hanna, declared "accuracy" of ±0.01 pH) was inserted in the reservoir. The reference instrument embeds a temperature probe (HI7662 by Hanna, declared "accuracy" ±0.5 • C), for automatic temperature compensation, inserted in the blood reservoir. During the tests with blood, the temperature inside the reservoir was constantly monitored to be coherent with the NTC probe measurement.
The pH-measuring system is inserted in line, and the temperature signal was acquired with the use of the NTC sensor placed near the fluorescent pH sensor under test.
In Fig. 3, a photograph of the setup used during the blood tests is shown. A picture of the setup used for tests with the PBS is reported in the conference proceeding [2]. Since during Test-blood ref rapid temperature variations were performed, in order to reduce possible source of errors in the calibration procedures, only data at blood temperature steady state were considered, in other words, when there were agreement between the temperature measured by the NTC probe near the pH sensor and by the temperature probe of the reference instrument inside the reservoir.
Then, the temperature-compensated models both for PBS and blood were verified using new disposable sensors, that is, using different cuvettes than those used in the Test-PBS ref and Test-PBS C , and Test-PBS D [2]; the model obtained from Test-blood ref was applied for Test-blood MS1 and Test-blood MS2 .
Given the costs and complexities of performing tests with blood, to maximize the output of a single blood-test session, Test-blood MS1 and Test-blood MS2 were performed simultaneously, placing two twin-measuring systems in series in the bloodline at the position indicated by "pH Sensor" in Fig. 2(b). The sampling of the two measuring systems was synchronous. In particular, the two systems had the same nominal sampling period (25 s), and the two acquisitions were simultaneously started at the beginning of the test.
To quantify the error performances, for each test, the rootmean-square error (RMSE) and the maximum error (Error Max) according to the following equations were calculated: where, for each of the four tests, N is the overall number of samples acquired in the test, i ∈ [1, N ] is the index of the sample, and pH est and pH ref are the pH values estimated by the proposed measuring system and by the reference pH meter, respectively.

D. Temperature-Compensated Model
To compensate for the temperature effects, we investigated the effectiveness of a linear independent variable model. The linear model that was previously used to calculate the pH without taking into account the effect of temperature [12] is, thus, simply enhanced with a correction factor γ · (T − T 0 ) where pH 0 is the pH value that corresponds to R = R 0 and T = T 0 = 37 • C. T is the temperature acquired from the in-line NTC sensor, and γ is the temperature sensitivity. α is the sensitivity to pH. The correction factor is, thus, referred to the physiological typical temperature of the body, which is also the constant temperature value of the blood during the previous studies [12], [13], [23].

A. Analysis of the Effects of Temperature
From the data obtained from Test-PBS ref and Test-blood ref , the effects of temperature were analyzed by calculating the error committed by two sensors calibrated as described in [13], that is, calibrated at 37 • C using a measurement model with γ = 0 in (3). Fig. 4 shows that a temperature variation of just a few Celsius degrees from the reference value (37 • C) leads to a significant measurement error that may exceed the maximum permissible measurement error of ±0.04 pH.
From Fig. 4, it is also possible to note the importance of tests carried out with blood. Although the trend of the error as a function of temperature is increasing in both cases, the error with blood is more modest. Indeed, the slope δError/δT obtained with the linear fittings in Fig. 4 is about 0.020 pH/ • C for PBS and about 0.014 pH/ • C for blood.

B. Derivation of the Temperature-Compensated Model
Once the need for a temperature-compensated model was confirmed, the calibration coefficients of the model described in (3) were determined both for PBS and blood.
The obtained coefficients are reported in Table II. More information regarding the PBS tests is in [2].
Also in this case, the comparison of the data reported in Table II shows that the PBS is able to provide an estimate of sensor performances, but these can be accurately determined only with tests carried out with blood. Fig. 5 shows the pH est values for Test-Blood ref obtained using the coefficients obtained from PBS [see Table II (second column)] and the coefficients obtained from blood (see Table II) with and without (γ = 0) the temperature compensation.

C. Verification of the Temperature-Compensated Model
As described in more detail in the conference paper [2], the PBS tests Test-PBS ref , Test-PBS A , Test-PBS B , Test-PBS C , and Test-PBS D confirmed that the use of the linear   temperature-correction factor significantly decreases the RMSE, with an improvement on average on the five tests of about 73% with respect to the case without the temperaturecorrection factor. As described in [2], the use of a specific pH 0 value for each disposable sensor has a significant impact on the RMSE obtained. In fact, with the pH 0 offset adjusted for each sensor, the RMSE was always lower than 0.01 pH, and the average improvement was about 93% with respect to the case without adjustment and temperature correction. The tests carried out with blood, Test-blood MS1 and Test-blood MS2 , also confirmed the validity of the proposed compensation model. Fig. 6 reports pH est , pH (i.e., pH est-MS1 − pH est-MS2 ), and T signals for these tests. pH ranges between [−0.021, 0.019] pH. In addition, the correlation coefficient of measured pH values of Test-blood MS1 and Test-blood MS2 is ρ = 0.9982. Measurement errors obtained using the compensated model (see Table II) with blood are summarized in Table III. Finally, Fig. 7 reports the errors (pH est -pH ref ) obtained using the compensated model (see Table II) with blood as a function of T ; Fig. 8 shows such error values as a function of pH in the form of a Bland-Altman plot.

A. Scope of This Work and Approach
Blood pH provides relevant information on the patient's health status. Therefore, its real-time measurement would provide the physicians with a more complete clinical picture, allowing timely choices before the causes that have altered the blood pH become more evident and severe. Nowadays, several methods and measurement principles allow for pH measurement. However, constraints related to patient safety and treatment costs prevent the use of these techniques for monitoring blood pH in routine treatments. The result is that, to date, the blood pH is not real-time monitored during routine ECC treatments. To overcome these limitations, a measuring system based on disposable fluorescent sensors has recently been proposed [12]. Such a system was designed and tested for use with blood at a temperature of 37 • C, the most common situation for ECC treatments. Nevertheless, there are treatments in which the blood temperature is varied by a few Celsius degrees, generally reduced from the physiological temperature of 37 • C.
Therefore, the first objective of this study was to evaluate whether a modest reduction in temperature introduces an error, such that the measuring system no longer conforms with the maximum permissible measurement error of ±0.04 pH. Once verified that the temperature-induced error could exceed such a limit, a linear-correction factor for temperature compensation was proposed and validated. With this aim, this article presented the analysis both with PBS and bovine blood, by using experimental setups as similar as possible to a real ECC treatment. Given the costs and complexities of performing tests with blood, preliminary tests with PBS allowed a quick and cheap investigation of the temperature dependence, as described in [2].
In this study, bovine blood is used in place of human blood, mainly for ethical reasons, given the significant volumes of blood required for testing (consider that 2 L of blood are more than a blood donor can donate in an entire year). The use of animal blood is largely widespread in preliminary investigations of blood's parameters-measuring systems [21], [34], including also pH-measuring system based on optical [12] and electrochemical [35] methods. Despite that, in such a framework caution is necessary, because human and animal blood are not exactly equal.
In this regard, the experimental results obtained from the bovine blood used are promising. In fact, by analyzing the pH values read by the reference-measuring instrument in the Test-blood ref session as a function of blood temperature inside the reservoir, it was possible to verify that the bovine blood used varied its pH with a slope δpH/δT = −0.0144 pH/ • C (R 2 = 0.9718). This value is consistent with the behavior of human blood reported in the literature. Indeed, in the range [30 • C, 40 • C], the pH of adult human blood varies by −0.0145 pH/ • C [36], [37].

B. Results
Similar to PBS, blood tests confirm that, if not compensated for, a variation in temperature of a few degrees Celsius can introduce an unacceptable measurement error, and that the measurement error as a function of blood temperature is approximately linear, as Fig. 4 clearly shows (R 2 higher than 0.97 and modest error of linearity). Thus, the application of a simple linear temperature-correction factor was proved to be highly beneficial.
In particular, it was proven that a temperature variation of approximately 2 • C in case of PBS and of approximately 3 • C in blood induced an error higher than the maximum permissible value (i.e., ±0.04 pH).
Moreover, also according to [2] and Fig. 5, the use of the obtained temperature-compensated model was proven to be beneficial during the reference tests with PBS and blood, respectively. Fig. 5 clearly shows that without the linearcorrection factor, the measuring system is unable to correctly measure the pH, in agreement with Table III. Finally, additional tests with PBS and blood confirm such conclusions also with different disposable sensors. In fact, the error values with the temperature-correction factor are always lower than without; in the case of blood, according to Table III, and in the case of PBS as described in Section III-C, with more details in [2]. Figs. 7 and 8 report the measurement error of blood tests with the application of the proposed temperature-compensated model as a function of the temperature and pH in the form of a Bland-Altman plot, respectively. From the analysis of these figures, it can be seen that there is no clear trend, confirming the validity of the proposed compensation model.
In addition, in the Bland-Altman plot, the obtained error bias is modest (−0.0015 pH), and the ±1.96 SD lines lie within the acceptable region (i.e., ±0.04 pH). Few outliers in the measurement error during tests with blood are present around 7.25 pH at 35.3 • C (see Figs. 7 and 8), similar to PBS [2], showing how, most likely, the production method of the disposable sensors is not highly repeatable yet.
Besides, in this work, the simultaneous acquisition of two measuring systems with blood is reported (see Fig. 6). Simultaneous measurement allows the direct comparison of twin-measuring systems, and it might be a useful calibration method with high parallelization. According to Fig. 6, the two pH-measuring systems performed repeatable measurements. Indeed, the maximum difference in the measured pH was approximately ±0.02 pH.
In addition, the data collected reveal no different behavior of the measuring system in response to an increase or decrease in blood temperature.
Finally, this work also confirmed the importance of tests with blood for a precise estimation of the temperature dependence of a fluorescence-based measuring system. Indeed, first, Fig. 4 clearly shows how, in the absence of a term for compensation, the measurement error with blood is similar to PBS in the trend but not in the slope. Second, Fig. 5 shows that the model's coefficients obtained with PBS if applied to blood case worsen pH estimation.

C. Limitations and Future Developments
Some limitations of this work are the following: despite we consider steady-state temperature values, as described before, there might be residual error due to the different positions of the pH sensor/NTC probe and reference pH meter with respect to the heat exchanger, as well as due to the distance between the NTC probe and the pH sensor. Furthermore, given the focus on analyzing the performances of the proposed measuring system at different temperatures, the transition from one temperature to another was carried out by operating the heat exchanger of the used ECC machine (Exiper, Medica S.p.a.) at maximum power, thus imposing more severe temperature gradients than gentle variations to which blood is generally subjected when reinfused into the patient. Finally, for this work, bovine blood was used, and, despite we discuss the potential extension of the proposed model on humans in Section IV-A, caution is necessary, because bovine and human blood are not exactly equal.
Future developments will concentrate on further validation of the model with human blood, in vivo testing of the system's stability and repeatability, and possible impacts of blood anticoagulant solutions on the pH-measuring system.
In conclusion, this work confirms the need for temperature compensation in a fluorescence-based blood-pH-measuring system. A linear temperature-correction factor is demonstrated to be highly beneficial. Tests with blood are still strictly necessary for a precise assessment of the correction technique.