Low Limit of Detection Gas Density Sensing With a Digitally PI-Controlled Microcantilever

This work describes a new platform for sensing mass or rheological properties of gases with unprecedented responsivity and limits of detection. The system consists of a microcantilever working in a phase-locked loop (PLL) with an imposed phase between its excitation and deflection signals. The optically detected cantilever deflection is demodulated against digitally synthetized reference signals, and the quadrature component (<inline-formula> <tex-math notation="LaTeX">${Q}$ </tex-math></inline-formula>-signal) is used as the error parameter in a PI controller, which continuously tracks the oscillation frequency. The direct digital synthesis of the reference and actuation signals allows low-noise and fast-transient responses of the sensor for real-time detection of minute changes of any environmental parameter. A general analytical model is derived, used to understand the dynamical response of the platform, and validated against experiments using different gases and pressures. In particular, the responsivity of the sensor to density variations of the fluids and the stability of its frequency response are studied and measured. It is shown that the responsivity and the achieved limits of detection depend on the chosen phase imposed in the loop. A limit of detection for density variations of <inline-formula> <tex-math notation="LaTeX">$3.5\times 10^{-{4}}$ </tex-math></inline-formula> kg/<inline-formula> <tex-math notation="LaTeX">$\text{m}^{{3}}$ </tex-math></inline-formula> in air is measured, in agreement with the theoretical predictions, and one to two orders of magnitude lower than any reported value achieved with the same type of physical uncoated resonant sensors.


Low Limit of Detection Gas Density Sensing With a Digitally PI-Controlled Microcantilever
João Mouro , Paolo Paoletti, Marco Sartore, and Bruno Tiribilli Abstract-This work describes a new platform for sensing mass or rheological properties of gases with unprecedented responsivity and limits of detection. The system consists of a microcantilever working in a phase-locked loop (PLL) with an imposed phase between its excitation and deflection signals. The optically detected cantilever deflection is demodulated against digitally synthetized reference signals, and the quadrature component (Q-signal) is used as the error parameter in a PI controller, which continuously tracks the oscillation frequency. The direct digital synthesis of the reference and actuation signals allows low-noise and fast-transient responses of the sensor for real-time detection of minute changes of any environmental parameter. A general analytical model is derived, used to understand the dynamical response of the platform, and validated against experiments using different gases and pressures. In particular, the responsivity of the sensor to density variations of the fluids and the stability of its frequency response are studied and measured. It is shown that the responsivity and the achieved limits of detection depend on the chosen phase imposed in the loop. A limit of detection for density variations of 3.5 × 10 −4 kg/m 3 in air is measured, in agreement with the theoretical predictions, and one to two orders of magnitude lower than any reported value achieved with the same type of physical uncoated resonant sensors.

