Novel Flexible Temperature Sensor Based on Polyvinyl Alcohol Acrylamide Hydrogels with Moisture Content Compensation

Flexible temperature sensors are of considerable importance in many industrial and domestic fields such as medical care, agriculture, and food. We report a novel flexible temperature sensor based on polyvinyl alcohol acrylamide hydrogels with moisture content compensation. Firstly, the flexible temperature sensor was prepared by using graphene as a thermal conductive filler and polyvinyl alcohol and acrylamide as a matrix. Secondly, because the measurement accuracy of the flexible temperature sensor is considerably affected by the moisture content, a design scheme for the flexible temperature sensor with a moisture content compensation model was proposed. Finally, on the basis of the measured data of the flexible temperature sensor under multiple moisture contents, an improved sparrow search algorithm was used to optimize the backpropagation neural network model to compensate for the error caused by changes in moisture content, so as to improve the measurement accuracy of the sensor. The compensation results show that the proposed scheme can significantly reduce the measurement error of the flexible temperature sensor, enabling accurate, reliable, and sustainable monitoring.


Introduction
As basic electronic components, sensors play an irreplaceable role in the fields of communication, computers, and robotics. (1,2)They can detect and perceive external stimuli and changes in the external environment and convert the signals obtained from them into electrical signals or other forms of signal output, which can be analyzed and processed by computers and other intelligent equipment.With the development of society, the range of applications of traditional solid hard sensors has become limited because of their high structural strength, insufficient flexibility, and complex structures. (3)For example, it is difficult Novfor traditional temperature sensors to make adequate contact with the object being measured.In response, flexible temperature sensors with good elasticity and high tensile strength to adapt to the environment have been developed.The flexible temperature sensor can be well attached to the surface of the measured object, so as to better measure the temperature.Because of their softness and high stretchability, flexible temperature sensors have gradually become the focus of wearable sensor research. (4)olyvinyl alcohol hydrogels have high light transmission, chemical stability, and biocompatibility. (5)However, their limited flexibility and ductility mean that they can easily break when they are used in applications, restricting their use.However a polyvinyl alcohol acrylamide hydrogel can be obtained by crosslinking a polyvinyl alcohol hydrogel and acrylamide at a low temperature.This hydrogel retains the electrical conductivity of polyvinyl alcohol and has high stretchability owing to the addition of acrylamide.Ion migration in polyvinyl alcohol acrylamide hydrogels is a key feature determining their properties.In particular, internal ions are an important factor affecting their conductivity.The rapid migration of ions can be controlled by the addition of ionic electrolytes, which affect their conductivity.In addition, the conductivity of different ionic electrolytes added will also be different. (6)raphene is a 2D crystal comprising carbon atoms.Its structure is similar to a honeycomb network, with each small hexagonal unit made of six carbon atoms.Its unique 2D structure makes it very sensitive to its surroundings.Graphene has excellent electrical conductivity, with electrons moving at 1/300 of the speed of light in graphene, faster than electrons in most metals.Moreover, it has very good heat conduction properties.Pure, defect-free monolayer graphene has a thermal conductivity of up to 5300 W/mK, exceeding those of single-walled carbon nanotubes (3500 W/mK) and multiwalled carbon nanotubes (3000 W/mK).In addition, when graphene is used as a carrier, the thermal conductivity can reach 600 W/mK. (7)Graphene has high sensitivity to external temperature changes; thus, it can be combined with polyvinyl alcohol acrylamide hydrogels as a flexible temperature-sensitive material to prepare flexible temperature sensors.
In their application, flexible temperature sensors are often affected by environmental disturbances.Precise compensation is essential in measurements using flexible temperature sensors.Many researchers have examined the precision compensation of sensors and provided solutions.For example, Zhao and Zhu reported that the constant-temperature difference method can easily eliminate the temperature drift of a flexible sensor. (8)Wang et al. proposed a new temperature compensation method based on flexible sensors, where a compensated thermistor sheet with a similar geometry and the same material as the sensing thermistor is integrated into a Wheatstone bridge feedback circuit.When the sensing and compensating thermistors are geometrically similar, temperature compensation can be self-maintained by the feedback control of the circuit. (9)However, because most compensation methods are based on hardware components, such as bridge circuits, which are time-consuming and difficult to debug, software compensation methods have received more attention in recent years. (10)A backpropagation (BP) neural network is a type of multilayer feedforward artificial neural network with continuous transfer function.It is trained by the error BP algorithm, and the weight and threshold of the network are constantly modified to minimize the mean square error.A BP neural network has a strong nonlinear mapping ability and a flexible network structure, resulting in its widespread use in sensor accuracy compensation. (11)With the rapid development of swarm intelligence algorithms, swarm intelligence algorithms have been widely used to optimize the initial weights and thresholds of neural networks and have achieved good results.
With this background, to address the problem that the measurement accuracy of flexible temperature sensors is considerably affected by the moisture content, we propose in this paper a design scheme for a flexible temperature sensor with a moisture content compensation model.First, a flexible temperature sensor based on polyvinyl alcohol, acrylamide, and graphene was prepared.Secondly, its performance was evaluated.The test results indicated that the moisture content affected the electrical performance of the sensor.Because of the advantages of the sparrow search algorithm (SSA), namely, few parameters, a simple framework, and fast convergence, we proposed a BP neural network model optimized by SSA.Then, by combining the optimized BP neural network model with the measurement data of the sensor under the calibration test, a moisture content compensation model was established.We found that the output temperature of the flexible temperature sensor with the optimized BP neural network model was closer to the calibration value than those of the other compensation models.Thus, the sensor can provide an effective means for the real-time monitoring of the environment.

