Dynamic Compensation Method for Humidity Sensors Based on Temperature and Humidity Decoupling

Currently, integrated humidity sensors with fast-response time are widely needed. The most commonly used polyimide capacitive humidity sensor has a long response time, which is difficult to meet the need for a fast response. Most studies focusing on technology and materials have a high cost and are difficult to ensure compatability with the CMOS process. The dynamic compensation method can shorten the response time by only adding digital circuits or software processing. However, conventional compensation technology is not suitable for humidity sensors due to temperature coupling. This paper proposes a new dynamic compensation method for humidity sensors based on the decoupling of temperature factors by analyzing the coupling relationship between sensor dynamic characteristics and temperature. Simulations and experiments were used to verify the proposed method. The experimental results show that the proposed method reduces the humidity response time of the sensor by 85.6%. The proposed method can effectively shorten the response time of humidity sensors.


Introduction
The integrated sensors, which include sensing front-end circuits, an analog-to-digital converter, and a digital processing part, are developed rapidly due to their low cost, small size, and ease of use. Humidity sensors are widely used in many applications, such as environmental monitoring (e.g., indoor climate control in smart houses or industrial production), process control (e.g., high reliability in integrated circuit fabrication), medical equipment, and biotechnology [1][2][3][4][5]. In addition, sensors with a rapid response time are required in areas such as respiratory monitoring and semiconducting process control [6][7][8][9][10]. These scenarios require the response and recovery times of the humidity sensors to be around 1 s [10]. However, most commercial integrated humidity sensors have a response time of more than 8 s. Therefore, the above requirements could not be met.
There are two methods to achieve a fast-response humidity sensor. One way to improve the response speed is to increase the contact area between the probe and the air using specific process technologies, such as new moisture-sensitive materials, ultra-thin moisture-sensitive films, special moisture-sensitive probe structures, and surface treatment of the moisture-sensitive layer [6][7][8][9][10][11][12][13][14][15][16]. Uksong Kang et al. reported a capacitive humidity sensor that used multiple polyimide cylinders with a diameter of several microns as the probe [11]. This structure could help improve the sensor's response time to 1 s. In the work of Nimmakayala V.V. Subbarao et al., an OFETs-based humidity sensor was fabricated [15]. The experiments showed that this material-based sensor demonstrated a response time of 0.73 s and a recovery time of 0.52 s. Cheng Zhou et al. proposed a new humidity sensor realized with nanowire arrays [8]. The nanowire arrays were fabricated on a flexible substrate. The sensor had a response time of 0.63 s and was used in respiratory monitoring. A polyelectrolyte-based humidity sensor with a response/recovery time of 0.29/0.47 s is presented by Jianxun Dai et al. [10]. Although special process technologies can improve the response time of humidity sensors, such a method can increase the process complexity and cost, making it difficult to be compatible with the CMOS process. Therefore, it is difficult to be used in integrated humidity sensors.
The other way to improve the response time is to compensate the sensor output dynamically. Dynamic distortions are compensated by digitally processing the sensor output, and results can be obtained as close as possible to the actual measurement values [17][18][19][20]. This method only requires adding part of the digital circuits, which is easy to implement in the CMOS process. Dynamic compensation technology has been employed in temperature sensors [21] and stress and pressure sensors [22][23][24]. The models of these sensors can be regarded as a linear time-invariant (LTI) system. However, humidity sensors are not linearly time-invariant with respect to temperature changes due to temperature coupling. Therefore, applying the existing dynamic compensation methods to humidity sensors is challenging.
This paper aims to solve the effect of temperature coupling on humidity sensors and improve the response time with a dynamic compensation method. A dynamic compensation algorithm is proposed based on temperature and humidity decoupling by modeling and analyzing the coupling effect of temperature on sensing humidity. After decoupling, the sensor system is transformed into a linearly time-invariant system, and the dynamic compensation is realized. The rest of this study is organized as follows. First, Section 2 analyzes the temperature coupling effect in the humidity-sensing process. Second, the overall principles of the proposed compensation are explained in Section 3. Then, simulation and experimental results are provided in Section 4. Section 5 discusses humidity sensor recovery time and the long-term stability of dynamic characteristics. Finally, the conclusion is presented in Section 6.

