An Optimization Approach to Eliminate Crosstalk in Zero-Potential Circuits for Reading Resistive Sensor Arrays

Crosstalk is a well-known problem in resistive sensor arrays (RSAs). The zero-potential method (ZPM) is a commonly used readout circuit that uses multiplexers and demultiplexers to reduce the main sources of crosstalk. However, the internal resistors of these switches cause a secondary crosstalk in the RSA that alters the RSA sensor values read. The solution to the effects of this secondary crosstalk is still a case of study. In previous literature, these resistances have been considered as known and, in most cases, equal for all switch channels. However, in a real situation, they are unknown and may vary between channels. In this work, a least-squares (LSQR) method is presented to obtain the true values of the switches from the read voltage signals. Calibration columns are added to the RSA for this purpose. To prove the performance of the method proposed, several simulations have been carried out with different values of RSA sensors, switch resistances, size of the RSA, and noise level. Results show that the proposed LSQR method allows obtaining simultaneously accurate values for both the RSA sensors and switch internal resistors. In this way, the problem of secondary crosstalk is neutralized. It also shows better performance when compared with existing approaches.


I. INTRODUCTION
R ESISTIVE sensor arrays (RSAs) are a commonly adopted sensing paradigm. This multipoint sensing is useful, for example, in electronic noses (e-noses) [1], gesture recognition [2], or motion tracking [3]. In this kind of circuit configuration, sensors are arranged by connecting conductive rows and columns. Each one is individually addressed using analog multiplexers and demultiplexers (also called switches), which select the row and column associated with each sensor. RSA readings are significantly affected by the crosstalk effect, which is a problem previously studied in literature [4], [5], [6], [7], [8]. This effect appears when the current also flows through columns and rows of the RSA that do not contain the sensor to be measured. Thus, the resistor seen from the readout circuit is an equivalent resistor, but not the target resistor. This is called "primary crosstalk." As the error caused by this effect may be large, different solutions have been proposed in the literature. 1) Hardware Solutions: Additional electronic components are incorporated into the RSA to avoid current flow and thus primary crosstalk. The most usual elements are diodes [9], transistors [10], or both [1]. Due to the integration of new hardware, circuits become more complex and expensive. 2) Improved Readout Circuits: They reduce the primary crosstalk by modifying the basic readout circuit. This is the case of the zero-potential method (ZPM [5], [11], [12], [13]), voltage feedback method (VFM [14]), and their variations such as fast readout zero-potential circuit (FRZPC [15]) or double VFM [16]. Also parallel reading of all columns of the RSA simultaneously can be useful for small RSAs [17]. 3) Software Solutions: Postprocessing solutions have also been adopted to eliminate primary crosstalk. Some of them are based on computer vision techniques [18], [19], numerical algorithms [20], [21], or the fast Fourier transform (FFT) [22].
This article focuses on the ZPM circuit shown in Fig. 1. This configuration would eliminate crosstalk if the components were ideal. However, RSAs are affected by another type of crosstalk, which is caused by the internal nonzero resistances of the multiplexers and demultiplexers used in the readout circuits ( Fig. 2 shows a more realistic representation). These resistors are sometimes referred as R on and R off in datasheets. This effect is called "secondary crosstalk." Previous techniques that faced this secondary crosstalk on ZPM [5], [8] assumed that these internal resistance values are known and equal for all channels of the multiplexers and demultiplexers.
In a real situation, the accurate value of switch resistances is unknown and there may be slight variations among channels due to manufacturing or environmental factors. Therefore, traditional ZPM solutions lead to larger errors in sensor readings when applied in real implementations. This study presents a novel solution to increase the accuracy of the classic ZPM circuit by correcting the effects of the secondary crosstalk in real implementations. For that, a numerical algorithm is proposed. The method proposed in this study estimates both RSA sensor values and true switch resistance values. Its performance is compared to the typical ZPM circuit and existing iterative methods [8] that assume ideal or known models of switch resistors. This study shows that the novel technique proposed significantly reduces errors in RSA sensor measurement. This article is structured as follows: Section II presents a theoretical introduction, where the ZPM circuit is analyzed together with the influence of switch resistors by means of Kirchhoff's Laws. The numerical solution is also explained in this section. Section III describes the different simulations performed in this work. Section IV presents the results of the simulations and comparisons along with the discussion of these results. Finally, Section V draws some conclusions.

