A Smart Low-Cost QCM-D Based on Lightweight Frequency Domain Processing

This work presents an accurate low-cost smart measurement system capable of simultaneously monitoring the quartz crystal microbalance (QCM) series resonant frequency and dissipation factor with high accuracy, optimally adapting its settings to the operating conditions. The designed system is based on a microcontroller and is fully programmable and it exploits an ad hoc signal processing technique. The performance of the proposed measurement system was assessed experimentally using a prototype coupled with the quartz via an antenna pair, allowing noncontact measurements. Experimental results were obtained under different measurement conditions. The results demonstrated the effectiveness of the system, which is able to guarantee high-frequency accuracy even in the case of large mechanical loads, such as those that occur in in-liquid measurements. In liquid-loaded conditions, when working with transient response signals characterized by time constants as low as $60 ~\mu \text{s}$ , a resolution of 10 Hz is found.


I. INTRODUCTION
Q UARTZ crystal microbalances (QCMs) are well- established sensing devices, useful in a wide range of applications dealing with the detection of small masses or more in general with the measurement of the mechanical properties of media (density and viscosity) [1], [2].The high sensitivity guaranteed by this kind of sensing solution, in addition to its capability to operate in liquid environments, makes it particularly suitable for various kinds of applications, comprising chemical sensing [3], [4], [5], biosensing, as well as material characterization [6], [7], [8], [9].Furthermore, QCMs are resonant sensors operating in the range of some megahertz and exploit the piezoelectric effect to couple the mechanical and electrical domains; therefore, they are active sensors particularly suitable for contactless applications [10], [11], [12].Indeed, the possibility to benefit of resonant sensing The authors are with the Department of Information Engineering and Mathematics, University of Siena, 53100 Siena, Italy (e-mail: federico.carli@student.unisi.it;ada.fort@unisi.it;federico.michelet@student.unisi.it;enza.panzardi@unisi.it;valerio.vignoli@unisi.it).
The QCM sensing principle is based on the perturbations of the quartz mechanical resonant behavior due to mechanical loads added to or removed from the quartz surface [19], which cause, in turn, resonance frequency shifts and quality factor (Q-factor) variations.In some working conditions, specifically when the quartz operates in a gas environment, the mechanical load consists simply of an added thin solid layer, which in practice affects just the resonator thickness [6] and, consequently, the resonance frequency.In this case, the relationship between the resonant frequency shift and the added mass (the measurand) is well described by the Sauerbrey equation, while the Q-factor results are almost unvaried.Differently, if the deposited layer consists of a lossy viscoelastic medium and/or in the case of in-liquid measurements, the viscous damping will cause not only large frequency shifts but also dramatic decreases of the resonant system Q-factor.As an example, for QCMs operating in contact with water, a theoretical degradation of Q by a factor of at least 20 is expected, passing from values in air up to 100 000 to values smaller than 5000 [6], [20].
The most common QCM measurement systems used to simultaneously monitor the resonant frequency shifts and the Q-factor variations are named QCM-D systems (which stands for QCM and dissipation).They are particularly suitable for in-liquid applications and biosensors since they allow for gathering information on the overall viscoelastic behavior of added layer and/or of the surrounding medium.QCM-D systems are based on the acquisition of the transient responses of the quartz, started by means of burst-like electrical excitations.The transient responses are damped radio frequency sine waves, whose duration can go typically from some milliseconds (in air) to less than 100 µs in the presence of viscous loads.The frequency resolution required in QCM applications is high, typically in the order of some ppm or some tenths of ppm, this means that accurate frequency measurements must be performed on damped sine waves, with durations and signal-to-noise ratios (SNRs) that can decrease by orders of magnitude in the presence of liquids or viscous media with respect to what happens in air.
In this perspective, the realization of QCM-D monitoring systems able to accurately evaluate the frequency and the damping of the resonator is a complex task, especially in the framework of low-complexity and low-cost implementations.
The idea behind this article is the application of QCM-D technology as point-of-care devices.This represents a significant leap forward in the field of biosensing and diagnostic capabilities.QCM-D systems, traditionally utilized in various research and industrial settings, are now being adapted for use in point-of-care environments due to their potential to revolutionize healthcare, environmental monitoring, and more.One of the key driving forces behind this adaptation is the urgent need for accurate and reliable biosensing solutions in challenging applications, which push devices to operate at the extreme limits of their capabilities.In such scenarios, the demand for accuracy is paramount, as the consequences of inaccurate results can be dire.To facilitate this shift toward QCM-Dbased point-of-care devices, it is essential to also consider costeffectiveness.Health systems, particularly in resource-limited settings, require affordable solutions to expand access to highquality healthcare.Therefore, the challenge lies in developing QCM-D systems that are not only accurate but also costefficient.
In this article, a low-cost smart system granting accurate QCM-D measurements is presented.The system is based on a microcontroller core that performs both the frequency and dissipation factor measurements, with a minimum number of external circuits added.The radio frequency transient responses of the QCM are excited by means of short sine wave bursts generated by a digital direct synthesis (DDS) integrated circuit, and then, they are mixed with a local oscillator (LO) consisting of a DDS to downshift their frequency to a convenient value in the audio frequency range.The mixer output is acquired by the microcontroller onboard A/D and the two parameters of interest are extracted through a smart processing technique executed by the microcontroller.This last manages the whole measurement process so that the overall measurement system is fully programmable and can adapt to different measurement conditions.This article is organized as follows.In Section II, the measurement principle and the design of the proposed measurement system are discussed.Section III describes the measurement system operations; whereas in Section IV, the signal processing algorithm implemented for the resonance frequency estimation is described.In Section V, the experimental results are presented and exploited to validate the proposed system.Finally, the conclusions are reported in Section VI.