Humidity-Sensing Mechanism
First, the humidity-sensing process is analyzed. The media and structures of capacitive humidity sensors are various. This paper studies a common type of sensor as an example. As shown in Figure 1, the medium of this sensor is polyimide, and its probe consists of comb-shaped electrodes. The concentration of water molecules in the air above the electrodes varies with the relative humidity or temperature of the environment. When the concentration of water molecules changes, the dynamic diffusion equilibrium between water molecules in the pores of the polyimide medium and those in the air is disrupted. As a result, water molecules begin to diffuse in one direction. The diffusion direction and speed are determined by the temperature and the difference in the concentration of water molecules in the medium and the air. Therefore, the concentration of water molecules in the medium changes. Furthermore, since water molecules distributed in the polyimide medium are electrically polarized by an external electric field, the concentration of water molecules determines the capacitance value of the probe.
In order to catch the main factors affecting the dynamic characteristics of a sensor, the following assumptions are made: i.
Medium is homogeneous. A polyimide probe is a uniformly isotropic porous medium with the same porosity. The change in diffusivity is consistent with temperature. Gases, including water vapor in the medium, are ideal gases that do not react with the polyimide medium. Ignoring the diffusion resistance of the film surface, the water vapor concentration at the contact position between the medium and the air is uniform and the same as those in the ambient air.
ii. The temperature is uniform. In polyimide probes, the diffusion equations for temperature transfer and water molecule transfer take the same form. However, the thermal diffusivity in polyimide and silicon wafers is much greater than the water molecule diffusivity in polyimide. As shown in Table 1, some materials have thermal diffusivities that are 106 times higher than the diffusivity of water molecules. Assuming a response time of 10 s for the humidity sensor, the thermal diffusion time is less than 1 ms. Therefore, when modeling the dynamic process of water molecule diffusion, the temperature in the sensor Tsensors can be considered to be uniform. iii. Signal processing time can be ignored. This is because the time required for signal amplification and digitization of the probe is milliseconds.  As shown in Figure 2, the humidity-sensing process is divided into two parts. In Process A, the temperature and humidity changes in the air determine the concentration of water molecules in the probe. The dynamic change process of environmental temperature and humidity affects the distribution of water molecules in the probe. In Process B, the current concentration of water molecules in the probe determines the sensor reading. Considering that the signal processing and conversion times are negligible, this process can be considered static.
The integrated humidity sensor is calibrated so that the sensor readings correspond to the correct water molecule concentration in the probe. Therefore, the concentration of water molecules in the probe corresponds linearly to the sensor readings in Process B. Process A, in which atmospheric water molecules diffuse into the probe medium, is the main process affecting the dynamic properties of the humidity sensor.  The relationship between the concentration of water molecules in the air and the humidity is given by Equation (1): (1) where N in is the concentration of water molecules in the air, RH in is the percentage of ambient relative humidity, ρ v (T) is the density of saturated vapor at temperature T, which varies with T, and M is the molar mass of water. The curve of ρ v (T), as a function of temperature, is shown in Figure 3. Figure 3 and Equation (1) show that RH in changes with ρ v (T) even if N in is constant, i.e., RH in itself is coupled with temperature. The change in N in diffuses into the polyimide layer of the probe. This diffusion of water molecules can be described according to Fick's law as follows: where t is the diffusion time, N is the concentration of water molecules in the polyimide probe, N = N(x, y, z, t present ), and D e is the effective diffusion coefficient of water molecules diffusing through the polyimide. The boundaries of the polyimide medium can be divided into two parts. One boundary (S air ) is in contact with the air (Boundary 1 in Figure 1). The other (S close ) is the boundary where no exchange of water molecules occurs (Boundaries 2 to 5 in Figure 1, including Boundary 2 for symmetry). Ignoring the force exerted on the water molecules that pass through S air and enter the air-medium film, the boundary conditions for Equation (2) can be written as follows: where N(x, y, z, 0) is the concentration of water molecules in the polyimide probe when t = 0. Process A is a definite solution problem consisting of the diffusion Equation (2) and boundary conditions Equations (3) to (5). The coupling effect of temperature on humidity sensing is found to be mainly in two aspects: i. According to Equation (1), RH in is affected by both temperature and N in . ii. Since D e is affected by temperature, the diffusion Equation (2) is coupled with temperature. The relationship between D e and temperature is written as follows [25]: where T 0 is the reference temperature, and D e0 is the diffusion coefficient at the reference temperature. The above two coupling influences are present in most humidity sensors. The first influence is suitable for humidity sensors measuring relative humidity. The second influence is suitable for most humidity sensors because even though different humidity sensors convert humidity into different physical quantities, most sensors measure humidity depending on the concentration of water molecules in the moisture-sensitive material. For water molecules diffusing through different moisture-sensing materials, only the relationship between diffusion coefficient and temperature differs from Equation (6).