II. THEORETICAL BACKGROUND
In this section, first, the ideal ZPM approach is introduced; second, the real ZPM readout circuit considering switch resistors is analyzed; third, a new approach to eliminate crosstalk in the real ZPM circuit is presented.

A. Classic ZPM
The ZPM circuit [5], [9] aims to reduce the effect of primary crosstalk in RSA, which means the influence of other sensors when they are not being scanned. This is done by connecting all rows and columns to the ground, except the row containing the scanned element, which is connected to V CC . This circuit is shown in Fig. 1, where r j i is the resistor connecting the row i to column j. Row subscripts are i = 1, 2, 3, . . . up to N , and the column superscripts are j = A, B, C, . . . up to M (without loss of generality, M is the highest column). The scanned element in this figure, r B 2 , is highlighted in blue.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
In Fig. 1, r B 2 is the scanned element, which is connected to an operational amplifier (OA) with a negative feedback configuration. The current through this sensor is i = g B 2 V CC , where g B 2 is the sensor conductance. The output V o (2, B) is calculated with (1), where R F is the feedback resistance. Note that, if the sensor read is, for example, r A 3 , then V CC must be connected to row 3 and the OA to column A. This figure shows an ideal ZPM circuit, in which the switches present zero resistance through their channels Variations of this method have been implemented to improve accuracy [7], [15]. In ZPM circuits, V CC or ground are connected to the circuit via analog multiplexers and demultiplexers which, in an ideal case, have zero resistance. However, in real applications, resistances are nonzero and this causes none of the rows or columns to be at 0 V or V CC . This effect is called "secondary crosstalk."

B. Switch Resistors as the Source of Secondary Crosstalk
As the multiplexers and demultiplexers in the ZPM circuit have nonzero resistances, errors appear in the sensor readings. Thus, a more realistic ZPM circuit, which is studied in this article, is shown in Fig. 2. Switch resistors r X S are highlighted in red, where X = 1, 2, . . . , N if the resistor belongs to the row switch or, alternatively, X = A, B, . . . , M if it belongs to the column switch. For precision components [23], these resistances are around 1 , but for cheaper ones, this value can reach several tens or hundreds of ohms and cause larger errors [24], [25]. In previous works, these resistances have been considered exactly equal for all switch channels to simplify the calculations [7], [22], [26], [27]. However, this assumption may not be correct, as manufacturing processes are not ideal and components degrade over time. Thus, a calibration process would be necessary.
To study the influence of these resistors on sensor readout, a circuit analysis of the RSA is performed. Kirchhoff's First Law is applied to obtain the row and column voltages (V i and V j ) of the circuit shown in Fig. 2. Current entering the row where V CC is connected is calculated with (2). The voltages in the rest of the rows are calculated by (3), which is the same as (2) but substituting V CC for 0 V. Current entering the column j, called I c ( j), is calculated with (4). In these equations, V i is the voltage in row i, and V j is the voltage in column j. The resistor in position (i, j) in the RSA is r j i , and its corresponding conductance is g j i . Conductances g i S and g j S belong to the row and column switches, respectively, Thus, a linear system of N + M unknowns is obtained, where the unknowns are the rows and columns voltages. In the case of Fig. 2, six unknowns must be calculated. Equation (5) presents the linear system in matrix notation, where C is the coefficient matrix written as indicated in (6); V is the vector of unknowns and I is the independent terms vector. In (6), notation g X or g X means the sum of all conductances that are connected to row or column X , including g X S . For example, in the case of Fig. 2, g 1 is calculated as seen in (7) and g A is calculated as seen in (8). Vector V contains the voltages of the rows and columns arranged as follows: This system must be solved as many times as there are rows in the matrix, as V CC must be connected to the row to be read. The only difference between these systems is the vector I, which is the product of V CC and the switch conductance of the row connected to V CC . For example, in the circuit shown in Fig. 2, I = V CC (0, g 2 S , 0, 0, 0, 0) T . If V CC is connected to row 3, then I = V CC (0, 0, g 3 S , 0, 0, 0) T . After solving the linear system of (5), the OA output voltages V o (i, j) when addressing row i and column j are obtained as in (9). In this equation, V j is the voltage in the corresponding column j (V A , V B , and so on), R F is the feedback resistor, and g j S is the switch conductance at column j. Note that the solution V is valid for calculating the output of the sensors of row i if V CC is connected to this row. For example, with the conditions shown in Fig. 2, the output voltages associated with r A 2 , r B 2 , and r C 2 can be obtained by placing the OA at the corresponding column. Due to the presence of nonideal switches, sensor conductances g The RSA readings V o (i, j) are arranged in matrix V o . There are no analytical methods to extract the real sensor resistances from this matrix if switch resistances are considered. The problem to be solved is to obtain the values of the sensors and, since the internal switch resistances are also unknown, they must also be obtained.