II. QCM-D MEASUREMENT BACKGROUND
To understand the advantages related to the measurement solution adopted in this work, a short background about the quartz behavior in QCM-D systems is provided in the following.

A. Modeling the Quartz Behavior in QCM-D Systems
Typically, QCMs are AT-cut quartzes, which are shear bulk resonant electromechanical systems.When operating in gas the elastic shear wave is not transmitted to the surrounding medium, the resonator losses are very small and all related to viscous friction in the quartz.
The electrical behavior of the pristine AT-cut QCM, in gas, near the resonance can be accurately described by the Butterworth-Van Dyke (BVD) equivalent circuit reported in Fig. 1 [21].The model is a resonant circuit with a series and a parallel resonance, composed of two parallel branches: one consists only of the capacitance C 0 , which depends on the dielectric properties of the piezoelectric material, whereas the other one is composed of the series of the parameters: R Q , C Q , and L Q , which characterize the mechanical behavior of the quartz.In detail, given the electrical permittivity ϵ Q = ϵ 22 of the quartz, its shear modulus µ Q = c 66 , its density ρ Q , its piezoelectric coefficient d 26 , its electrode area A e , thickness t, and finally its viscosity coefficient η Q , the equivalent circuit parameters can be found; in fact, ), and R Q = (η Q /µ q C Q1 ), whereas C 0 = ((ϵ Q A e )/t).C 0 can assume a slightly different value inliquid, due to fringe electric field in the surrounding medium.
By referring to the circuit in Fig. 1, the expression of the series resonance frequency f s is It can be seen from ( 1) that the series resonance is related only to the mechanical parameters, i.e., to the mechanical behavior of the quartz.Commonly used QCM devices have typical values of f s of 5 and 10 MHz.
In a QCM-D system, an excitation voltage is applied to the quartz electrodes, e.g., of the type where V is the signal amplitude, ω ex = 2π f ex is the excitation angular frequency, f ex is the excitation frequency, T BURST indicates the burst duration and T BURST = k(2π/ω ex ), and k ∈ N is the number of sine cycles.Finally, t ′ n for n = 1, 2, . . .indicates the initial time of the nth excitation burst, starting to the nth measurement.Thereby, a transient response to the initial conditions starts as soon as each burst finishes, i.e., at time t = t n = t ′ n + T BURST for n = 1, 2, . . .The quartz transient response depends on the initial conditions (at times t = t − n ) relative to all the reactive components of the system and can be easily written in terms of short-circuit current, I p ( jω), in the frequency domain as follows [22]: where i L Q and V C Q indicate the current flowing through L q and the voltage across C q , respectively.Taking into account that the excitation assumes the form in (2), considering to excite the quartz at its resonance frequency such that ω ex = ω s , and that the burst is sufficiently long so that the transient response to the input at the end of the burst can be considered vanished, since the burst lasts for an integer number of sine cycles and ends at the zero of the sine, the transient short-circuit current becomes and correspondingly, in time domain, it can be written as where τ = Q/(π • f s ) is the time constant of the mechanical system, Q is its Q-factor, and u(t) is the Heaviside step function.Moreover, Referring to a 10-MHz AT-cut quartz, typical values for Q are about 10 000 and τ is in about 1.5 ms.
With loaded quartz, the same model shown in Fig. 1 can be adopted, but the parameters of the mechanical equivalent branch change due to mechanical loading [6], so both Q and f s change.In particular, the presence of an additional rigid (or solid elastic) layer with mass m can be described by adding a series inductance )), which changes the series resonance frequency and causes only a small increase in the Q-factor, whereas the effect of a thick layer of a Newtonian fluid with density ρ l and viscous coefficient η l is represented by the insertion in the mechanical branch of both an inductance and a resistance In general, the effect of lossy materials in contact with the quartz causes variations of the reactance present in the mechanical branch and large variations of the resistance.
Due to the added resistance, in real applications, the Qfactor of the resonator dramatically decreases, and the transient response duration is reduced by one order of magnitude.For instance, a 10-MHz quartz operating in water is characterized typically by a Q-factor of about 5000 and a time constant of about 70 µs.For viscous fluids [6], [22], τ is even shorter, QCM-D is used in many different contexts: to detect changes in the resonator mass due to the adsorption of target species, which can attach to the pristine quartz surface or, more often, to functionalization layers predeposited on one electrode.They can be used in gaseous environments for the detection of gases or in liquid environments e.g., for the detection of biological species as biosensors.Besides sensing the mass, they can be used also to measure the viscoelastic behavior of the adlayers or the viscosity of surrounding fluids.
In all these applications, the required relative accuracy for the resonance frequency measurement is very high, i.e., in the order of some ppm or tenth of ppm.
Finally, it must be underlined that the analysis reported in Section II-A shows the relationship between the mechanical branch parameters and the features of the transient QCM response in terms of short-circuit current, which depends in a simple way only on the mechanical behavior.Obviously, real QCM-D systems cannot perfectly realize the measurement of the short-circuit current, due to the amperometer series impedance, but when this latter is small with respect to the one of C 0 and to R q , the influence of the measurement circuit on the measured transient response is negligible [22], [27], [28].