Process B
Process A determines the water molecule concentration distribution in the PI membrane, since water molecules are polarized in an electric field, a change in water molecule concentration N changes the probe's dielectric constant, leading to a change in the probe's capacitance. The capacitance of the probe can be obtained from the empirical formula for the relationship between dielectric constant change, water molecule concentration, and the electrostatic field equation [26]. The above empirical formula can be obtained by substituting Equations (8)-(10) into Equation (7).
where ε PI * is the relative permittivity for the mixture of polyimide and water, ε PI is the relative permittivity for pure polyimide, and ε H2O is the relative permittivity for water.
The concentration distribution of water molecules in the PI film determines the dielectric constant distribution of the capacitive medium of the probe. After determining the boundary conditions of the electric field (potential difference between the positive and negative electrodes, grounding of the substrate, etc.), the electric displacement vectors D and the electric field strength E can be obtained through the electrostatic field equation: where ρ f is the surface density of free charge, which is 0 inside the PI film. From the above results, we can integrate the entire domain Ω to find the electrostatic energy W carried by the capacitor: So far, we can find the capacitance value: where U is the potential difference between the electrodes. We tested the capacitance value of the capacitance probe samples we designed and tapeout under different temperatures and humidity. Figure 4 is the average result of 7 samples. It can be seen from Figure 4 that the capacitance value of our capacitance probe sample is hardly affected by temperature, and the main influencing factor is the relative humidity value. Under the condition that the geometry of the probe does not change, it shows that the dielectric constant of the polyimide film coated on the probe also mainly changes with relative humidity, but hardly changes with temperature.
The temperature and humidity characteristic curve must be calibrated before the temperature and humidity sensor leaves the factory. The probe capacitance hardly changes with the temperature, which greatly reduces the calibration cost of the humidity sensor. The calibrated temperature and humidity sensor ensures the accuracy of the output results in the steady state and also calibrates the measurement deviation caused by the nonlinearity of the PI dielectric constant or the influence of temperature in Process B. Therefore, the dynamic characteristics of a well-calibrated humidity sensor are negligibly affected by the factors in Process B.

The Principle of Dynamic Compensation for LTI System
The conventional dynamic compensation method for an LTI system is introduced in this section firstly. The compensation process is shown in Figure 5. The transfer function of a sensor and compensation filter are Σ s (z −1 ) and Σ c (z −1 ), respectively. The dynamic characteristics of the sensor Σ s (z −1 ) can be compensated using a series compensation filter Σ c (z −1 ). The parameters of Σ c (z −1 ) can be obtained by parameter identification from the experimental data u in,ex and y out,ex during the off-line stage. The specific solution method is explained in the next section. Suppose that the compensation filter transfer function is as follows: The output compensation series is as follows: The case of k − n ≤ 0 occurs when compensating for the first few samples, so we need the given pre-measurement data. In this case, the sensor is in a steady state before the measurement, i.e., when k − n ≤ 0.