C. Proposed Solution for Crosstalk. Use of Calibration Columns
Crosstalk elimination is posed as an optimization problem, in which the difference of output voltage matrices is minimized. The least-squares (LSQR) method is a typical algorithm for optimization problems that have shown high accuracy in similar applications [20]. Other numerical solutions have been previously studied [20]. Among these options, the Newton-Krylov nonlinear solver or fixed-point algorithms can be found. The LSQR method is typically used in optimization approaches and has also shown the highest accuracy of all the methods mentioned above. It is also known that the Newton-Krylov solver performs worse with real-world data [20]. Moreover, in the library used for these experiments (Python Scipy [28]), this is the reference method for fitting problems and sums of square errors. Thus, in this work, the LSQR algorithm is applied to obtain an accurate value of the RSA sensors and the internal switch resistances and eliminate the secondary crosstalk effect.
Let G be the N -by-M dimension matrix containing the sensor conductances arranged as in the physical RSA, expressed in (10). Let G S be the row vector of length N + M containing the switch conductances ordered as shown in (11): row conductances first, followed by columns conductances. Both matrices correspond to the circuit shown in Fig. 2. Also, let G ′ and G ′ S be the same matrices estimated by the LSQR algorithm If the readout circuit has N rows and M columns, then N + M switch conductances are also calculated. As more variables are introduced, it is necessary to include calibration columns formed by known resistances. The minimum number of calibration columns is given by (12), where M C is the number of calibration columns to add. When calibration columns are added, N + M + M C switch resistances have to be calculated. M C is obtained in such a way that the number of output voltages is at least the number of unknown resistances: N · M + N + M + M C . Calibration columns are placed as shown in Fig. 3. For example, applying (12), if N = 16 and M = 16, then M C = 3. For very large RSA, M C = 3, so the number of calibration columns is limited The LSQR algorithm iterates both the sensor conductances G ′ and the switch conductances G ′ S at the same time to minimize the difference in (13). In this equation, V o is the output voltage matrix obtained from the readout circuit, and F(G ′ , G ′ S ) is the output voltage matrix corresponding to the conductances estimated by the algorithm. G ′ S also includes the switch resistances of the calibration columns Once switch conductances G ′ S are known, their values can be stored or hardcoded for future operations and calibration columns can be removed. Thus, the system has two stages: . Node 1 is V CC , node 2 is ground, and node 3 is the output to the OA. The multiplexer and the demultiplexer select between nodes 1 and 2 as appropriate.