III. MEASUREMENT SYSTEM A. Measurement System Architecture
In this section, the measurement system architecture is described.The architecture, depicted in Fig. 2, is composed by the QCM excitation system, a voltage generator that delivers short bursts of sine waves, a read-out circuit that amplifies the QCM transient response and mixes the response with an LO, providing an exponentially decaying sinewave with the same time constant but with a downshifted frequency, and finally an acquisition and processing unit, able to analyze the transient responses and to provide the measurement parameters, i.e., the resonance frequency of the QCM, and a parameter related to the dissipation factor that in the proposed system is directly an estimation of the time constant.The readout and acquisition system operates after the excitation burst is finished, and the timing is managed by the micro, through the switch (S) reported in Fig. 2.
In Fig. 2, a quartz coupled with the measurement system via two antennas is shown, in accordance with the architecture of the prototype developed and used for the tests reported in the following, but any other coupling ensuring the measurement of the short-circuit current, therefore characterized by a small input impedance, can be used.
More in detail, with reference to Fig. 2, the QCM is connected to a primary antenna, while a secondary antenna is connected to the front-end circuit containing both the excitation and the readout circuit.The excitation circuit, based on a DDS system, acts as a voltage generator (V ex in Fig. 1) and is in charge of generating sine bursts with a programmable frequency ( f ex ) and duration (T BURST ), whereas the conditioning circuit operates as a current amplifier and consists of the sense resistance R s and a circuit that mixes the signal from the antenna with a sine wave with the programmable frequency f B from the LO, of low-pass filters and amplifiers.The signal output of the readout electronics is a voltage given by a frequency downshifted version of the short-circuit current with frequency f ′ s = f B − f s , which is finally fed to the microcontroller A/D.
The switch S, shown in Fig. 2, is used to isolate the receiver from the voltage generator during excitation.
The system operates in two phases, the excitation one, in which S is set to H in Fig. 2, and the second one, with the switch S set to L.

B. Measurement System Operations
Obtaining a satisfactory SNR for the measured transient signal is always an issue since it must be considered that the estimation of the frequency of short low-level transient signals, having time constant less than 1 ms, suffers from many criticalities and all the measurement settings have to be carefully chosen to improve the measurement system performance and obtain a satisfactory frequency ( f s ) resolution.In real-world applications, as already discussed, the required resolutions are in the order of few hertz in water and below 1 Hz for gas sensing.
Therefore, the smart system proposed in this article implements an automated procedure for optimizing the measurement settings in the different measurement conditions.
With such short signals, to ensure a satisfactory SNR, a high sampling frequency f c was used, while the acquisition window was sized to allow for a satisfactory processing of the transient response in the possible different measurement conditions and so, set to min(5τ , T w ) where T w is a maximum duration set due to the available hardware resources and to the maximum acceptable computational burden for the subsequent signal processing.
In this context, Fig. 3 reports a diagram of the smart QCM-D operations and clarifies the main measurement settings that are adjusted in an initialization phase based on the working conditions, listed in detail as follows.
2) The number of acquisitions K that are used to compute an average value of the measurement parameters so as to reduce uncertainty.3) The LO frequency, f B .
4) The excitation burst duration T Burst .

C. Optimization of f ex
The exciting signal frequency f ex = (ω ex /2π ) is determined by means of a dichotomic search aiming at maximizing the amplitude of the acquired transient signal in any measurement conditions, with a technique described in [22].The starting value for f ex is the nominal quartz resonance frequency in air.During the search phase, the excitation signal spans a frequency range W around the nominal quartz resonance, with a number of steps F = ⌈ log 2 (W/ f )⌉ being f the accuracy of the search algorithm.At each search step, the transient response of the QCM is acquired in a fixed-length time window, and afterward, its root-mean-square (rms) value is estimated and compared with the estimated ones at the previous search step, to decide the sign of the frequency increment at the next step.Thus, the estimated frequency is used to tune the excitation voltage signal for the subsequent real-time monitoring of the oscillating system driving the QCM with high energy efficiency.
Note that the value of F, and therefore the frequency resolution f , is intrinsically limited by the uncertainty of the evaluation of the acquired signal rms value.

D. Optimization of the Other Parameters
The first coarse estimations of f s and τ , obtained after having adjusted the excitation frequency and using the initial settings for the other measurement parameters, are used to improve the other measurement settings in the initialization phase (see Fig. 4).In particular, T Burst can be adjusted to increase the output magnitude [23].
As far as the LO frequency, f B , is concerned, this is adapted by exploiting the first estimation of f s obtained in the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Frequency estimation error, considering different starting errors initialization phase to shift the mixed signal frequency, f ′ s , to a specific frequency range selected to optimize the frequency estimation procedure performance (as it will be shown later).