Solving the Compensation System
The purpose of solving the compensation system is to obtain the parameter of the compensation filter. The most direct way to solve the compensation filter is to find the inverse system of the sensor system Σ s (z −1 ). However, there are cases where the inverse system Σ s −1 (z −1 ) does not exist or causes divergence in compensation results. In this case, an optimal approximation of the inverse system Σ s −1 (z −1 ) can be obtained by the least-squares method or particle swarm optimization to ensure convergence of the compensation system.
In order to identify the parameters of Σ c (z −1 ), an offline experiment is performed. In the experiment, a controlled input series u in,ex (k) and the output series y out,ex (k) of the sensor are obtained as the apriori information for the parameter identification. The aim of the parameter identification is to make the compensated series x inC (k) most approximate to the input series u in,ex (k).
Considering the feasibility of the experimental design and the accuracy of the compensation, the step-change condition of the external environmental humidity is adopted in our experiment. To identify the parameters of Σ c (z −1 ), the order of Σ c (z −1 ), or n in (15), must first be determined. After comparing the residuals of models of different orders, the appropriate model order can be judged. Once the model order is determined, the difference equation for the transfer characteristics of the digital compensation filter can be expressed as follows: Our goal is to find the optimal solution for the digital compensation filter parameters to minimize the following objective function J where, Σ c d (z −1 ) = 1 + d 1 z −1 + . . . + d n z −n , and Σ c c (z −1 ) = c 0 + c 1 z −1 + . . . + c n z −n . In this paper, particle swarm optimization is used to solve the optimal approximation of Σ c (z −1 ).
It should be noted that due to the temperature influence on the humidity sensor output, the solution of Σ c d (z −1 ) and Σ c c (z −1 ) for a humidity sensor only corresponds to a single temperature. Namely, every temperature needs a new series of compensation parameters. Therefore, the conventional method is not suitable for humidity sensors.

Dynamic Compensation Based on Temperature and Humidity Decoupling
A new dynamic compensation method based on temperature and humidity decoupling is proposed in this section. To eliminate the influence of temperature coupling factors, two decoupling procedures are designed to ensure an effective compensation when the temperature changes. Figure 6 shows the overall compensation process for the humidity sensor. The temperature decoupling of RH is performed before the compensation filter. The parameters of the compensation filter are also obtained from an offline experiment. During the experiment, temperature decoupling of D e is introduced. These two decoupling procedures will be introduced in two subsections of this section. The low-pass filters are added to the compensation process to reduce the high-frequency noise amplified by dynamic compensation.
3.3.1. Temperature Decoupling of RH As described in Section 3, relative humidity is related to temperature while water molecule concentration is not, so the temperature factor in RH can be decoupled by converting the compensation variable from relative humidity to water molecule concentration. The relative humidity output of the humidity sensor RH out (k) can be converted into the water molecule concentration output N out (k) by Equation (1). After the compensation is completed, the compensated results N inC (k) are restored to the relative humidity result RH inC (k).
It should be emphasized that the temperature used during RH decoupling is the temperature measurement results of the sensor, T sensor , and the temperature used during RH recovery is the ambient air temperature T air . Because T sensor is usually delayed from actual ambient air temperature, T air is obtained by dynamic compensation of T sensor using the conventional method described in Sections 3.1 and 3.2.