1) Switch Resistances Calibration Stage:
In this first stage, the goal is to obtain the internal conductances of the multiplexer and the demultiplexer G ′ S . At the same time, the LSQR algorithm also calculates the sensor conductances G ′ . This step is executed only once, before the regular operation. Once known, they can be stored for use in the next stage. In the calibration stage, the number of calibration columns required is obtained with (12). 2) Regular Operation Stage: This is the normal mode of use, when G ′ S is already known. The only variables to be calculated by the LSQR algorithm are the values of the sensor conductances G ′ . The time required to calculate G ′ is less than in the calibration stage, since all the switch conductances G ′ S are already known. Calibration columns are not needed at this stage. To test the performance of this approach, several simulations have been carried out.

III. METHODS
Circuit equations were written in Python language and all experiments were conducted by means of simulations on a regular PC running Ubuntu 22.04 Core i5-10300H CPU, 2.50 GHz, 16 GB RAM. The numerical method was implemented with the Scipy package version 1.7.1 [28]. Specifically, the functions scipy.optimize.least_squares and scipy.optimize.leastsq were used. All programs developed are freely available under the GPL license in the GitLab repository for reuse by interested researchers [29].
Several simulations have been performed to study the feasibility of the new contribution. First, the classic ZPM readout circuit is compared to the LSQR method; second, the influence of different sources of error is analyzed; and third, the LSQR approach is compared to a state-of-the-art method.
For the simulations, we generate the real sensor conductances G and the real switch conductances G S . Then, output voltage matrix V o is calculated with equations explained in Section II. Finally, the LSQR algorithm iteratively estimates the previously generated conductances by minimizing the difference expressed in (13), achieving an estimation of them, G ′ and G ′ S . The real and the estimated values are compared to calculate the errors.
As these circuits are simulated, the accuracy of this system can be estimated with the largest error obtained in the experiments for the considered application. In a physical circuit, the number of bits in the ADC would also affect the accuracy of sensor resistances.

A. Evaluation of the Performance of the Classic ZPM and the LSQR Method
This experiment consists of analyzing if the current method improves the sensors' readout of the original ZPM approach. The conductances obtained in the ZPM circuit are calculated from the output voltage matrix V o with (1). Then, by solving (13), the LSQR algorithm estimates the real sensor conductances G ′ and, simultaneously, the switch conductances G ′ S . The aim is to compare if the algorithm obtains more accurate estimations of the sensors than the original ZPM.
The first concern is how the sensor conductance matrix G is generated. Two different resistance maps have been used for evaluation.
1) Sensor Resistances Have Random Values: In this first case, all resistors are random numbers, which follow a uniform distribution between known bounds, as not any value of resistance is possible in real-world applications. These bounds are set to 100 and 500 , which is a sufficiently wide range and within typical values of RSA. This way of distributing the sensor values allows for testing the generalization capability of the algorithm. Other studies have also adopted this distribution [20], [27]. 2) Single Target Resistor Scenario: This is a particular case in which all resistors have the same value (they will be called "nonscanned" resistors, R ns ), except one of them, which has a different value (it will be called "target resistor," R T ). Typical values for these sensors have been obtained from reference studies in this field [8], [12]. For example, in a 16-by-16 matrix, the 255 nonscanned resistors have a resistance of 5 k and only one, the target resistor, has a resistance of 100 . It is known that this kind of circuit shows higher errors in the readout of the value of this single resistor [7], [13]. It is also known that the greater the difference between R ns and R T , the greater the error in the reading [12]. In addition, Section III-B explains how the switch conductances G S are generated.
For each of the two previous resistance distributions, the sensor values are obtained in two different ways.
1) Classic ZPM: This is the original ZPM approach [5], [9]. The internal switch resistances are considered to be zero, and the sensor value is calculated by (1). This case does not correct for the secondary crosstalk explained in Section II-B, so the measurements have errors. 2) LSQR Method: In this approach, the algorithm minimizes the difference of the voltage matrices according to (13) and returns both the estimated conductance matrix G ′ and the estimated switch conductance matrix G ′ S . This method aims to eliminate the secondary crosstalk. For each test, the mean absolute relative error (MARE) is calculated according to (14). In this equation, g j i and (g j i ) ′ represent element (i, j) of G and G ′ matrices, respectively. In the single target resistor scenario, only the error in the target resistor R T is calculated, so it is an absolute relative error (ARE) In all experiments, processing time was measured to compare the speed of the calibration stage with the regular operation stage. Different sizes of the RSA were also tested: 4-by-4, 8-by-8, and 16-by-16.