IV. SIGNAL PROCESSING
In order to meet the specific requirements concerning the accuracy and the resolution of the measured quartz resonant frequency, f s , in real-time mode, a light and robust frequency domain-based signal processing algorithm was used.The estimation of the resonant frequency is based on the magnitude spectrum maximum search and exploits a multiresolution zeropadding procedure and averaging.

A. Theory
The proposed algorithm takes advantage of the potential of the digital Fourier transform (DFT) and mitigates the finite resolution of the DFT by averaging DFTs evaluated with a different number of points, exploiting when needed zero padded versions of the signal with variable size of zeros at each run.This procedure allows for significantly reducing the frequency estimation bias due to constant frequency resolution.
Considering a time domain current signal as the one in ( 5), the frequency downshifted signal, transformed to voltage, and acquired and used for the subsequent processing, zero padded with a convenient number of zeroes, can be written in the discrete-time domain as where f ′ s ≈ f s − f B ; T c = 1/ f c is the sampling period, for which we assume f c ≫ f ′ s ; M = ⌊(T w /T c )⌋; i n represents the measurement noise; N is the number of samples used for DFT calculation; B is the signal amplitude; and k o is the transresistance of the overall conditioning and acquisition system.
The proposed algorithm is tailored on the specific problem because it is based on the assumption that the peak frequency of the spectrum, i.e., the resonance frequency, varies in a small frequency range in any measurement conditions; therefore, the ratio ( f c / f ′ s ) can be assumed to remain constant.In QCM measurement at 10 MHz, the expected maximum shift is always limited to a few kilohertz [4], [6], in practical cases for biosensors, the meaningful shifts are limited well below 1 kHz [24], [25].
From (7), we have that considering the typical Q values of QCMs, the resonant frequency, i.e., the frequency of the maximum of the signal frequency spectrum, f p , is given by where the Q-factor can be found as The peak frequency is searched to estimate the QCM series resonance.
The quantized frequency step is f = ( f c /N ) and the estimated resonant frequency f p can be written as where Accordingly, the resulting frequency estimation error f 0 is given by where We now assume that f 0 takes the minimum value, i.e., f 0 = −( f c /2N ), and therefore, k 0 = ( f s / f c )N − 0.5.This assumption serves to simplify the explanation and will be removed later.
Extending the number of samples from N to a maximum of N + m samples, where m = ⌊( f c / f p )⌋, e.g., by appending N −M + I zeroes, with i varying at each run, the bin of the spectrum maximum at the ith run can be written as It follows that, at each of the measurement repetition, until the value of ( f p / f c )i < 1 (as long as the condition i < ( In general, removing the assumption f 0 = −( f c /2N ), the frequency estimation error at the ith run can be written as with i ≤ m − l and l ≤ m a natural number depending on the value of f 0 .Moreover, in any case when the error overcomes its limit value, ( f c /2N ), for i = m − l, the value k i becomes equal to k 0 + 1 and the same procedure for describing the estimation error can be Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
applied at the subsequent runs, but with a new starting error, Considering that N ≫ m, the following approximation for (12) can be used: The previous equations show that the error at each step changes adding to the starting error (i = 0 or m − l) steps given by ( f p /N ), spanning a frequency interval large ( f c /N ), around zero, therefore, with a frequency resolution, which is ultimately dictated by the ratio ( f p /N ).Note that, as can be seen in Fig. 4, to sample the whole ( f c /N ) interval around the frequency f p , with the given resolution, ( f p /N ), obtaining thus a mean error lower than ( f p /N ), a number of runs equal to or multiple of m = ( f c / f p ) is required.
As shown above, averaging the different f p estimations, using m runs (or a number of runs multiple of m) ensures an error lower than ( f p /N ), and this improves the frequency resolution of the N point DFT by a factor m = ( f c / f p ).
The frequency f p is the estimation of f ′ s , i.e., the measured parameters, as such, it varies during the measurement, but as discussed earlier, it can be considered constant in intervals few seconds long.Moreover, in real-word applications, its variations are smaller than some kilohertz; therefore, the ratio m = ( f c / f p ) can be considered a constant and can be selected by setting the frequency of the LO f B and, thus, f ′ s .Concluding, averaging the frequency estimations obtained, e.g., by zero padding, using K runs, with zero padding from N to N + km and k ∈ N , will improve the resolution at least of a factor m.
From ( 14) and from the discussion above, it could seem that operating with an LO frequency very close to the quartz resonant frequency f s so to have a very small ratio ( f p /N ) will result in an optimal choice because it enhances the frequency resolution.Nevertheless, such a choice implies having a very low f ′ s and, therefore, a very low Q ′ .This causes a less sharp peak of the spectrum and noise to have a dramatic effect on the spectral maximum search.Therefore, in seeking an optimized solution for the measurement settings, a tradeoff must be found, taking into account the noise and the shape of the signal in the frequency domain.
As far as the time constant is considered, it is estimated by a simple threshold-based algorithm, by which the time constant is determined as the time at which the amplitude of the transient response decreases to 30% of the maximum value.

B. Computational Burden
An important aspect that must be taken into account is the computational burden and the computational time for the parameter estimation.The new estimation of the series frequency and the time constant must be provided in less than 2 s, to allow the real-time monitoring of the QCM behavior during the interaction with the target species.Therefore, the excitation, acquisition, and processing times are upper bounded.On the other hand, the processing is executed by a microcontroller, and therefore, the execution time and the memory availability are limited.
To implement the proposed algorithm, a library radix-2 fast Fourier transform (FFT) algorithm for the calculation of the (N , N + 1, . . ., N + K ) DFTs cannot be used.The use of FFT algorithms for nonpower of two DFT points calculation can be considered, as for instance in the Bluestein algorithm [26].In this case, the number of real multiplications with accumulation (MAC) needed for the evaluation of all the samples of one DFT N + i point long is about 3 × M log 2 (M) and M = 2 b is the smallest power of 2 for which M ≥ 2(N + i) − 1.Therefore, the number of MACs needed for the evaluation of the series frequency is As an alternative, in this article, the direct calculation of the DFT values in the frequency band where f p is expected to be during the measurements turned out to be convenient in terms of complexity.The peak frequency moves in a narrowband (as already explained) f w ≪ f c , and therefore, only the calculation of W = [( f w / f c)(N + m)] DFT samples is required.Each DFT sample calculation requires 2N + i MAC, and therefore, the computational burden is In Section IV-C, the frequency estimation algorithm optimization and performance assessment are obtained through simulations accounting for realistic measurement conditions.

C. Simulation Study
Extensive simulations were performed to study the algorithm performance by considering a 10-MHz AT-cut QCM and a measurement range f w = 5 kHz.The simulation study is performed in the MATLAB environment, and considering realistic hardware resources constraints, the frequency sampling of 1 MHz or 500 kHz and a base N value of 4000 were selected.The optimal f ′ s value was found equal to about 50 kHz.
In Table I, the performance of the proposed algorithm, in the best cases, considering the complexity [as per (16)] and the estimation accuracy, is reported.Data in Table I are obtained simulating in-water measurements (τ = 70 µs).The rms and the standard deviation (STD) of the absolute error are evaluated by repeating the study for a set of 100 values of f ′ s , equally spaced in the full measurement range of 5 kHz.Moreover, for each f ′ s value, the simulations were repeated 40 times adding to the signal white Gaussian noise signals with STDs σ n .Different noise levels were considered up to a maximum of 10% of the exponential peak value (i.e., σ n = 0.1 • B), which represents a very harsh condition, much worse than the ones observed in real measurements.It can be seen that, as expected, the highest sampling frequency (1 MHz) leads to larger errors in case of high SNR but provides better robustness toward noise and a lower complexity.
The results reported in Figs. 5 and 6 were obtained with the settings providing the better tradeoff between complexity and estimation accuracy (as per Table I), i.e., by choosing    (N + i, i = 0, . . ., K − 1).Moreover, Figs. 5 and 6 show data obtained by simulating different measurement conditions.Fig. 5 reports the frequency estimation average error f [Fig.5(a)] and STD( f ) [Fig.5(b)] evaluated over 40 runs as a function of f ′ s , by assuming for the input signal an amplitude B = 0.5 V and τ = 1.5 ms, in the presence of white Gaussian zero mean noise with different STDs (1, 2.5, 5, and 50 mV).Fig. 6 shows the results of an analog simulation study but carried out considering τ = 70 µs.The assumed parameters are taken from real-word cases.
The results show the improvement obtained by using the proposed method with respect to fixed-length zero padding in both cases.The first case (Fig. 5) is representative of measurements in-gas where a large Q ′ value ensures low sensitivity to noise so that averaging in the case of fixedlength zero padding is not beneficial and the biasing error due to finite frequency resolution is not corrected by averaging even in the case of large noise.The second case (Fig. 6) represents measurements in viscous liquid where the QCM responds with short transients having a time constant of 70 µs; here, the noise has a larger effect, and the methods perform in a similar manner for the largest considered noise level, leading to mean errors of about 20 Hz.Note that in the presence of large noise, the main source of error is noise itself and the frequency estimation quality is limited by the fluctuations due to noise (as can be seen by analyzing the STD plots).
Moreover, the performance of the proposed algorithm was analyzed when varying the QCM parameters in terms of time constant and resonance frequency.Fig. 7 presents the STD of the frequency estimation error obtained by simulations, considering a fixed noise magnitude (σ n /B = 0.002).As expected, and as already discussed, the is the signal, the more critical is the estimation process.

A. Prototype Implementation
The validity of the above discussion and the effectiveness of the proposed measurement system were tested through experiments using a system prototype, as schematically depicted in Fig. 2. The antennas used for quartz coupling are square copper loops antennas printed on FR4 substrate and designed as to have a small secondary impedance magnitude, a larger primary one, and a low coupling factor [22], so to have an estimated loading resistance lower than 1 for the QCM.The whole measurement system is controlled by a microcontroller (STM32H755, STMicroelectronics).The excitation, V ex , is generated by an excitation circuit based on a DDS (AD9833, Analog Devices) and the QCM transient response is acquired by the 12-bit microcontroller ADC.The sense resistance R s = 50 .
The LO is implemented by an ad hoc designed electronic circuit based on the DDS (AD9833, Analog Devices), the transient response is frequency downshifted by means of an ad hoc developed conditioning circuit hosting the mixer, a lowpass filter, so that f ′ s = f s − f B .The frequency downshifted version of the QCM transient response is finally amplified.The acquisition is triggered by the end of the burst.

B. Frequency Measurement Characterization Using Emulated Quartz Signals
The performance of the implemented frequency estimation algorithm was first assessed by emulating the quartz transient response.During tests, by referring to the setup in Fig. 2, the quartz and the conditioning circuit were disconnected from the system and a waveform arbitrary signal generator (AG33220A) was used to generate resonant transient responses as described by (7) with known resonance frequency and decay time to emulate in-air and in-water operating conditions.
The microcontroller unit was set to perform K = 20 estimations of the quartz resonant frequency with fixed zero padding length N = 4000 and variable length N + i, i = 0, . . ., K − 1.The sampling frequency used was 1 MHz and f ′ s varied in the working range (centered at 50 kHz).
Figs. 8 and 9 report the comparison between the obtained error f of the frequency estimation, in the similar conditions Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.to those used for the simulations shown in Figs. 5 and 6, i.e., evaluating the estimation errors by varying f ′ s and using for the input signal different amplitudes B = (1, 0.5, 0.2, 0.1 V) and τ = 1.5 ms in Fig. 8 and τ = 70 µs in Fig. 9.It must be noted that real QCM transient signals, obtained with the developed measurement system, are characterized by amplitudes larger than 0.2 V even in the presence of very viscous liquids.The different subplots in the two figures refer to results obtained with the four different signal amplitudes, therefore with different noise levels, i.e., different SNRs.The estimated ratios between the signal amplitudes and the noise STD are reported in the figure .The tests performed emulating quartz operations in air reveal the great potential of using the multiresolution zero padding and averaging algorithm.The test cases emulating in-liquid measurement (i.e., τ = 70 µs), instead, confirm that the use of the proposed processing solution does not grant a better frequency estimation performance with respect to a fixed-length zero padding algorithm when the system is affected by a large noise.
The reported results are good in agreement with those predicted by the simulations (see Section IV-B).
Table II shows a comparison between the results obtained from simulated and emulated experiments in terms of maximum rms error (err rms MAX ) for the frequency estimation algorithm.The table highlights the comparison between the results obtained through the proposed method, involving variable zero-padding lengths, and those obtained using a fixed-length zero-padding approach, under two scenarios: τ = 1.5 ms and τ = 70 µs.
The comparative analysis of the results underscores the significant advantages provided by the proposed variable zeropadding approach in estimating the resonance frequency in almost all the considered cases.This holds true for a broad spectrum of noise levels affecting the measurements, with the exception being the scenario where the highest noise level (σ n /B = 0.1) was assumed.In this particular case, both approaches exhibit relatively diminished performance.It is noteworthy, however, that the noise level considered in this instance represents an upper bound value, a worst case scenario chosen to facilitate a comprehensive understanding of performance analysis.In real applications, it is customary for this noise level to be far smaller [6], as shown also later in the following sections.Furthermore, a slight difference becomes apparent in the simulated and emulated values presented in Table II, with a maximum value in the related evaluated error being approximately 14 Hz in the case of the highest noise level.This disparity can be comprehensively attributed to the rms estimation uncertainty and to the approximations with which the emulations replicate the simulated conditions.

C. QCM Tests
A series of tests was performed, aimed at characterizing the performance of the implemented measurement system in different measurement conditions by subjecting a quartz under test to different mechanical loads covering one of its surfaces with different liquids.
Fig. 10 shows a picture of the implemented measurement setup.
The QCM used in this work is an AT-cut quartz crystal having two gold electrodes with a diameter of 6 mm and a nominal resonant frequency of about 10 MHz.For the quartz used to obtain the measurement reported in this article, we independently measured in air the following parameters: R Q = 10 , L Q = 6.3 mH, and C Q = 40 fF [6].
The quartz crystals employed can be regarded as representative instances within a vast category of devices employed in QCM-D measurements.The system exhibits compatibility with any 10-MHz AT-cut quartz, accommodating the inherent device tolerances and inter-producer discrepancies.This compatibility is possible thanks to the adjustment of the excitation frequency at the commencement of each measurement, thereby ensuring to excite properly the first mode of the quartz.
Both in-gas and in-liquid applications were taken into account, and the experiments were performed in a laboratory environment maintaining a temperature range of 23 • C-25 • C. In-liquid, due to mechanical loading, both L Q and R Q vary.The expected relative variations of L Q are in the order of 10 −3 , whereas those of R Q are very large; in fact, in water,  [6].
For in-liquid tests, the quartz was placed in a tailored designed measurement chamber and the coupled antennas were placed at a distance d = 1 cm.
During in-liquid experiments, the quartz surface is at first covered with 180 µL of water to which four subsequent drops of anhydro glucose, each of about 5 µL, were added.
The liquid loads were dropped on the quartz surface using a laboratory micropipette having mechanical variable volume in the range of 5-50 µL (VWRI613-5261).The experiments were replicated three times using the same quartz, every time the quartz crystal was rinsed by injecting and removing multiple time a volume of about 200 mL of distilled water to eliminate any remaining glucose trace on surface and then dried out in a stream of pure nitrogen gas.
During the test, V ex amplitude was set to 3 V and the initial measurement parameters were set as f ex = 10.0030MHz, which is the nominal resonance frequency of the used QCM, f B = f ex + 50 kHz, whereas the measurement time was set to 1 s and the number of average K to 20.
The dichotomic search procedure to estimate f extOPT spanned a range of frequencies W = 25 kHz around f ex with N = 12 steps.At the end of the dichotomic search procedure, f s and τ were measured and the measurement settings are updated in order to start the monitoring phase.The acquisition and signal processing executed with the microcontroller, STM32H755, takes approximately 1 s.
As already explained, the dichotomic algorithm is performed once at the beginning of a measurement, when changing the quartz in the chamber to tune the excitation frequency to the specific quartz (because due to the quartz tolerance and to the possible functionalization, this step is required to properly excite the fundamental mode).This preliminary phase takes approximately 15 s.Fig. 11(a) reports the examples of the measured frequency downshifted transient responses of the QCM in air (blue color) and in the presence of the different mechanical loads produced during the experiment, using the estimated f exOPT in water (magnified inset).As it is possible to observe, the duration of the transients is consistent with the expected theoretical values.Moreover, Fig. 11(b) shows one acquired transient signal compared with theory, i.e., with a damped sinusoidal wave as in (7) showing that the used model well fits the experimental reality.This is true because the front-end electronics is realized with great care, avoiding superimposing to the quartz lowest resonance frequency also other modal responses, by selecting the excitation burst characteristics, avoiding introducing electrical resonances or other transients.The measurement system, as described in the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.The results of the monitoring phase for f s and τ are shown in Fig. 12.The data refer to about 1.6 h of monitoring during which, starting from the quartz covered by the water layer, the four drops of anhydrous glucose were added at intervals of about 20 min.Fig. 12(a) shows the evaluated frequency shift as a function of time.The inset in Fig. 12(a) shows some minutes of acquisition, from which it is possible to appreciate the frequency fluctuations.An experimentally evaluated STD (for short-time measurement) for f s measured in water of about 5 Hz was found, (STD( f ) ≈ 5 Hz) in accordance with the simulated results for noise with STD lower than 2.5 mV (which is the experimentally estimated measurement noise STD).
Fig. 12(b) refers to the estimated τ during the monitoring phase, showing results consistent with the expectations since, as it can be observed in the plot, τ of about 70 µs is estimated when the quartz operates in water, whereas with the additional drops of glucose, the time constant of the response reduces to approximately 50 µs (four glucose drops).
Considering the results of measurements of f r and τ in air and in water as references, which have more definite features compared to cases involving glucose solutions, we have determined a repeatability of less than 3 Hz for f r and on the order of microseconds for τ measurements in air and 5 Hz and tens of microseconds in water.
Table III compares the performance of the frequency measurements in terms of frequency STD in the present work and in similar systems reported in the literature and available on the market with comparable measurement time (i.e., about 1 s).
The data reported in Table III highlight that the performance of the proposed solution aligns well with that of available systems in literature, with the exception of commercially available options that offer exceptional measurement stability but come at a high cost.As examples, works [33] and [34] exhibit price tags exceeding 2000 euros with comparable measurement time.Furthermore, the quartz impedance was characterized for each of the different measurement conditions evaluated during monitoring by means of an impedance analyzer (Wayner Kerr 6500B).Fig. 13 shows the measured quartz impedance spectrum magnitudes, when the QCM is operating in air (before the measurement starts), in the presence of water and after the addition of each glucose drop.f s shifts evaluated from the measured impedance spectra agree with the frequency shifts evaluated by the proposed system (about 200 Hz for each drop addition), as a further confirmation of the performance of the implemented measurement strategy.A similar very good accordance was found for the measured time constants, which according to the measured impedance data should take the values 1.5 ms in air, 72 µs in water, and 42 µs with four glucose drops [6].

VI. CONCLUSION
In this work, the authors demonstrated the possibility of realizing an accurate contactless low-cost smart sensing system for QCM sensors operating in-gas and in-liquid.The designed measurement setup takes advantage of an automated measurement procedure through which the setting of the measurement parameters is optimized depending on the working conditions, to preserve a satisfactory measurement resolution for the estimation of the resonant frequency of the quartz.The designed system is fully programmable, and it exploits a microcontroller and implements an ad hoc signal processing technique to perform both the frequency and dissipation factor measurements.
The challenges encountered during the system implementation encompassed various critical aspects.Foremost among these was the necessity of achieving an optimal coupling factor between the antennas, the quartz substrate, and the reading system while simultaneously minimizing the electrical loading of the system.This was essential to ensure a satisfactory SNR and to minimize distortion in the transient response of the QCM's first mode.
The achievement of these objectives mandated a meticulous design of the overall front-end circuit and measurement technique.To prevent the excitation of unwanted QCM modes and to optimize the signal amplitude, precise selection of excitation burst characteristics was paramount.In addition, the coupling between the QCM and the readout circuit was designed with utmost care to minimize loading effects.Furthermore, the electronic circuits were tailored to eliminate the introduction of electrical resonances or other undesirable transients.
Another challenging aspect was the development of an algorithm tailored for the microcontroller (µC) that met the rigorous demands of the system.This entailed the creation of a lightweight and high-speed algorithm to enable measurement times of approximately 1 s, a requisite for real-time monitoring of complex phenomena, all while preserving the requisite level of measurement accuracy.
The performance of the proposed measurement system was assessed experimentally using a prototype coupled with the quartz via an antenna pair, allowing noncontact measurements.The experimental characterization of the system was obtained both by means of emulated signals and through measurements under different conditions.The experimental results show the effectiveness of the system, which grants frequency accuracy even in the case of large mechanical loads, as in in-liquid measurements, with an estimated STD of the error of about 5 Hz even for very short transient signals characterized by time constant as short as 60 µs.
The developed prototype shows the feasibility of a compact, standalone sensing system, based on low-cost integrated circuits suitable to be used for example, in biological applications and when noncontact measurements are required.
Further perspectives of this work for the development of point care instrumentation concern the optimization of costeffective solutions for the sampling system for in-liquid measurement, including the chamber and the sampling system, that has to be automatized and simple to use to improve the overall usability, repeatability, and accuracy.

Manuscript received 19
June 2023; revised 13 December 2023; accepted 14 December 2023.Date of publication 1 January 2024; date of current version 17 January 2024.This work was supported in part by the European Union-Next Generation EU, in the context of the National Recovery and Resilience Plan, Investment 1.5 Ecosystems of Innovation, Project Tuscany Health Ecosystem (THE), under Grant CUP B83C22003920001.The Associate Editor coordinating the review process was Dr. Tarikul Islam.(Corresponding author: Enza Panzardi.)

Fig. 1 .
Fig. 1.BVD equivalent electrical circuit for an unloaded quartz crystal and electronic front-end schematic.

Fig. 5 .
Fig. 5. Performance of the frequency estimation algorithm assuming for the signal expression in (7): B = 0.5 V and τ = 1.5 ms.(a) Mean frequency error f and (b) STD( f ) (over 40 runs) as a function of f ′ s and f c = 1 MHz.Red lines: fixed number of zeros N = 4000; blue lines: N = 4000 + i (i = 0, . . ., 19) zeros at the ith run.K = 20.Different plots refer to different noise STDs as reported in the subplot titles.

Fig. 6 .
Fig. 6.Performance of the frequency estimation algorithm assuming for the signal expression in (7): B = 0.5 V and τ = 70 µs.(a) Mean frequency error f .(b) STD( f ) (over 40 runs) as a function of f ′ s and f c = 1 MHz.Red lines: fixed number of zeros N = 4000; blue lines: N = 4000 + i (i = 0, . . ., 19) zeros at the ith run.K = 20.Different plots refer to different noise STDs as reported in the subplot titles.

Fig. 7 .
Fig. 7. Performance of the proposed frequency estimation algorithm assuming for the signal expression in (7): B = 0.5 V, f ′ s and τ variable.The plotted STD( f ) is evaluated over 40 runs and plotted as a function of τ , and the different values of f ′ s are in the legend, f c = 1 MHz.The noise STD is fixed as per title.In the figure, the SNR value is also shown (right axis).

Fig. 8 .
Fig. 8. Performance of the frequency estimation algorithm with the QCM operating in air.Error f , as a function of f ′ s .f c = 1 MHz.Blue lines: fixed number of zeros N = 4000; red lines: N = 4000 + i (i = 0, . . ., 19) zeros at the ith run.K = 20.Different plots refer to different amplitudes of the acquired signal.(a) B = 1 V.(b) B = 0.5 V. (c) B = 0.2 V. (d) B = 0.1 V.

Fig. 9 .
Fig. 9. Performance of the frequency estimation algorithm with the QCM operating in ultrapure water.Error f , as a function of f ′ s .f c = 1 MHz.Blue lines: fixed number of zeros N = 4000; red lines: N = 4000 + i (i = 0, . . ., 19) zeros at the ith run.K = 20.Different plots refer to different amplitudes of the acquired signal.(a) B = 1 V.(b) B = 0.5 V. (c) B = 0.2 V. (d) B = 0.1 V.

Fig. 10 .
Fig. 10.Picture of the QCM coupling and front-end used during the test.

Fig. 11 .
Fig. 11.(a) Measured transient responses of the quartz in the different measurement conditions: air, 180 µL of water, and four subsequent drops of anhydrous glucose each of about 5 µL added, as per legend.(b) One of the acquired transient signals (three drops) compared with theory, i.e., with a damped sinusoidal wave as in (7).

Fig. 12 .
Fig. 12.Estimated transient frequency shift (a) [ f s (t) − f s (0)] and (b) τ (t) during a long time acquisition in which starting from the quartz loaded with 180 µL of water, after 20 min of acquisition time, four subsequent drops each of 5 µL of anhydrous glucose have been injected.

TABLE I SIMULATION
STUDY RESULTS IN SELECTED CASES

TABLE II COMPARED
RESULTS OBTAINED FROM SIMULATED AND EMULATED EXPERIMENTS IN SELECTED CASES R Q becomes 175 , and in viscous liquid, it can reach much higher values

TABLE III COMPARISON
OF STD( f ) FOR MOST RECENT QCM-D-BASED SOLUTIONS Fig. 13.Measured quartz impedance magnitude spectrum |Z | operating in air (before the measurement starts), in the presence of water and after the addition of each glucose drop.