Fabrication of polyvinyl alcohol acrylamide hydrogels
The specific preparation steps were as follows: First, an electronic balance was used to weigh 1 g of polyvinyl alcohol and 0.5 g of acrylamide.Then, 25 ml of deionized water was added to a beaker, followed by polyvinyl alcohol and acrylamide, and the mixture was heated in a water bath at 85 ℃ for 1 h.Then, 0.1 g of graphene was added to the solution, which was stirred continuously for 30 min.Then, 0.05 g of N.N'-methylenebisacrylamide, two drops of N.N.N.Ntetramethylethylenediamine, and 0.05 g of ammonium persulfate, and 0.8 g barium titanate were added to the solution, which was stirred continuously until it thickened.The beaker was then removed from the magnetic stirrer and the solution was poured onto a glass plate and flattened with another glass plate.This was followed by refrigeration at −5 ℃ for 12 h, thawing at room temperature for 8 h, waiting for the internal water to melt, and finally preparing polyvinyl alcohol acrylamide hydrogels.The fabrication of polyvinyl alcohol acrylamide hydrogels is illustrated in Fig. 1(a).Graphene has excellent electrical conductivity and very good heat conduction properties.Because acrylamide hydrogels contain graphene, which can respond quickly to temperature changes, flexible temperature sensors can be prepared.As the external temperature increases, the resistance of the sensor decreases, as shown in Fig. 1(b).

Cyclic voltammetry
Cyclic voltammetry (CV) is a common electrochemical analysis method that controls the rate of change in the potential applied to an electrode and records the curve generated by the change in current potential with time through the single or repeated scanning of the triangular waveform.The adjustment potential window for electrochemical testing was set at 0.2-0.8V, and CV tests were performed on flexible temperature sensors with different moisture contents at cycle rates of 50-400 m﹒s -1 .The test results are shown in Figs.2(a)-2(d).We selected 0.35, 0.45, 0.55, and 0.65 as four moisture content test points, where 0.35 refers to a thin slice of the sensor with an area of 0.35 × 0.35 cm 2 .As shown in Fig. 2, the specific capacitance gradually decreases with increasing scanning rate.It was also found that the specific capacitance of the flexible temperature sensor with moisture contents of 0.35 and 0.45 is significantly higher than those for the other moisture contents at a low scanning rate (50 m﹒s -1 ), and the specific capacitance decreases markedly when the scanning rate is gradually increased to medium and high speeds (100-400 m﹒s -1 ).Because the internal moving ions of flexible temperature sensors with different moisture contents differ, the response rate to electrical signals also differs.Therefore, we speculate that the moisture content affects the electrical performance of the flexible temperature sensor.