B. Analysis of Different Sources of Error
Additional sources of errors have been studied. These are the variation of the switch conductances G S and noise in the output voltage signal.
1) Variation (Tolerance) of Switch Conductances G S : Switch conductances may not be equal in all switch channels due to manufacturing imperfections, temperature, and so on. These ranges of fluctuation are usually provided in datasheets [23], [24], [25]. In previous work, these variations have been addressed in several ways: all channels have the same resistance values [8], rows and columns have different values [7], [30], or only the differences between the R on and R off states are considered (for those readout circuits that include these states [27]). A more realistic approach is taken in this work: all switch resistances are different. The LSQR method retrieves also a vector of switch conductances G ′ S . For the sake of simplicity, switch resistors are modeled as uniformly distributed random functions centered in a mean (typical) value R S . Its length is given by a percentage that, in advance, will be called "tolerance." MARE is calculated as well for these resistances by using (15). In this equation, g i S and (g i S ) ′ represent element (i, j) of G S and G ′ S matrices, respectively, 2) Noise: The presence of noise in the measurements can affect the calculation of the sensor values. Noise can come from different sources: power supply, ADC, and so on. To quantify the effect of noise, different noise levels have been added to the output voltage of the OA V o . For the experiments, white additive Gaussian noise has been considered and modeled in terms of the signal-to-noise ratio (SNR). Equation (16) calculates the amplitude of the distorted signal, where V o (i, j) is the output voltage for g j i , and V noise is the noise voltage. The SNR values considered in the experiments were: no noise, 130, 120, 110, and 100 dB Numerous parameters and variables are considered during this work, so the experiments are executed for all possible combinations of the previously explained parameters. Also, each case is repeated ten times to obtain a mean value of the results. Thus, the experiments can be summarized with the pseudocode shown in Fig. 4. A total of 15 000 simulations have been performed. All circuits were also simulated in ngspice-36 (U.C. Berkley CAD Group) for review purposes.

C. Comparison With Other Methods
Comparisons have been made with other postprocessing methods presented in previous reference studies: Hidalgo-López et al. [8] and Shiiki and Ishikuro [27].

1) Comparison With the Two Methods Proposed in [8]:
Hidalgo-López et al. [8] proposed novel iterative algorithms to estimate the target resistances R T in RSA when two different circuit configurations are considered: ZPM and VFM. The study presented an algorithm per circuit configuration. Both algorithms comprised two iterations, and only the single target resistor scenario was analyzed. The proposed equations required that the switch resistances G S were previously known and had the same nominal value. The method proposed in this article overcomes this limitation. For the comparisons, the reference methods [8] have been implemented in Python and switch resistances have been set to the average value R S considered for each case. Simulation parameters are taken from [8]: R T = 100 and R ns = 5 k . Thus, the new method proposed (LSQR used in a ZPM circuit configuration) has been compared with two iterative algorithms [8] used in ZPM and VFM circuit configurations, respectively.
2) Comparison With the OA-Less Method in [27]: The method presented by Shiiki and Ishikuro [27] performs a calibration of the internal switch conductances to improve readout accuracy, using an OA-less interface circuit. For that, an extra multiplexer is added to the circuit. The comparison of the proposed LSQR method with the technique presented by Shiiki and Ishikuro [27] is pertinent since both deal with switch resistance calibration. However, the method of Shiiki and Ishikuro [27] considered fixed values of R S instead of distributed values. Therefore, the simulated conditions in [27] were replicated for comparison: sensor resistances followed a normal distribution of meanR = 100 k with different standard deviation σ values (10 , 50 , 100 , 500 , 1 k , 5 k , and 10 k ), G was 32-by-32, R S = 10 . The percentage root mean squared error (RMSE %) was calculated for these test conditions in both methods.