I. INTRODUCTION
D ETECTING and discriminating the presence of different gas molecules is crucial in environmental monitoring, industrial and chemical control, and medical applications. Solid-state miniaturized devices have been proposed in the last decade for different gas sensing applications due to their high responsivity, fast response time, and low limits of detection.
One common gas sensing method is based on the chemoresistive effect. The electrical conductivity of some materials with very stable electronic properties can be strongly influenced by the adsorption of extrinsic molecules, which can act as surface donors or acceptors of electrons. The detection of molecules of NO 2 adsorbed on graphene [1], [2], [3], SnO 2 nanowires [4], or single-walled carbon nanotubes (SWCNTs) [5] is the examples of this detection method. Recently, a new customizable, low-power, and wireless platform has been developed to address resistive nanosensors [6].
Another possible sensing strategy consists of using suspended resonators, whose resonance frequency changes when specific gas molecules attach [7]. For example, H 2 adsorption on Pd-coated clamped bridges induces an axial stress responsible for decreasing the resonance frequency of the device [8]. On the other hand, the mass of functionalized resonators increases by the adsorption of CO 2 by zeolitic imidazolate framework (ZIF) [9], CO by ZnO [10], or ethanol vapors by a phthalocyanine copper layer [11]. The detection of shifts in the resonance frequency across several simultaneous resonant modes was reported in metal-oxide framework (MOF)-coated microbeams [12], [13]. More recently, nanostructured microcantilevers have also been proposed for sensing molecules in the vapor phase, showing improved selectivity and responsivity. For example, a 3-D framework of ZnO nanorods on Si-nanopillars was functionalized with a self-assembled monolayer for interacting with NO 2 [14]. Also, 3-D arrays of nanorods of TiO 2 and MnO 2 were synthetized on a commercial silicon cantilever and used to detect chemical warfare agents, such as dimethyl methylphosphonate [15].
Common to all the abovementioned examples is the chemical functionalization of the sensors. Chemical sensors are attractive due to their very high selectivity and sensitivity, allowing the detection of some gases in concentrations of the order of the parts per billion (ppb) [6], [16]. However, these also require difficult chemical or microfabrication steps for functionalization to a specific target, are prone to reliability and stability issues, are limited by the adsorption and diffusion processes at the surface, have slow response times, and require frequent calibration and cleaning steps [17], [18].
To circumvent these problems, physical gas sensors can be used. These are uncoated devices, capable of detecting a physical property of the environment in which they are immersed, and relate it with a certain gas or a composition of gases. A common sensing strategy relies on microthermal conductivity detectors. A heated device will reach a temperature, which depends on the thermal conductivity of the gaseous atmosphere surrounding the sensor. Steady-state [19] or transient state [20], [21] sensors exploiting this phenomenon have been proposed. The temperature of the microbeam can in addition be used to control the axial stress and resonance frequency of the beams near the buckling bifurcation point [22].
A different strategy consists of using uncoated resonators. These are highly responsive to changes in the surrounding environment and can promptly detect changes in physical properties of fluids. In fact, the dynamical response of microcantilevers strongly depends on the density and viscosity of the media, and shifts in quality factor [23] and/or resonance frequency [17], [24], [25], [26] have been used to discriminate the presence of gases [18]. These works are based on the interaction between a viscous fluid and a microcantilever, derived analytically by Sader [27], Van Eysden and Sader [28], and Maali et al. [29].
Regardless of the sensing principle, current works aim at simplifying the hardware setup, using digital electronics for maximum freedom of operations and at improving the versatility, responsivities, and limits of detection of the sensor [6]. In this work, we report a new sensing platform that uses an uncoated microcantilever as a physical sensor for realtime sensing, with unprecedented responsivity and limit of detection. In particular, we study the case of mass density sensing and derive and validate a general model and method to study the dynamical response of the system.