Temperature Decoupling of D e
After the temperature decoupling of RH, it is only necessary to focus on the diffusion coefficient D e . It can be seen that temperature affects the diffusing process of water molecules through D e in Equation (2). The method of decoupling the temperature factor of D e is to use variable substitution so that an equivalent diffusing process is not affected by temperature.
Variable substitution: where T 0 is the reference temperature. Then, the following relationship is obtained Substitute (21) into the diffusion Equation (2) to obtain After replacing time t with t*, Equation (22) is not affected by temperature, i.e., the sensor system with time t* (regarded as Σ s * (s)) has the same parameters as the system with time t at the temperature T 0 (regarded as Σ s0 (s)). The meaning of the variable substitution is to make the time change rate of t* proportional to D e so that the diffusion Equation (22) with time t* is not affected by temperature. In the following discussion, t* refers to the time after substitution.
Because the diffusing process of a humidity sensor in the t* domain is temperature independent, the sensor system Σ s * (s) can be compensated by a method similar to the conventional technology. However, since the sampling of Σ s * (s) in the t* domain is unequally spaced, the parameters of compensation filter Σ c * are not constant. The compensation filter system is regarded as Σ c * (z −1 , k). As shown in Figure 6, the temperature decoupling of D e works during the offline experiment to obtain the variable compensation parameters.
The relationship between the sensor systems Σ s * (s) and Σ s0 (s) discussed earlier is for a continuous system. When time t is replaced by t*, the temperature factor is decoupled, but the compensation filter system Σ c * (z −1 , k) must be solved at t* to compensate the sensor. It is important to note that when t* replaces t, the sampling points correspond one-to-one, and the sampled sensor systems Σ s * (z −1 , k) and Σ s (z −1 , k) are identical. Therefore, Σ c * (z −1 , k) can be used to compensate the sensor system Σ s (z −1 , k) with time t. The required compensation system Σ c * (z −1 , k) can be obtained by the compensation system Σ c0 (z −1 ) at a constant temperature. Σ c0 (z −1 ) can be solved by the conventional method. The process of solving Σ c * (z −1 , k) from Σ c0 (z −1 ) is shown in Figure 7. Σ s0 (s) and Σ c0 (s) are the continuous sensor and compensation systems at time t and temperature T 0 . Σ s * (s) and Σ c * (s) are the continuous sensor and compensation systems at time t * . It should be noted that Σ s0 (s) and Σ s * (s) have the same mathematical form. Σ c * (z −1 , k) can be sampled by Σ c * (s), and Σ c0 (s) can be recurrenced from Σ c0 (z −1 ). k represents the change in the transfer function of the system over time. N in (t), N out (t), and N inC (t) are the environmental input, sensor output, and compensation signals of water molecule concentration, respectively. Now we specifically solve Σ c * (z −1 , k) from Σ c0 (z −1 ). Suppose the identified Σ c0 (z −1 ) as follows: Information is lost during the sampling, and the state of the system at each moment cannot be known. To solve Σ c * (z −1 , k), the temperature T(t*) at each moment must be given continuously. Therefore, the temperature at each moment must be estimated. For simplicity, we assume that the temperature between two samples is equal to the temperature measured in the previous sample, which is expressed as follows: Considering T(1) as time t = 0, the sampled t*(k) can be obtained from Equation (20) as follows: Substitute the relationship between t* and t into T(t) to obtain T(t*). The sampling time is related to: We need to solve the following transfer function of the non-uniform sampling compensation system.
In the subsequent analysis, the state-space model of the system is used. The state-space models corresponding to the transfer functions Σ c0 (z −1 ) and Σ c * (z −1 , k) are as follows: where x(k) is the state variable. A, B, C, and D are the state-space model parameters obtained from the transfer function parameter in Equation (23). We aim to solve the parameters A n , B n , C, and D in Σ c * (z −1 , k).
The temperature and humidity output by the sensor between the two sampling points is assumed to be constant with the results of the previous sampling point. The compensation system is an LTI system with constant inputs between the two sampling points. The state transition matrix (STM) can represent the system state change between the two sampling points. The STMs at the t domain and t* domain are as follows.
Since Σ s0 (s) and Σ s * (s) are identical in physics, the corresponding Σ c0 (s) and Σ c * (s) have the same parameters, and Φ τ is equal to Φ τ* .
Φ 0 can be obtained from the parameters of the state-space model in Equation (28).
The relationship between Φ k * and Φ 0 is as follows: Then The parameters of the system Σ c * (z −1 , k) in Equation (27) can be obtained from A k , B k , C, and D.