Galvanostatic charge discharge test
In constant-current charge-discharge detection, also known as the instant potential method, a stimulating current is applied to the outer electrode of a test sample to detect the changes and regularity of the loading voltage on the sample over time under a constant current.We carried out a galvanostatic charge discharge (GCD) test on flexible temperature sensors with different moisture contents.The test conditions for the change in potential were adopted on the basis of previous experience, and the experimental device was set to charge when the voltage was 0 V and discharge when the voltage reached 1 V, and the GCD test was carried out with specific capacities of 1, 5, and 10 A﹒g -1 .As shown in Figs.3(a)-3(c), with increasing current density, the charging time of the flexible temperature sensor gradually decreased.Through the comparison of different moisture contents under specific capacities from 1 to 10 A﹒g -1 , it was found that the charging time of the flexible temperature sensor with moisture contents of 0.55 and 0.65 was significantly longer than those for the other moisture contents.The analysis of the charging time indicated that the moisture content affects the electrical performance of the flexible temperature sensor.

Electrochemical impedance spectroscopy
After CV analysis and the charge discharge experiment, the electrochemical impedance spectroscopy (EIS) analysis of the gel was carried out to further clarify the effect of the moisture content on the electrical performance of the flexible temperature sensor.In this AC impedance test, a low-amplitude sinusoidal AC disturbance potential was applied to the tested sample.Then, the test frequency was adjusted from high to low to detect the changes in the impedance and phase angle of the sample with the applied potential.As shown in the inset of Fig. 3(d), the ideal test sample can be understood as having a fixed capacitance C dl and a low resistance R l connected in parallel, and the impedance Z is a vector obtained by the test method given by Eq.
(1).The EIS curves of the flexible temperature sensors with different moisture contents [Fig.3(d)] indicated that these sensors had different electrical properties.
Here, Z' and Z'' are the real imaginary parts of impedance, respectively.

BP neural network
Although the structure of a BP neural network is relatively simple, it has strong self-learning and curve-fitting abilities. (13)In this study, a BP neural network was used to compensate the moisture content.When designing the structure of a BP neural network, it is necessary to determine the numbers of nodes of the input and output layers and the number of hidden layers.In this paper, the input quantities considered are resistance and moisture content; thus, there are two input layer nodes.The output quantity is temperature; thus, there is one node in the output layer.In our calibration experiment, a total of 77 groups of experimental data at different temperatures and moisture contents were obtained, resulting in 77 input and 77 output samples.From experience, a BP neural network with a single hidden layer can meet the demand of nonlinear approximation; thus, the number of hidden layers was determined to be 1.In accordance with the relationship between the number of neurons, N 1 , in the input layer and the number of neurons, N 2 , in the hidden layer (N 2 = 2N 1 + 1), the number of neurons in the hidden layer was set to 5. The structure of the designed BP neural network is shown in Fig. 4(a).The prediction results of the BP neural network are related to the weights and thresholds between the layers.Their initial values are not processed during initialization and are obtained randomly, making it necessary to use optimization algorithms for processing.