D. Performance of the LSQR Method for Large Resistances
Gas sensors typically show large resistances due to their oxide metal sheets and manufacturing processes. Their values can range from hundreds of to hundreds of M [31], [32]. Previous works on the ZPM circuit with chemical sensors also showed high accuracy for this type of application with large resistances [1], [33]. As the proposed LSQR method is intended to cover as many applications as possible, a performance analysis for large resistors should also be conducted.
For this analysis, several RSAs are simulated with randomly generated resistances between 10 k and 100 M . Then, ARE is calculated for each value of resistance. Additionally, to cover a higher range of sensor resistances, a similar simulation is performed for values between 100 and 300 M .

A. Performance of Classic ZPM and LSQR Methods
On the one hand, the case where all sensors in the RSA have random values is studied. Table I presents the MARE calculated with (14) for the classic ZPM, in which switch resistors are not considered. Different errors are calculated for several mean switch conductance values R S and for three different RSA sizes. The effect of multiplexing-demultiplexing resistance on circuit performance can be seen in Table I: if switch resistances were zero, then the readout error in the ZPM circuit would be zero. In other words, the ZPM setup with ideal components shows no error, but when switch internal resistances are not ideal, measurement errors appear. Table II presents the same results but using the LSQR method, and both sensor conductances G ′ and switch conductances G ′ S are estimated by this numerical algorithm at the same time. This represents the calibration stage.
For both methods (classic ZPM and LSQR), the MARE increases as the RSA size and R S increase. The largest errors are obtained for the 16-by-16 RSA with switch resistors of 20 . The error values decrease when the LSQR method is applied. For a 16-by-16 RSA with R S = 20 , the error is reduced from 78.4% to 1.13%. The lowest error values are obtained for the smallest values of RSA size and switch resistance (4-by-4 RSA with R S = 1 ). The MARE is 0.06% for a precision switch (R S = 1 ) and a 16-by-16 RSA, which is an acceptable value.
On the other hand, the single target resistor scenario is considered.    but using the LSQR algorithm. It can be seen that a larger RSA size leads to larger error values. These tables also show that the LSQR method significantly improves the performance of the classic ZPM. The maximum ARE for the LSQR method is 0.25% for an 8-by-8 sensor array and R S = 20 . With the same configuration, the classic ZPM achieves an error of 40.5%. Therefore, the improvement is clear. Processing times for each stage were also measured. First, Table V presents the time required for the calibration stage (Section II-C). In this stage, both switch conductances G ′ S and sensor conductances G ′ are calculated simultaneously. Once G ′ S is known, Table VI includes the processing time corresponding to the regular operation stage (Section II-C). The regular operation stage is more than ten times faster than the calibration stage in all cases. For a 16-by-16 RSA with R S = 1 , the calculation time goes from 67.2 s in the calibration stage to 1.26 s in the operation stage. Therefore, it is clear that the most time-consuming task is the calculation of switch conductances G ′ S . However, the calibration stage is performed sporadically. In the regular operation stage, the LSQR method can achieve high accuracy at an acceptable refresh rate (around 1 Hz for a 16-by-16 RSA). These times can be contrasted with those of the methods with which the LSQR has been compared: the ZPM algorithm of Hidalgo-López et al. [8] has  a processing time of 12.6 ms while the VFM algorithm reaches 90.2 ms. On the other hand, the calibration method proposed by Shiiki and Ishikuro [27] consisted of a series of equations to obtain the sensor values directly once the resistances of the switches had been previously calibrated. Therefore, the processing time was negligible. The proposed LSQR method is slower than other existing techniques, but, in return, a higher sensing accuracy is obtained.
In relation to the effect of the matrix size on the computation cost, Tables V and VI show that the larger the array size, the higher the computational cost. For example, for a 4-by-4 array with R S = 10 , calibration and operation times are 0.376 and 0.0248 s, respectively. For a 16-by-16 array, these times are 26.7 and 1.12 s. For N -by-N arrays with N in the range (2,16), the computation time is very well approximated by a secondorder polynomial.
On the other hand, the relationship between accuracy and speed can be observed in Tables II and VI. Those tables show different accuracy values and processing times for different values of R S . It can be observed that the larger the R S value, the larger the error and the lower the processing time. For example, for a 16-by-16 array, MARE increases from 0.060% to 1.131%, while time decreases from 1.26 to 1.06 for different R S values. Therefore, it can be concluded that the algorithm provides more accurate values of matrix G ′ with longer processing times. In all the above simulations, the tolerances for algorithm termination have been kept constant. They determine a tradeoff between speed and accuracy to some extent. For instance, the tolerance for termination by the change of the cost function is called ftol in the Scipy library [28]. We have checked that MARE is constant when ftol < 1e-8, but increases sharply when ftol is above this threshold. Moreover, the computation cost is more or less constant when ftol < 1e-10, but it falls when ftol is above this value. For instance, for a random 16-by-16 array, R S = 1 , when ftol = 1e-04, the computation time is only 3.23 s, far lower than the typical values found for that size using default tolerances (see Table V), but MARE is 3.57%, almost 60 times higher than the value shown in Table II (0.06%).   (15). It can be seen that error is larger for higher tolerance values, but it is always smaller than the tolerance itself. Error also increases with the size of the RSA although the table only shows the result for a 16-by-16 array.
2) Noise: Fig. 5 represents error values for different R S and different SNR when the LSQR method is applied in a 16-by-16 matrix. ARE is greatly affected by the values of R S but not so much by the SNR values. It can be concluded that errors caused by noise are insignificant as long as the secondary crosstalk problem is not solved. Recovering previous comments about resolution, another aspect that could be analyzed is whether noise is relevant in relation to it. In a 16-bit ADC, 1/2 LSB equals 100 dB of SNR [31]. According to Fig. 5, the error due to the effect of G S is larger than the quantization noise for the conditions simulated in this experiment. This means that the effect of R S needs to be corrected.  Comparison of the ARE obtained by applying the proposed LSQR method and the two iterative methods described in Hidalgo-López et al. [8] (G S tolerance = 2%). Both the ZPM and the VFM circuits are compared to the LSQR method. The single target resistor scenario is considered, with R T = 100 Ω and R ns = 5 kΩ.
in the reference study of Hidalgo-López et al. [8]: an iterative algorithm for a ZPM circuit, and a different iterative algorithm for a VFM circuit. Fig. 6 represents the error of the LSQR method and the two reference methods in a 16-by-16 matrix. For the two algorithms proposed in [8], a large ARE in the target resistor appears for large switch resistances, being larger in the VFM circuit. This is a logical result according to the conclusions of [8]: error increases as switch conductances G S get closer to the target resistance R T . However, applying the LSQR method, ARE in the target resistor is lower, as switch resistances increase because it also calculates G ′ S more accurately.
2) Comparison With the OA-Less Method in [27]: Results of the comparisons made with the OA-less circuit proposed in [27] are shown in Table VIII. Since result representation in Shiiki and Ishikuro [27] (Fig. 7 of that study) used a graphical logarithmic scale. Table VIII presents reference error values in ranges to avoid subjective interpretations of the information extracted from Shiiki and Ishikuro [27]. Table VIII shows that the proposed LSQR method leads to lower errors than the OA-less method (e.g., for the highest deviation, σ = 10 k , the error is ten times lower).
3) Hardware Overhead Analysis: This section presents the additional hardware required by the proposed LSQR method and by the rest of the techniques under comparison (iterative algorithms for ZPM and VFM setups, and the OA-less method). First, the iterative algorithms for ZPM and VFM [8] circuit configurations do not require additional hardware. Second, the OA-less calibration method [27] adds an additional multiplexer, but does not require any OA. Third, the proposed LSQR method needs M C -by-N calibration resistances and M C switch channels, which can be, at most, three. The addition of this hardware is justified by better results in the estimation of G ′ and G ′ S . Moreover, extra hardware needs not to be scanned once the calibration stage is complete and G ′ S Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. has been stored. Both the proposed LSQR method and the OA-less technique calibrate the switch resistances, so it can be concluded that there is a balance between the hardware needs and the accuracy in RSA readouts.