Simulations
The finite element method is used to simulate the operating process of the humidity sensor, and the software used for the simulation is COMSOL Multiphysics. The dynamic output results of the humidity sensor under different temperatures and humidity are obtained and compensated by the dynamic compensation methods. Finally, the compensation results are compared with the given environmental humidity changes. To verify the effectiveness of the proposed dynamic compensation method, it is compared with the conventional method [23].
The simulation uses a polyimide humidity sensor in Figure 1 as an example. The simulation of the humidity-sensing process for this sensor is divided into three parts. The first is to simulate the diffusion process of water molecules in the probe under the corresponding temperature and humidity environment. The second is to simulate the electric field in the probe and obtain the capacitance change of the probe. The third is to simulate the built-in digital calibration of the humidity sensor through the difference between humidity, capacitance, and temperature under steady-state conditions.
The simulation equations and boundary conditions for the diffusion of water molecules in the probe use the definite solutions given by Equations (2) to (5). For simplicity, the sensor temperature is considered to be the same as the ambient temperature in the simulation. Figure 8 shows that during the simulation, the specific change process of the water molecule concentration distribution N in the probe changes over time as the air humidity changes (increases) stepwise. After the water molecule concentration distribution is obtained, the dielectric constant distribution in the probe can be obtained from Equations (7) to (10), and the capacitance value of the probe can be obtained through Equations (11) to (14). In the actual sensor, the humidity output is obtained through signal processing and digital calibration of the capacitance change of the probe. In the simulation, we realize the function by mapping the capacitance and temperature to the humidity. This function is obtained by interpolating the capacitance value of each temperature and humidity point in a steady state.
The first verification is carried out when the temperature is constant, and the humidity changes. Two humidity change forms are considered. One is a step change, and the other is a sinusoidal change. The results are shown in Figure 9. Parameters of the compensation filter Σ c0 (z −1 ) are as follows: Figure 9 shows that when the temperature is constant, both the conventional method and the proposed method can compensate for the output of the humidity sensor to make it close to the changes in ambient humidity. The response time is t 63.2% , that is, the time when the output response reaches 63.2% of the input response ∆. The response time of the sensor system in Figure 9a is 13 s, and the response time after compensation by the conventional method is 2.8 s. The response time after compensation of the proposed method is 2.1 s, which shortens the sensor response time by 83.8%.
The second verification is carried out when temperature and humidity change at the same time. Four kinds of changes are considered, i.e., simultaneous step change of temperature and humidity, temperature and humidity staggered step change, sinusoidal temperature change and humidity step change, and temperature and humidity both sinusoidal change. The results are shown in Figure 10. Parameters of compensation filter Σ c0 (z −1 ) are the same as Equation (37). Figure 10a,b show that when the temperature and humidity change stepwise, the conventional compensation method has a significant deviation after the step change, the compensation result gradually approaches the ambient humidity after the temperature and humidity are stable for some time. Meanwhile, the proposed compensation method can yield an accurate ambient humidity value relatively quickly. Figure 10c,d show that the conventional method completely fails when the temperature has a sinusoidal change, while the proposed method can still ensure that the compensation value is close to the ambient humidity value. The response time of the sensor system in Figure 10a is 13 s, and the response time after compensation by the conventional method is 2.3 s. The response time after compensation of the proposed method is 1.8 s, which shortens the sensor response time by 86.2%. Figure 10e verifies the reproducibility of the proposed method.