SSA
SSA solves the optimization problem by simulating the behavior of sparrows looking for food and fighting against predators in nature.Sparrow populations, which include discoverers and followers, can be expressed as where d represents the dimension of the variable to be optimized and n represents the number of sparrows.The update formula for discoverers is , , where , X is the position of sparrow i in dimension j at iteration t, respectively represent the alert and safety values, Q is a random number following the standard normal distribution, and L is the 1×d-dimensional all-1 matrix.When R 2 < ST, the foraging environment is safe and the finder can search extensively, and when R 2 ≥ ST, natural enemies are present and all sparrows must leave the current area immediately.
The update formula for followers is , 2 where t worst X is the worst position of the current population, n is the number of sparrows, X p is the best position occupied by a discoverer, A is a 1×d-dimensional matrix with elements of either 1 or −1, and A + = A T (AA T ) −1 .When i > n/2, follower i fails to forage, it is in a very hungry state, its fitness value is poor, and it must fly to other areas to forage.
In addition, the sparrow population must set up an early warning mechanism to avoid predators.Generally, 10 to 20% of the individuals in the population are randomly selected for early warning, and these individuals are called watchmen.The update formula for watchmen is , 1 , , , , +K , ( ) where t best X is the position of the optimal sparrow, β controls the sparrow's flight stride, K ∈ [−1,1], f i , f g , and f w are the fitness values of the current, optimal, and worst individuals, respectively, and ε takes a value close to 0.

Use of tent chaotic map for initialization
Chaos is a special type of aperiodic motion with the characteristics of nonlinearity, ergodicity, universality, and uncertainty.In this paper, the tent chaotic map is used to initialize the sparrow population to make the population distribution more uniform. (14)he tent chaotic map is defined as The tent chaotic map is added to the population initialization: where x ij is the position of the sparrow i in dimension j, X ub and X lb are the upper and lower bounds of the sparrow search space, respectively, and Z ij is the chaotic sequence generated by Eq. ( 6).
To directly reflect the effect of the tent chaotic map in SSA, the distribution in Fig. 4(b) is used on the premise that all methods generate 10 5 chaotic sequences.It can be seen from Fig. 4(b) that the chaotic sequence distribution of the tent map is relatively uniform.

Optimal worst reverse learning initialization
Opposition-based learning is an optimization strategy.By calculating the reverse solution of the current solution, then comparing it with the reverse solution, the optimal solution is selected for the next iteration.Optimal worst reverse learning is used to optimize the best and worst solutions in the algorithm, the main purpose of which is to avoid the current solution falling into a local optimum while simultaneously ensuring the global and local search abilities of the algorithm. (15)o increase the local search ability of SSA and avoid premature convergence, the locations of individuals in the sparrow population are studied by reverse learning using the formula where X best * represents the current optimal reverse position vector, X best represents the current optimal position vector, l b represents the lower limit of the optimal individual, and u b represents the upper limit of the optimal individual.
To increase the global search ability of SSA, the random reverse learning strategy is applied to the individual sparrows with the worst positions in the population as follows: where X worst * represents the current worst reverse position vector, X worst represents the current worst position vector, l b ' represents the lower limit of the worst individual, u b ' represents the upper limit of the worst individual, and rand denotes a random vector.

Elite chaos reverse learning initialization
By combining the above tent chaotic map with optimal worst reverse learning, the elite chaotic reverse learning strategy is obtained, and the initialization of the initial population generates high-quality initial solutions.A flow chart of the specific BP neural network of ISSA is shown in Fig. 4(c).