D. Performance of the LSQR Method Under
Large Resistances Fig. 7 shows the evolution of the ARE for resistances with values between 10 k and 100 M , and Fig. 8 represents the same but for resistance values between 100 and 300 M ; both for 16-by-16 arrays with an average value of switch resistance R S = 25 . Both figures show that error decreases significantly when the correction of the LSQR method is applied (orange line in both figures). Furthermore, the LSQR method maintains a constant error value close to zero throughout the range studied. These figures also show that the higher the sensor resistance, the smaller the error caused by the switch resistances. Although the standard ZPM works well for large resistances, the application of the LSQR method improves accuracy by accounting for the effect of switching resistances.
In circuit setups using an OA, RSAs made up of large resistors may show inaccuracies due to the similarity in impedance values between the array resistors and the OA Fig. 8.
input impedance. High-input impedance OAs have been found during this research [34]. They exceed M values by several orders of magnitude, making them suitable for large resistance applications. In future work, the OA input impedance could be considered as another variable to be optimized by the LSQR method. In this way, the error associated with the nonidealities of this OA impedance could also be corrected.
In case this circuit was manufactured in silicon technology as an application-specific integrated circuit (ASIC), another factor to take into account would be the feedback resistors R F , whose value should be similar to that of the target resistors R T [32]. The manufacture of large resistors in silicon technology is a current challenge in microelectronics due to the large area required for their implementation and the complexity to keep their value stable. To overcome this problem, CMOS standards are used to manufacture pseudo-resistors, using MOSFET transistors [35].