Experiments
To verify the effectiveness of the proposed method, an experimental platform is set up, as shown in Figure 11. To generate a dynamically changing environment, the high-precision probe is switched between two steady-state temperature and humidity environments built by the air environment and the reference generator, respectively. The temperature and humidity generator used in the experiment is HG2-S of ROTRONIC Company, and the temperature and humidity sensor samples are HDC1080 of TI Company and integrated sensor samples designed by ourselves.
The results are shown in Figure 12. In the experimental verification, Figure 12a,b are the compensation results of TI's sample HDC1080, and its compensation filter is Σ c01 (z −1 ). Figure 12c,d are the compensation results of our own designed temperature and humidity sensor samples. The compensation filter is Σ c02 (z −1 ).
The parameters of the compensation filter in the experimental verification are as follows: It can be seen in Figure 12 that the proposed method can perform effective dynamic compensation for the integrated temperature and humidity sensor with less distortion and faster response than that of the conventional method. The response time of the sensor system in Figure 12a is 25.5 s, and the response time after compensation by the conventional method is 17.9 s. The response time after compensation of the proposed method is 4.0 s. The corresponding response times in Figure 12b are 38.9 s, 32.0 s, and 5.1 s, respectively. From the averaged response times in Figure 12a,b, it can be seen that the proposed method reduces the response time of the humidity sensor by 85.6%, which is 19.1% using the conventional method. It can be seen from Figure 12c,d that the compensation of the traditional method has failed, and the proposed method can still perform dynamic compensation for the sensor output results.  . The experimental environment includes an integrated temperature and humidity sensor to be compensated, a reference generator for generating a stable temperature and humidity calibration environment, a high-precision probe for calibrating ambient temperature and humidity, and a host computer for data collection.

Discussion
The dynamic compensation model proposed above is actually the condition that the recovery and response time are the same. Under this condition, the response and recovery process has the same transfer function, and the transfer function of the response process can be used to dynamically compensate the humidity sensor. However, due to the force between the moisture-sensing medium and water molecules, the response time and recovery time of some humidity sensors are not the same, especially for some fastresponse humidity sensors, which use this effect to achieve rapid moisture absorption. If the proposed dynamic compensation method is to be used to compensate for this kind of humidity sensor, the process of moisture absorption and dehumidification needs to use two compensation filters with different parameters (the parameters of which need to be identified from the experimental data of the response and recovery process respectively), and it is also necessary to It is judged whether it is currently hygroscopic or dehumidified. The judgment method can select the faster one of response time and recovery time then use its corresponding compensation filter to compensate and see if the compensation result is higher or lower than the current humidity value to judge whether the compensation filter currently used is correct. If not correct, another compensation filter is used. The reason for choosing the faster one for the response and recovery time is that when we compensate for the faster process with another compensation filter (which amplifies the high-frequency noise more strongly), it creates a situation where the compensation result diverges. Unfortunately, our current research work has not been able to verify the dynamic compensation method when the response time and recovery time are different, so this part of the content is put in the discussion.
The long-term stability of the humidity sensor is a key factor affecting its measurement accuracy, but its research is mainly in steady-state measurement. Long-term drift also affects dynamic characteristics. For example, if the sensor is stored in a high-humidity environment for a long time, it will not be able to return to a dry state, and the influence of this phenomenon can be basically eliminated by heating. However, the influence of different external conditions on the long-term stability of dynamic characteristics, the extent to which this long-term drift is irreversible, and whether it affects the correctness of dynamic compensation results, etc., require further research.

Conclusions
This paper proposed a new dynamic compensation method for humidity sensors based on the decoupling of temperature and humidity by analyzing the coupling relationship between humidity and temperature in capacitive humidity sensors. The proposed method was verified by simulation and experiments. The experiment results show that the response time in the experiment is reduced by 85.6%. This method effectively reduces the deviation caused by the temperature coupling factor compared with the conventional method. The proposed method can still remain accurate when the traditional method can not compensate correctly. The proposed method can be applied to various humidity sensors whose capacitance and resistance change due to the diffusion of water molecules, or to gas sensors that detect the diffusion of gas molecules, simply by adding digital circuits to existing sensors or performing digital processing on a host computer. Therefore, the proposed method can also be easily applied to existing temperature and humidity sensors. For the most commonly used polyimide capacitive integrated humidity sensors, the sensor response time can be reduced to the level required in areas such as respiratory monitoring.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: The study did not report any data.