A. Proposed Platform
The proposed platform consists of a microcantilever self-excited in a phase-locked loop (PLL), comprising optomechanical and electronics modules. The optomechanical module, detailed in Fig. 1(A), is used to excite the microcantilever, oscillating in a viscous fluid within a closed cell, and optically detect its deflection with a laser reflected to a four-quadrant detector. The electronics module, detailed in Fig. 1(B), contains three direct digital synthesizers (DDDs), two low-pass filters (LPs), two analog-to-digital converters (A/Ds), a dsPIC microcontroller, and a Raspberry Pi and is used to analyze the deflection signal of the cantilever and generate the excitation voltage sent to the excitation piezo in real time. Fig. 2(A) shows a schematic of the electrical signals throughout the platform, whereas Fig. 2 In general, the deflection signal coming from the optomechanical unit is fed to the electronics unit, where it is demodulated by two reference direct-digital-synthesis signals [DDS-sine and DDS-cosine, Fig. 2 The Q-signal is fed to the programmed dsPIC and used as the error parameter in a PI controller, which continuously adjusts the frequency ω of the synthetized DDS reference signals and yet another DDS signal, which is used to excite the microcantilever [DDS-dither, Fig. 2(A)]. A phase difference φ, chosen by the user, is imposed between the reference and the dither excitation synthetized signals.
The excitation signal (DDS-dither) is finally fed back to the dither piezo in the optomechanical unit to excite the microcantilever. The Raspberry Pi indicated in Figs. 1(B) and 2(B) is used to interface the dsPIC microcontroller with the graphical user interface (GUI) software, transmitting data and commands during experiments. A more detailed description of the platform can be found in Appendix A.

B. Analytical Model
This system works as a PLL, with an imposed fixed phase φ between the excitation signal and the cantilever deflection. Any environmental change can then be detected by measuring the frequency and/or the amplitude of oscillation in real time. The microcantilever is modeled as a damped harmonic oscillator, including the added mass and damping terms caused by the interaction with the surrounding viscous medium [27], [29]. The oscillation frequency of the closed feedback loop [see Fig. 2(A)] imposed by the PI controller, ω, is obtained by considering the steady state of the system (quadrature component Q = 0). The oscillation frequency is a complex nonlinear function of the density and viscosity of the surrounding medium, microcantilever geometry, and imposed phase in the system φ and can be calculated by solving the following expression: with n = 0, 1, 2, . . . , defining the branch, where the response of the system gets locked, τ the total time delay of the signals around the loop (mostly due to the propagation of the acoustic waves from the excitation dither piezo to the cantilever through the cantilever holder), and m A and c A are the added mass and damping coefficients, respectively, due to the presence of the fluid, given by where ρ and η are the density and viscosity of the surrounding fluid, respectively, a 1 = 1.0553, a 2 = 3.7997, b 1 = 3.8018, and b 2 = 2.7364 are the constants to describe the hydrodynamic function [29], L and W are the length and width of the cantilever, respectively, and ω 0 , m 0 , and c 0 are its natural frequency, mass, and intrinsic damping, respectively. Equation (1) is solved numerically to extract the oscillation frequency of the system ω as a function of the rheological parameters of the media. The frequency of the oscillation ω calculated with (1) is then used to determine the I -signal of the system using where A is the amplitude of oscillation, given by These expressions are derived in detail in previous works [30], [31], in which a very similar system was used to measure the viscosity and viscoelastic properties of liquids.

A. Phase Characterization of Different Gases
A doped single crystal silicon cantilever ACST-TL from AppNano was used in the experiments. This has nominal dimensions of L = 160 µm, W = 28 µm, and T = 3.0 µm and a resonance frequency and quality factor in air of f 0 = 164.36 kHz and Q 0 = 250.
The first characterization of the system consisted of sweeping the imposed phase φ in the interval [0, −2π], while detecting the frequency and amplitude of oscillation of the closedloop under stable environmental conditions. Experimental and modeled oscillation frequencies and I -signal [or amplitude, see (4)] are shown in Fig. 3 as a function of the imposed phase φ. Fig. 3(A) shows the case of measurements in air at atmospheric pressure. Two distinct oscillation branches are observed, corresponding to the repeated periodic phase response of the microcantilever [32], over the complete 2π cycle of imposed phase φ. A slope is observed at the limits of the branches, due to the delay of the loop, τ = 10.65 µs [33]. Equation (1) models analytically each different branch by admitting a different value of n. Experimentally, these different branches are observed by using positive or negative gains of the PI controller. Three distinct imposed phase points are highlighted and will be further discussed in Figs. 4, 5 and 6. Fig. 3(B) shows the frequency and I -signal response of the microcantilever when immersed in different gases at atmospheric pressure and temperature. Experimental results (for He and N 2 gases) and simulations using (1) and (4) (for six different gases) are shown for the first branch (n = 4). Each  Modeled sensitivities (solid lines) for different gases, as a function of the imposed phase φ in the system. Inset: experimental data (colored symbols) obtained from the pressure curves for air and N 2 . Three phase points are highlighted for the ensuing discussion.
gas presents a different signature response, resulting from the different densities and viscosities that alter the added mass and damping coefficients given by (2) and (3).
Finally, Fig. 3(C) shows the response of the cantilever when immersed in N 2 at different pressures and room temperature. Experimentally, the pressure in the cell was increased from the atmospheric pressure of 1007-1150 mbar. A proportional increase in the value of density (from 0% to 15%) was considered in (1) and (4)   decreases both the oscillation frequency and amplitude due to the increased added mass and damping coefficients.
The developed analytical model captures the response of the microcantilever in different conditions and can therefore be used to predict the responsivity of the sensor. A particular case of density variations will be studied next to validate the performance of the platform.

B. Responsivity to Density Variations
The responsivity of the sensor to density variations is defined as the change of oscillation frequency in response to changes in the density of the fluid, or R ρ = (∂ f /∂ρ). Equation (1) is a highly nonlinear function, which prevents a simple analytical estimation of the responsivity. However, in first approximation, it can be assumed that the dependence between the oscillation frequency of the system, f , and the density of the fluid, ρ, is linear, and in units of Hz m 3 /kg. The point 1 in (6) represents the initial working point (with an oscillation frequency of f 1 at a density ρ 1 ), which is then perturbed to the new working point 2 by a small change of density (with ρ 2 causing an oscillation at f 2 ). Fig. 4 shows the modeled responsivity of the sensor to density variations of different gases as a function of the imposed phase φ, calculated with (1) and (6) and considering ρ 1 = 1.00ρ and ρ 2 = 1.15ρ [corresponding to the same experimental 15% pressure variation shown in Fig. 3(C)]. It can be observed that the responsivity to density variations depends on the imposed phase φ on the system, independent of the gas considered. Therefore, the desired response of the system should be controlled by selecting optimal values of the imposed phase φ for obtaining higher responsivities and lower limits of detection. In particular, using higher values of imposed phase (or, equivalently, working at below the natural resonance frequency, see Fig. 3) is advantageous for sensing applications, since considering, for example, the case of air (dark blue line), at φ = 125 • , R ρ ∼ 470 Hz·m 3 /kg, while for φ = 75 • , R ρ ∼ 400 Hz·m 3 /kg. The pressure variation in the experiments is proportional to density variations of the gases in the model. One can use the ideal gas law, P = ρ(RT /M M), with MM the molar mass of the gas, to convert pressure to density, as in with R = 0.08314 (dm 3 ·bar)/(K·mol), T in K, MM in g/mol, f in Hz, and P in bar. As defined in (7), R ρ has the units of Hz·dm 3 /g = Hz·m 3 /kg, which are the same units of (6). Equation (7) makes it possible to calculate the experimental responsivity values for air and N 2 from the experimental pressure curves [see Fig. 3(C)], which is shown in the inset of Fig. 4. As presented in (6), the responsivity to density is also a function of the individual geometry of the resonator and rheological properties of the surrounding fluid. This particular sensor shows a responsivity of ∼470 Hz·m 3 /kg for Air and N 2 and ∼800 Hz·m 3 /kg for He and H 2 , considering an imposed phase of φ = 130 • . According to [15], the responsivity increases for wider and thinner sensors.
The selection of the operating value of phase φ cannot be limited to the desired responsivity but must also take in account the amplitude of oscillation (I -signal). At low amplitudes, the transient response of the system is slower and noisier-the value of Q, used as the error parameter in the PI controller, depends on the amplitude of the resonator I -and therefore, too far for the resonance, the amplitude may not be proper for real-time sensing.

C. Noise and Minimum Frequency Shift
The frequency response of any real case resonator shows fluctuations due to the noise present in the mechanical and detection systems, electronic components, and surrounding environment. These fluctuations can limit the frequency detection when measuring shifts due to environmental changes, such as those induced by gas density variations. The minimum detectable frequency shift in the system presented in this work is, in theory, the smallest step of frequency generated by the digital synthesizers (hereafter defined as δ f s ), or δ f s = 0.0894 Hz (see Section IV). Therefore, the frequency stability of the system was studied to understand if this tiny frequency shift could indeed be detected, instead of being buried in the intrinsic frequency fluctuations of the platform.
The frequency stability of an oscillator is typically quantified in the time domain by the Allan variation. This quantity is the mean of the squared differences between consecutive in units of Hz 2 , with M is the total number of frequency measurements and f i the ith frequency measurement (averaged in the time window with duration τ ). Fig. 5 shows the results of measuring the Allan variation of the resonator for different controller conditions, at the three different imposed phases highlighted previously (φ = 75 • , 100 • , and 125 • ). These measurements consisted of fixing the phase value, choosing the proportional and integral gains of the controller, letting the system stabilize, and acquiring the oscillation frequency for 100 s at 1000 sample/s. It can be observed that, regardless of the phase value and controller conditions, for integration times longer than 6-7 s, the frequency drifts away due to temperature fluctuations, laser instabilities, or any other environmental variations (red areas in Fig. 5). This drift is around 0.1 Hz 2 (0.32 Hz), after 90 s, and, therefore, reliable detection of δ f s = 0.0894 Hz at this time scale is prevented.
Conversely, for integration times shorter than 7 s, it is possible to detect δ f s = 0.0894 Hz for each chosen phase value (yellow areas in Fig. 5). However, it is still necessary to consider the controller conditions in this region: poorly tuned controllers, such as those with low proportional/integral gains (dark blue, orange, and yellow lines in Fig. 5) show very little noise and frequency fluctuations, but mostly because these are unable to respond to any external stimulus, which cause slower transient responses and often an offset error (shown in Fig. 6). Properly tuned controllers (purple and green lines in Fig. 5) show stronger frequency fluctuations but are also more responsive to an external stimulus. If the gains are too high (light blue line), an oscillatory response can arise and the noise in the short integration times will be bigger than δ f s . Adequate methods and strategies to tune controllers in PLLs to achieve fast transients and noiseless responses are an active branch of research [34], [35], [36]. The slightly different responses of the system for different phases shown in Fig. 5 are caused by the amplitudes of the cantilever deflection in these specific working points. Fig. 3(A) confirms that the amplitude of deflection is larger near the resonance (φ = 100 • ), then at higher frequencies (φ = 75 • ) and finally at lower frequencies (φ = 125 • ). The continuously updated value of the error parameter Q depends on the amplitude of deflection I and, therefore, also impacts the frequency noise of the system.
Optimal experimental operating phase and controller conditions allow to detect frequency shifts equal to δ f s = 0.0894 Hz in processes occurring in the subsecond to 5-s period. This will be demonstrated in the next section.

D. Limit of Detection for Density Variations
A set of validation experiments are used to assess the limit of detection of the proposed system. These consist of fixing the phase (φ = 75 • , 100 • , and 125 • ) and the controller conditions (K P = 0.02 and K I = 0.02-green line of Fig. 5) and cycling the pressure in the cell filled with air, while measuring the oscillation frequency of the system.
Different variations of pressure were tested, until the induced shifts in oscillation frequencies approached δ f s . The results are shown in Fig. 6 and compiled in Table I in Appendix B.
As seen in Fig. 6, the same applied pressure change induces a larger frequency shift when the phase increases from φ = 75 • to 125 • , in agreement with the dependence of the responsivity to density on the imposed phase shown in Fig. 4. Reducing the pressure variation causes a proportional reduction on the shifts in oscillation frequency, regardless of the imposed phase. The 0.6-mbar pressure variation of corresponding to a density variation of . In this case, the jumps induced by the noise are comparable to those induced by the pressure variations. The limit of detection of the proposed platform can be calculated by the definition [28] LoD ρ = 3 δ f min R ρ (10) in units of kg/m 3 , where, as shown, δ f min = δ f s = 0.0894 Hz, and R ρ is the responsivity of the system to density variations as presented in Fig. 4. Equation (10) assumes that a threestandard deviation of frequency change can be understood as a measurement instead of noise. By substituting in (10) the corresponding values, one can expect a limit of detection (with this particular geometry of cantilever and a properly chosen imposed phase φ) of around 7.0 × 10 −4 kg/m 3 in air or N 2 , or 4.0 × 10 −4 kg/m 3 in He. The theoretical value calculated with (10) is identical to the values experimentally measured in air in the experiments shown in Fig. 6 [and calculated with (9)] and in Table I in Appendix C.

IV. DISCUSSION
In this work, we present a real-time sensing platform which uses a resonant uncoated microcantilever for detecting gas density changes with the best limit of detection reported to date. We present a sensing platform for real-time measurements of mass or rheological properties with high responsivity and low limits of detection. A general analytical model is used to capture the dynamical response of the uncoated resonant microcantilever and its response to variations of the environmental properties. This model is validated by performing experiments using different gases and pressures. In particular, we highlight the operation of the system as a gas density sensor and show the best limit of detection of gas density variation reported to date with this type of sensors. Table II in Appendix C shows a comparison of the state-of-the-art of physical resonant gas density sensors reported in the last years, discussing the methodology, responsivities and limits of detection of each one, and highlighting the advantages of this platform proposed here. Our shorter cantilever has a higher resonance frequency (∼4x, third row) and a higher responsivity (∼2x, fifth row). However, the reported LoD (sixth row) does not scale proportionally and is one to two orders of magnitude lower. This is mostly due to the ability of detecting the tiniest frequency shift induced by density variations with the low-noise electronics and making use of the improved responsivities at high imposed phases.
Improving the limits of detection of this system is still possible by increasing the responsivity of the sensor or by decreasing the minimum detectable step in frequency, δ f s . The first can be achieved by optimizing the geometry of the sensor, using, for example, a higher width-to-thickness ratio. The latter can be achieved by increasing the resolution frequency of the synthetized signals. The smallest frequency step depends on the driving clock frequency and the number of bits of the frequency register, which are set to 24 MHz and 28 bits in the current hardware. This corresponds to the above mentioned δ f s = (24 × 10 6 /2 28 ) = 0.0894 Hz.
Setting the driving clock at 24 MHz allows to get very accurate digitized waveforms in the hundreds of kilohertz region. Decreasing the clock frequency to 1 MHz, for example, would allow to generate a δ f s = 0.0037 Hz or 3.7 mHz (comparable with the theoretical values discussed in the last row of Table II in Appendix C), but at the expense of a lower maximum attainable frequency limit. A different possibility is also using 32-bit phase and frequency registers.
Given a high enough frequency step resolution (or small δ f s ), intrinsic noise in the system, such as thermomechanical and temperature fluctuations, adsorption-desorption events, defect motion, and moment exchange in gaseous atmosphere [37], [38], [39], will always be the ultimate limiting factors for detecting environmental changes. The optimal choice of δ f s should therefore be guided by the intrinsic noise of the system and the time scale of the process to be detected. As shown in Fig. 5, δ f s of the current platform is already enough to detect processes that occur in the time scale of 10 s to minutes, while can still be improved to sense subsecond phenomena.
In conclusion, as discussed in the last row of Table II, some optimizations in the present system will make possible to detect gas density variations of about 1-5 mg/m 3 using an uncoated physical resonant sensor, making it competitive to most of the commercial resistive, electrochemical and infrared absorption sensors, designed for specific detections [40]. Implementing an alternative control scheme (automatic gain control, for example) may allow to take full advantage of the maximum responsivity found far from the resonance, in regions of low-amplitude oscillation. The proposed sensing platform is general, independent on the surrounding medium, and the low-noise electronic module can still be used with a self-sensing piezoresistive cantilever, for example, or even with a resonator functionalized to a particular analyte, allowing to work with nontransparent fluids and making the platform more compact. Its sensing principles can be extended to liquid medium and to perform mass [41], viscosity [42], or viscoelasticity [43], [44] sensing. Technical solutions to stabilize the effect of cross-sensitivities to different atmospheric parameters (such as temperature, humidity, or radiation effects) must be sought [45] and implemented in real applications based on this platform.

APPENDIX A SETUP DETAILS
The resonance frequency and quality factor of the microcantilever in air were measured from an external actuation with an R9 Scanning Probe Microscopy (SPM) Controller from RHK Technology. The cantilever operates in a closed cell filled with gas. Acoustic excitation of the first flexural mode is provided by a small dither piezo buried in the polyether ether ketone (PEEK) plate, in close proximity to the cantilever base. Fixation of the cantilever chip on the horizontal plane is provided by a small amount of wax or adhesive. The closed cell is connected through a polypropylene tubing system to a small PEEK container adapted with a rubber membrane, which is forced to control the pressure in the cell. A gas flow orthogonal to the cantilever beam is present in the cell when a pressure variation occurs. However, all density variations considered are slow compared to the dynamics of the PI controller embedded in the PLL, which contribute to rapidly stabilize the cantilever response.
The optomechanical unit [see Fig. 1(A)] contains a laser diode source (650-nm wavelength, 3 mW) used for the detection of the microcantilever deflection. The laser beam is deflected by a tiltable mirror and sent to a polarizing beamsplitter. The linearly polarized component follows to a quarterwave plate, which creates a beam with circular polarization that reaches the cantilever through a focusing optics, mounted on a micrometric XYZ plate for precise adjustments. Once reflected on the cantilever, the beam passes through the quarter-wave plate and its polarization becomes linear and horizontal. It is finally deflected toward the four-quadrant detector photodiode (S4349 Hamamatsu, Japan) by the polarizing beam splitter. The tiny photocurrents are voltage-converted by a four-channels conditioning circuit (gain 10 5 ) placed close to the photocell to prevent any electromagnetic noise effect. The preamplified signals are fed to a custom analog algebraic board (ElbaTech Srl, Italy) that generates the deflection signal, which is finally sent to the electronics module [see Fig. 1(B)].
The electronics module, as shown in Fig. 1(B), comprises three DDDs (AD9833, Analog Devices Inc., USA), two LPs, two A/D converters, the dsPic microcontroller (dsPIC33EP512MC806, Microchip Technology Inc., USA), and the Raspberry Pi [46]. This module makes it possible to realize the control diagram shown in the orange-dotted region of Fig. 2(A). In particular, the DDDs share a common clock (24 MHz) and are thus synchronized to generate references (sine, cosine) and dither-piezo signals. The I /Q demodulators are implemented by the analog processor AD630 (Analog Devices Inc., [47]). Two fast, true-16-bit A/D converters provide the digital inputs (I and Q) to the dsPIC microcontroller, which runs direct clock-derived routines and whose firmware contains the digital control loops. The firmware serves both fast control loops and the data exchange to/from the Raspberry Pi implementing a first-in-first-out (FIFO)-based scheme.
The Raspberry Pi operates a Raspbian operating system and is directly connected to the dsPIC microcontroller by the native serial peripheral interface (SPI) and by universal asynchronous serial bus (UART) protocol for data and commands communication, respectively. It also implements highlevel network communication over Ethernet with an external computer, using the ZeroMQ protocol [48]. The latter runs a GUI software, in this case a C++ application, used to send the setting parameters of the experiment (initial frequency, frequency range, imposed phase shift and dither piezo amplitude), and the desired PI gains of the control feedback. The GUI software also receives the experimental data and provides data visualization and storage. This is a low-cost, modular and flexible architecture used for signal conditioning and data acquisition [49], [50] and designed to exploit the IoT features of Raspberry Pi mini single-board computer while adding fast real-time behavior by means of the dsPIC microcontroller.

APPENDIX B FREQUENCIES SHIFTS, RESPONSIVITIES, AND
LIMIT OF DETECTION The experimental results shown in Fig. 6 are detailed in Table I. ∂ f corresponds to the difference between the averaged Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. oscillation frequencies in the plateaus of a pressure cycle. The low and high values of frequency are calculated from averaging the frequency values from 18 to 21 s and from 22 to 25 s, respectively. Each time interval contains 3000 frequency points (sampling frequency of 1 kHz). The error associated with ∂ f is determined by adding the standard deviations from the mean value of each plateau. Table II compares the performance of previously reported resonant uncoated density sensors with the platform discussed in this work.