Acquisition and analysis of experimental data
We carried out a 2D calibration experiment on the flexible temperature sensor and qualitatively concluded that the moisture content affects its measurement accuracy.The experimental data were measured under the following conditions: the experiment was performed in an incubator with constant temperature and humidity (temperature adjustment range: 5-90 °C, humidity adjustment range: 50-90 RH) using flexible temperature sensors with different moisture contents, a CorrTest test system, and a PC.The experimental device is shown in Fig. 5(a).To investigate the electrical characteristics of the flexible temperature sensor under different moisture contents, it is necessary to obtain a sufficient output signal of the sensor and its corresponding temperature data during network training and testing.In the experiment, measurements were taken between 30 and 80 °C at intervals of 5 °C and for moisture contents of 0.35-0.65 at intervals of 0.05.The specific operation process was as follows.
(1) First, adjust the temperature to 30 ℃.After the temperature has stabilized, the output resistance of the flexible temperature sensor with a moisture content of 0.35 is measured.(2) Replace the flexible temperature sensor with one having the next higher moisture content.
When the condition has stabilized, measure the output resistance.Repeat until measurements have been made at all seven moisture contents.(3) Increase the temperature by 5 °C and repeat step 2. Repeat step 3 until 77 values are obtained, one for each temperature-moisture content combination.
Repeat the above specific steps 20 times, and finally find the average value.The experimental results show that the output resistance of the flexible temperature sensor varies with the moisture content at each temperature; thus, the moisture content affects the electrical performance of the sensor.The measurement data obtained from the 2D calibration experiment are shown in Fig. 5(b).
It can be seen from Fig. 5(b) that before moisture content compensation, the input and output of the flexible temperature sensor are considerably affected by the moisture content, that is, when the moisture content of the flexible temperature sensor changes, the output resistance drifts.To better analyze the effect of the moisture content on the measurement accuracy, a quantitative calculation is required.In this paper, three static characteristic parameters are adopted: the room-temperature moisture content coefficient ∂ C , the sensitivity moisture content coefficient ∂ T , and the additional error of the moisture content ∂ H . Here, ∂ C represents the speed at which the resistance changes with the moisture content at room temperature, ∂ T represents the speed at which the sensitivity changes with the moisture content, and ∂ H represents the offset percentage caused by the deviation of the measured moisture content from the calibration.The formulas for the three coefficients are given by

/ ( )
99.80% ( ) where represents the maximum drift value of the resistance caused by different moisture contents when the temperature is 25 °C, ∆H represents the change in the moisture content of the flexible temperature sensor, and R(FS) represents the variation of the resistance in this experiment.At a particular temperature T, the maximum offset of the resistance resulting from a change in moisture content is expressed as We obtained ∂ C = 3.08 /H, ∂ T = 3.33 /H, and ∂ H = 99.80%.Thus, there is considerable room for improving the flexible temperature sensor by compensation for its moisture content.

Random partition
In the moisture content calibration experiment, three sets of values, namely, the moisture content, temperature, and output of the flexible temperature sensor, were processed by three compensation models: BP, SSA-BP, and ISSA-BP.A total of 77 sets of data were obtained through the 2D calibration experiment.They were divided in the ratio of 5:2, with 55 sets of data randomly selected as the training set of the neural network and 22 sets of data selected as the test set.The three compensation models were trained on the experimental data, and the input and output characteristic curves of the flexible temperature sensor after moisture content compensation under a random partition were obtained, as shown in Figs.6(a), 6(c), and 6(e).As indicated from these results, the effect of ISSA-BP compensation is better than those of the other two compensation algorithms in terms of the results of moisture content compensation.After the compensation of the three models, the error is clearly reduced and the accuracy of the measurement results is effectively improved, so that the sensor can better monitor the change of the external environment.
To quantitatively compare the similarities and differences between the SSA-BP and ISSA-BP compensation models and the general BP compensation model, relevant indicators for the three models and the static characteristic parameters of the sensors under the models were calculated and compared.The indicators used were as follows: ) where R 2 is the coefficient of determination, indicating that the greater the goodness of fit, the higher the degree of explanation of the independent variable for the dependent variable, the higher the percentage change of the total change is caused by the independent variable, and the denser the observation points near the regression line.ESS represents the explainable change, TSS represents the total change, RSS represents the unexplained change, and MAE is the average absolute error, representing the average absolute difference between the predicted and true values.The predicted value is predicted i , actual i represents the true value, and MBE is the average relative error, representing the average relative difference between the predicted and true values.
The models established on the basis of the BP, SSA-BP and ISSA-BP algorithms were used to train the sample data obtained from the experiment; then, the training results were tested to calculate the relevant indicators of the three compensation models under the obtained random partition, as shown in Table 1.It can be seen that ISSA-BP > SSA-BP > BP for R 2 , BP > SSA-BP > ISSA-BP for MAE, and BP > SSA-BP > ISSA-BP for MBE.According to the comprehensive evaluation, the relevant indicators are best for the ISSA-BP moisture content compensation model.