V. CONCLUSION
A new method to increase the accuracy of the classic ZPM readout circuit has been presented. Resistors of multiplexers and demultiplexers have been considered in the readout circuit, which is a more realistic approach. They were estimated using the LSQR numerical method. As a result, fine values of RSA sensors are obtained. In addition, the LSQR method also provides a good estimation of the internal resistances of multiplexers and demultiplexers. This new method is fast in regular operation and also improves overall accuracy significantly.
In this study, several sources of error have been analyzed. The LSQR method is feasible to obtain the sensor resistances while taking into account the variations between the switch resistors. Noise is not a relevant source of error compared to secondary crosstalk. Three RSA sizes have been considered, showing that error and processing time increase with size. An additional source of errors that could have been considered is the OA offset voltage or the differences in switch resistances when connecting to the ground or V CC . Due to the flexibility of the LSQR method, in future works, these new variables could also be included in the algorithm for optimization.
The comparison of the LSQR method with the reference techniques [8] showed that more accurate results can be obtained by considering differences between the switch channel resistances. The iterative algorithms proposed in [8] required previously known switch conductance values G S and did not allow adding new variables to the problem formulation. The new proposal overcomes these limitations and also allows generalization: including AO offset voltage, different resistances for R on and R off , OA input impedance, and so on.
Comparisons with the OA-less technique [27] suggest that this new LSQR calibration stage leads to more accurate results. The performance of the algorithm is better, the higher the array resistances. This happens in all the cases studied since G ′ S values are much smaller than the average resistance value of the array.
Results show that the LSQR method can also deal with RSAs composed of large resistances. Error is smaller than that obtained for RSAs composed of medium or low resistances, which makes the LSQR method also suitable for chemical detection applications.
This work has shown that a general-purpose optimization method is useful for accurately determining both sensor and switch resistance values.