Fixed partition
In the fixed partition strategy, data for five moisture contents, 0.35, 0.45, 0.55, 0.60, and 0.65, were used as the training set, and two moisture contents, 0.40 and 0.50, were used as the test set.All parameters were set to be the same as those for the random partition strategy.Figures 6(b), 6(d), and 6(f) show the input and output characteristic curves of the flexible temperature sensor after moisture content compensation under a fixed partition.By comparison with Figs.6(a), 6(c), and 6(e), it can be seen that the compensation method indicators under the ISSA-BP framework do not change markedly, while those for the other compensation methods appear to change significantly, demonstrating the robustness of ISSA-BP.The main reason for the different compensation results for the two partitioning strategies is that the random partition essentially

Performance analysis and comparison
To compare the similarities and differences between the ISSA-BP algorithm and the general BP algorithm, the room-temperature moisture content coefficient ∂ C , the sensitivity moisture content coefficient ∂ T , and the additional error of the moisture content ∂ H were calculated for the output values under random and fixed partitions after moisture content compensation, as respectively shown in Tables 3 and 4. Robustness is improved by compensation, and the effect of the moisture content on the output is considerably reduced, thus improving the measurement accuracy of the system.Among them, the ISSA-BP model has the greatest compensation effect.

Conclusions
In this paper, a design scheme for a flexible temperature sensor with a moisture content compensation model is proposed for accurate temperature measurement.The flexible temperature sensor was prepared by using graphene as a thermal conductive filler and polyvinyl alcohol and acrylamide as a matrix.The sensing principle and electrochemical properties of the flexible temperature sensor were discussed.Experiments showed that the electrical properties of the flexible temperature sensor were different for different moisture contents.To reduce the effect of the moisture content on the measurement accuracy, an ISSA was used to optimize a BP neural network to establish a moisture content compensation model for the sensor.Under the random and fixed partitions, the room-temperature moisture content coefficient decreased from 3.08 to 1.45 and 1.35 /H, the sensitivity moisture content coefficient decreased from 3.32 to 1.98 and 1.84 /H, and the additional error of the moisture content decreased from 99.80 to 70.32 and 66.93%, respectively.The output results of the final test were very close to the calibrated temperatures; thus, we have successfully improved the measurement accuracy, making the temperature measurement of the environment more convenient and effective.

Fig. 4 .
Fig. 4. (Color online) (a) Structure of BP neural network.(b) Distribution of tent chaotic map.(c) Flow chart of BP neural network of ISSA.

Fig. 5 .
Fig. 5. (Color online) (a) Setup of 2D calibration experiment.(b) Measurement data obtained from 2D calibration experimental data on flexible temperature sensor.

Table 1
Calculated relevant indicators of the three models under random partition.coversthesample space more uniformly than the fixed partition, thus obtaining more prior knowledge for the model.In the training test, the formation of the training set is the key to modeling.The model based on the BP, SSA-BP, and ISSA-BP algorithms was used to train the sample data obtained from the experiment; then, the training results were tested to calculate the relevant indicators of the three compensation models under the fixed partition, as shown in Table2.It can be seen that ISSA-BP > SSA-BP > BP for R 2 , BP > SSA-BP > ISSA-BP for MAE, and BP > SSA-BP > ISSA-BP for MBE.According to the comprehensive evaluation, the relevant indicators are best for the ISSA-BP moisture content compensation model.

Table 2
Calculation of relevant indexes of the three models under fixed partition.