Measuring Dynamic Signals with Direct Sensor-to-Microcontroller Interfaces Applied to a Magnetoresistive Sensor

This paper evaluates the performance of direct interface circuits (DIC), where the sensor is directly connected to a microcontroller, when a resistive sensor subjected to dynamic changes is measured. The theoretical analysis provides guidelines for the selection of the components taking into account both the desired resolution and the bandwidth of the input signal. Such an analysis reveals that there is a trade-off between the sampling frequency and the resolution of the measurement, and this depends on the selected value of the capacitor that forms the RC circuit together with the sensor resistance. This performance is then experimentally proved with a DIC measuring a magnetoresistive sensor exposed to a magnetic field of different frequencies, amplitudes, and waveforms. A sinusoidal magnetic field up to 1 kHz can be monitored with a resolution of eight bits and a sampling frequency of around 10 kSa/s. If a higher resolution is desired, the sampling frequency has to be lower, thus limiting the bandwidth of the dynamic signal under measurement. The DIC is also applied to measure an electrocardiogram-type signal and its QRS complex is well identified, which enables the estimation, for instance, of the heart rate.


Introduction
In the society of the 21st century, almost everything (e.g., home appliances, mobile phones, cars, buildings, and cities) is becoming "smart" thanks to the proliferation of information and communication technology and the deployment of technologies, such as wireless sensor networks and the Internet of things. To become smart, it is essential, in the first place, to monitor through sensors what is happening in and/or around the smart thing. The data collected is processed and then a smart decision is taken with the aim of improving the safety, efficiency, sustainability, mobility, etc. of the smart thing and, hence, the people's quality of life.
Sensors are electronic devices that provide an output signal in the electrical domain (e.g., resistance, capacitance, voltage, or current) with information about the measurand. However, such an electrical signal is generally of low amplitude and carries some noise and, therefore, an electronic interface is required between the sensor and the processing digital system so as to correctly extract the information of interest. A classical block diagram of an electronic sensor interface is shown in Figure 1a. The sensor output signal is first processed in the analog domain by a signal conditioning circuit that generally relies shifting and amplification so as to match the sensor output span to the input span of the ensuing analog-to-digital converter (ADC) and, hence, to make good use of the ADC dynamic range. Other common tasks of the signal conditioning circuit are: sensor output-to-voltage conversion, filtering, linearization, and/or demodulation. The resulting analog signal is then digitized via the ADC. Finally, a digital system acquires, stores, processes, controls, communicates (to other devices or systems) and/or displays the digital value with information about the measurand. Nowadays, the most popular digital systems are microcontrollers (μC) and field-programmable gate arrays (FPGA). An alternative approach to reading some sensors (e.g., resistive [1][2][3][4], capacitive [5][6][7][8], inductive [9,10], and voltage-output [11,12] sensors) is shown in Figure 1b. This circuit topology is known as a direct interface circuit (DIC) since the sensor is directly connected to the digital system without using either the signal conditioning circuit or the ADC, thus resulting in a direct sensor-to-μC [13] or to-FPGA interface circuit [14,15]. In this topology, the digital system excites the sensor to obtain a time-modulated signal that is directly measured in the digital domain through a digital timer embedded into the digital system. In comparison with the sensor electronic interface shown in Figure  1a, a DIC is simpler and needs fewer components. Actually, it can be implemented with a common general-purpose 8-bit μC which is a low-cost (say, $1) and low-power (say, about 1 mA in active mode and less than 1 μA in power-down mode [16]) device. Modern μCs may also incorporate into the same chip an ADC that facilitates the design of the topology shown in Figure 1a, but an ADC demands more power than a digital timer. Therefore, a DIC based on a time-to-digital conversion [17,18] offers advantages in terms of cost, physical space, and power consumption, which is of major interest, for example, in autonomous sensors powered by either batteries or energy harvesters. Furthermore, the performance of such circuits, in terms of accuracy and resolution, is quite remarkable taking into account their simplicity, for instance: a non-linearity error of 0.01% full-scale span (FSS) and a resolution of 13 bits when measuring resistive sensors in the kilo-Ohm range [1], and 0.1% FSS and nine bits when measuring capacitive sensors in the picofarad range [5].
Although the performance and feasibility of DICs have been extensively analyzed and proved in the literature, these have been evaluated and then applied to measure static or quasi-static signals, i.e., slowly-varying magnitudes, such as temperature [1], relative humidity [5], or respiratory rate [19]. The analysis of the limitations and trade-offs of DICs when measuring sensors subjected to dynamic changes (e.g., vibrations, pulse rate, or alternating magnetic fields) have not been assessed so far. It has been widely thought that DICs were not able to measure such dynamic signals since they rely on measuring the charging or discharging time of an RC circuit, which can be quite long (say, units or tens of millisecond) if a high or medium resolution is required. This paper goes beyond these approaches and explores the feasibility of DICs to measure a resistive sensor with dynamic changes of resistance.
The paper is organized as follows. Section 2 qualitatively describes the operating principle of the DIC when measuring a resistive sensor. Section 3 theoretically analyzes the limitations and trade-offs of DICs in dynamic measurements. Section 4 describes the setup and the measurement method. Section 5 shows the experimental results and discusses them. Finally, Section 6 draws the main conclusions.

Sensor Digital System
Excitation signal  An alternative approach to reading some sensors (e.g., resistive [1][2][3][4], capacitive [5][6][7][8], inductive [9,10], and voltage-output [11,12] sensors) is shown in Figure 1b. This circuit topology is known as a direct interface circuit (DIC) since the sensor is directly connected to the digital system without using either the signal conditioning circuit or the ADC, thus resulting in a direct sensor-to-µC [13] or to-FPGA interface circuit [14,15]. In this topology, the digital system excites the sensor to obtain a time-modulated signal that is directly measured in the digital domain through a digital timer embedded into the digital system. In comparison with the sensor electronic interface shown in Figure 1a, a DIC is simpler and needs fewer components. Actually, it can be implemented with a common general-purpose 8-bit µC which is a low-cost (say, $1) and low-power (say, about 1 mA in active mode and less than 1 µA in power-down mode [16]) device. Modern µCs may also incorporate into the same chip an ADC that facilitates the design of the topology shown in Figure 1a, but an ADC demands more power than a digital timer. Therefore, a DIC based on a time-to-digital conversion [17,18] offers advantages in terms of cost, physical space, and power consumption, which is of major interest, for example, in autonomous sensors powered by either batteries or energy harvesters. Furthermore, the performance of such circuits, in terms of accuracy and resolution, is quite remarkable taking into account their simplicity, for instance: a non-linearity error of 0.01% full-scale span (FSS) and a resolution of 13 bits when measuring resistive sensors in the kilo-Ohm range [1], and 0.1% FSS and nine bits when measuring capacitive sensors in the picofarad range [5].
Although the performance and feasibility of DICs have been extensively analyzed and proved in the literature, these have been evaluated and then applied to measure static or quasi-static signals, i.e., slowly-varying magnitudes, such as temperature [1], relative humidity [5], or respiratory rate [19]. The analysis of the limitations and trade-offs of DICs when measuring sensors subjected to dynamic changes (e.g., vibrations, pulse rate, or alternating magnetic fields) have not been assessed so far. It has been widely thought that DICs were not able to measure such dynamic signals since they rely on measuring the charging or discharging time of an RC circuit, which can be quite long (say, units or tens of millisecond) if a high or medium resolution is required. This paper goes beyond these approaches and explores the feasibility of DICs to measure a resistive sensor with dynamic changes of resistance.
The paper is organized as follows. Section 2 qualitatively describes the operating principle of the DIC when measuring a resistive sensor. Section 3 theoretically analyzes the limitations and trade-offs of DICs in dynamic measurements. Section 4 describes the setup and the measurement method. Section 5 shows the experimental results and discusses them. Finally, Section 6 draws the main conclusions.

Operating Principle
The basic topology of a µC-based DIC for the measurement of a resistive sensor (R x ) is shown in Figure 2a [13], where C is a capacitor to build an RC circuit, P1 and P2 are two input/output digital ports, and V CC is the supply voltage of the µC. The DIC estimates the value of R x by measuring, through an embedded digital timer, the time interval needed to discharge C through R x from V CC to a certain threshold voltage. In order to reduce the uncertainty of the time-interval measurement, it is advisable to employ a port P1 associated to a capture module (or an external interrupt) having a Schmitt trigger (ST) buffer with a low (V TL ) and a high threshold voltage (V TH ). The measurement of the discharging time of the RC circuit to extract the value of R x is preferable than that of the charging time since the former uses V TL as a threshold voltage, which is less noisy than V TH [13].

Operating Principle
The basic topology of a μC-based DIC for the measurement of a resistive sensor (Rx) is shown in Figure 2a [13], where C is a capacitor to build an RC circuit, P1 and P2 are two input/output digital ports, and VCC is the supply voltage of the μC. The DIC estimates the value of Rx by measuring, through an embedded digital timer, the time interval needed to discharge C through Rx from VCC to a certain threshold voltage. In order to reduce the uncertainty of the time-interval measurement, it is advisable to employ a port P1 associated to a capture module (or an external interrupt) having a Schmitt trigger (ST) buffer with a low (VTL) and a high threshold voltage (VTH). The measurement of the discharging time of the RC circuit to extract the value of Rx is preferable than that of the charging time since the former uses VTL as a threshold voltage, which is less noisy than VTH [13]. The algorithm carried out by the µ C to obtain a digital value proportional to Rx involves two operating stages: (a) charging, and (b) discharging and time measurement, as shown in Figure 2b. In the first stage, P1 is set as an output providing a digital "1", while P2 is set as an input offering high impedance (HZ). Consequently, P1 generates a step pulse from 0 to VCC (i.e., from "0" to "1" in the digital domain) and, therefore, C is charged towards VCC through RP with a time constant τc = RPC, where RP represents the equivalent internal resistance of P1; RP is about tens of ohms [1], which is small enough to have a fast charge. This charging stage must last at least 5τc so as to ensure that the voltage across C (vc(t) in Figure 2b) has reached VCC. In the second stage, P2 is set as an output providing a digital "0", while P1 is set in HZ waiting for the threshold-voltage crossing. In such conditions, C is discharged towards ground through Rx + RN with a time constant τd = (Rx + RN) C, where RN represents the equivalent internal resistance of P2. In the meantime, the embedded timer measures the time interval required to do so. When vc(t) reaches VTL, the ST buffer is triggered and the timer stops. The charging and discharging times are, respectively, equal to: From Equation (1b), if C, VCC, VTL, and RN are assumed constant, then Td is proportional to Rx. The effects of the tolerance and low-frequency variability of these parameters can be compensated by adding reference components in the DIC and then applying auto-calibration techniques, as explained elsewhere [1,13]. In summary, the DIC first performs a resistance-to-time conversion and, then, a time-to-digital conversion, thus resulting in a digital number proportional to Td and, hence, to Rx. The algorithm carried out by the µC to obtain a digital value proportional to R x involves two operating stages: (a) charging, and (b) discharging and time measurement, as shown in Figure 2b. In the first stage, P1 is set as an output providing a digital "1", while P2 is set as an input offering high impedance (HZ). Consequently, P1 generates a step pulse from 0 to V CC (i.e., from "0" to "1" in the digital domain) and, therefore, C is charged towards V CC through R P with a time constant τ c = R P C, where R P represents the equivalent internal resistance of P1; R P is about tens of ohms [1], which is small enough to have a fast charge. This charging stage must last at least 5τ c so as to ensure that the voltage across C (v c (t) in Figure 2b) has reached V CC . In the second stage, P2 is set as an output providing a digital "0", while P1 is set in HZ waiting for the threshold-voltage crossing. In such conditions, C is discharged towards ground through where R N represents the equivalent internal resistance of P2. In the meantime, the embedded timer measures the time interval required to do so. When v c (t) reaches V TL , the ST buffer is triggered and the timer stops. The charging and discharging times are, respectively, equal to: From Equation (1b), if C, V CC , V TL , and R N are assumed constant, then T d is proportional to R x . The effects of the tolerance and low-frequency variability of these parameters can be compensated by adding reference components in the DIC and then applying auto-calibration techniques, as explained elsewhere [1,13]. In summary, the DIC first performs a resistance-to-time conversion and, then, a time-to-digital conversion, thus resulting in a digital number proportional to T d and, hence, to R x .

Analysis of the Dynamic Performance
Let us assume that the sensor resistance is subjected to sinusoidal changes, as shown in Figure 3, and so it can be expressed as: where R x,0 is the nominal resistance at a reference value of the measurand, ∆R x is the peak-to-peak change of resistance (which is considered to be much smaller than R x,0 , say less than ±10%), and f is the frequency of the sinusoidal change.

Analysis of the Dynamic Performance
Let us assume that the sensor resistance is subjected to sinusoidal changes, as shown in Figure 3, and so it can be expressed as: where Rx,0 is the nominal resistance at a reference value of the measurand, ΔRx is the peak-to-peak change of resistance (which is considered to be much smaller than Rx,0, say less than ±10%), and f is the frequency of the sinusoidal change.

Sampling Frequency
The DIC shown in Figure 2a takes a sample of Rx every Ts, as represented in Figure 3. This sampling period can be calculated as Tc + Td and, consequently, the sampling frequency is: Again, it is assumed that ΔRx << Rx,0 and, hence, fs can be considered almost independent of the measurand. If fs is high enough, which involves a low value of C, then the samples taken of Rx will enable the reconstruction of the dynamic signal affecting the sensor. Of course, the Nyquist criterion, which states that the signal must be sampled at least at twice the value of f, has to be satisfied. For a given application requiring a minimum value of fs, the maximum value of C can be calculated, from Equation (3), as: which decreases with increasing fs.

Frequency Response
The RC circuit in Figure 2a behaves as a passive integrating circuit, so that the dynamic changes of resistance are expected to be filtered. As a consequence of the integration process during the discharging time, we propose to define a "filtered" value of Rx that can be expressed as: where t0 is the instant at which the discharging stage starts. Inserting Equation (2) into Equation (5) yields: 2Ts NTs t Figure 3. Dynamic signal to be measured, modulating the sensor resistance as a sinusoidal wave.

Sampling Frequency
The DIC shown in Figure 2a takes a sample of R x every T s , as represented in Figure 3. This sampling period can be calculated as T c + T d and, consequently, the sampling frequency is: Again, it is assumed that ∆R x << R x,0 and, hence, f s can be considered almost independent of the measurand. If f s is high enough, which involves a low value of C, then the samples taken of R x will enable the reconstruction of the dynamic signal affecting the sensor. Of course, the Nyquist criterion, which states that the signal must be sampled at least at twice the value of f, has to be satisfied. For a given application requiring a minimum value of f s , the maximum value of C can be calculated, from Equation (3), as: which decreases with increasing f s .

Frequency Response
The RC circuit in Figure 2a behaves as a passive integrating circuit, so that the dynamic changes of resistance are expected to be filtered. As a consequence of the integration process during the discharging time, we propose to define a "filtered" value of R x that can be expressed as: where t 0 is the instant at which the discharging stage starts. Inserting Equation (2) into Equation (5) yields: Each measurement of the discharging time involves a different value of t 0 and, hence, Term1 in Equation (6) can have any value between −1 and 1. Therefore, R x,f in Equation (6) undergoes a resistance change whose amplitude can be normalized as follows: According to Equation (7), the measurement is subjected to a sinc-based low-pass filter (LPF) response, which involves zeros at specific values of frequency. This is similar to the performance obtained in integrating ADCs when rejecting interference superimposed on the input signal to be digitized [20], or in quasi-digital sensors when rejecting interference superimposed on the supply voltage [21,22]. Assuming common values of R x , R N , and R P , we have T d >> T c , and then T s ≈ T d and, consequently, Equation (7) can be rewritten as: which is represented in Figure 4 showing a maximum attenuation when f is a multiple of f s . The principal lobe of the response shown in Figure 4 determines the bandwidth of the DIC. At the Nyquist frequency (i.e., f = 0.5f s ), the attenuation factor is 3.9 dB. If f s = 10f, which will be under test in Section 5, then the attenuation factor is 0.1 dB.  (6) Each measurement of the discharging time involves a different value of t0 and, hence, Term1 in Equation (6) can have any value between −1 and 1. Therefore, Rx,f in Equation (6) undergoes a resistance change whose amplitude can be normalized as follows: According to Equation (7), the measurement is subjected to a sinc-based low-pass filter (LPF) response, which involves zeros at specific values of frequency. This is similar to the performance obtained in integrating ADCs when rejecting interference superimposed on the input signal to be digitized [20], or in quasi-digital sensors when rejecting interference superimposed on the supply voltage [21,22]. Assuming common values of Rx, RN, and RP, we have Td >> Tc, and then Ts ≈ Td and, consequently, Equation (7) can be rewritten as: which is represented in Figure 4 showing a maximum attenuation when f is a multiple of fs. The principal lobe of the response shown in Figure 4 determines the bandwidth of the DIC. At the Nyquist frequency (i.e., f = 0.5fs), the attenuation factor is 3.9 dB. If fs = 10f, which will be under test in Section 5, then the attenuation factor is 0.1 dB.

Resolution
A DIC for a resistive sensor with n bits is expected to provide a resolution in ohms equal to: where ΔRx,max is the maximum value of ΔRx for a given application. On the other hand, the digital timer that measures the discharging time has a timing resolution equal to the period (T0) of its reference oscillator; this is assuming that the uncertainty in the timing process is mainly due to quantization effects, which is valid if the value of C is not very high (say, smaller than 1 μF) [23]. Accordingly, the change in the discharging time caused by Δr must be at least longer than T0. Consequently, from Equations (1b) and (9), we can find the minimum value of C to achieve n bits: which increases with increasing n.

Resolution
A DIC for a resistive sensor with n bits is expected to provide a resolution in ohms equal to: where ∆R x,max is the maximum value of ∆R x for a given application. On the other hand, the digital timer that measures the discharging time has a timing resolution equal to the period (T 0 ) of its reference oscillator; this is assuming that the uncertainty in the timing process is mainly due to quantization effects, which is valid if the value of C is not very high (say, smaller than 1 µF) [23]. Accordingly, the change in the discharging time caused by ∆r must be at least longer than T 0 . Consequently, from Equations (1b) and (9), we can find the minimum value of C to achieve n bits: which increases with increasing n.

Trade-Offs
According to the previous subsections, there is a trade-off between the sampling frequency and the resolution of the measurement. The higher the value of f s , which involves a low value of C, the lower the resolution. On the contrary, the higher the resolution, which implicates a high value of C, the lower the value of f s . For instance, Table 1 shows the effects of different values of C on both the sampling frequency and the resolution, considering R x,0 = 743 Ω, ∆R x,max = 120 Ω (i.e., ±8%), V CC = 5.20 V, V TL = 1.76 V, R P = 24 Ω, R N = 28 Ω, and T 0 = 62.5 ns, which are the experimental values employed later in Sections 4 and 5. For a given application requiring n bits of resolution and a sampling frequency of f s , the value of C should be, combining Equations (4) and (10), within the following range: On the other hand, we also have the attenuation factor affecting the dynamic change of resistance that depends on the ratio f /f s . As C decreases, so does the ratio f /f s and, hence, the attenuation factor caused by the inherent LPF shown in Figure 4. Therefore, from the range of potential values of C resulting from Equation (11), it is advisable to select the smallest one so as to minimize such attenuation.
Another trade-off is present with regard to the effects of T 0 on the performance of the DIC. The lower the value of T 0 , the lower the minimum value of C to achieve n bits and, hence, the higher the maximum sampling frequency. This also has benefits in terms of cost since low-value capacitors are generally less expensive. However, a low value of T 0 requires a high-frequency reference oscillator, which involves a higher power consumption and can generate more trigger noise, affecting the threshold-voltage crossing.

Materials and Method
The DIC shown in Figure 2a has been implemented using a commercial 8-bit µC (ATmega328, Atmel, San Jose, CA, USA) running at 16 MHz and powered at +5 V. This supply voltage was provided by an independent voltage regulator (LM2940) to reduce the power supply noise/interference that may generate trigger noise affecting the discharging-time measurement [1]. The tasks of P1 and P2 in Figure 2a were carried out by P D2 and P B3 , respectively. An embedded 16-bit digital timer was employed to measure the discharging time with T 0 = 62.5 ns. The central processing unit (CPU) of the µC was placed in sleep mode (but the timer and the interrupt system kept working) during the discharging-time measurement to decrease the internal trigger noise generated by the CPU itself. The µC was programmed to acquire and save (in RAM) 250 samples of T d corresponding to 250 samples of R x . These samples were then sent via USB to a personal computer controlled by a LabVIEW program. The values of T d were then converted into R x through Equation (1b), and assuming the values of V CC , V TL , R P , and R N as indicated before in Section 3. 4 The sensor under test was a magnetoresistive sensor (TMR2503, MDT, Jiangsu, China) exposed to an alternating magnetic field, B(t), that was generated by an inductor of 3.3 mH excited by a waveform generator (33500B, Keysight Technologies, Santa Rosa, CA, USA), as shown in Figure 5. The sensor was placed near the inductor with its surface perpendicular to the generated magnetic field. The TMR2503 has four magnetoresistances connected in a Wheatstone bridge topology, but only a single equivalent resistance of the sensor was measured. To be precise, the equivalent resistance was one of the magnetoresistances (R 4 ) in parallel with the series combination of the other three (R 1 , R 2 , and R 3 ), as shown in Figure 5 in the dashed-line box. This equivalent resistance can be considered proportional to the magnetic field if the relative variation of resistance is much smaller than one [3]. only a single equivalent resistance of the sensor was measured. To be precise, the equivalent resistance was one of the magnetoresistances (R4) in parallel with the series combination of the other three (R1, R2, and R3), as shown in Figure 5 in the dashed-line box. This equivalent resistance can be considered proportional to the magnetic field if the relative variation of resistance is much smaller than one [3]. Two preliminary tests on the TMR2503 were initially conducted. The first test was intended to obtain the transfer curve (i.e., Rx versus B) of the sensor. To do so, the inductor was excited by a DC voltage source (2230G-30-1, Keithley Instruments, Cleveland, OH, USA) to generate a DC magnetic field that was measured by a magnetometer (Mag-01H, Bartington Instruments, Witney, UK), and the sensor equivalent resistance was measured by a digital multimeter (2110, Keithley Instruments, Cleveland, OH, USA). The second test was intended to monitor the sensor output signal through a classical read-out circuit when a sinusoidal magnetic field of 1 kHz was applied. In such a case, the sensor was supplied at 5 V and its differential output voltage was amplified by an instrumentation amplifier (AD620, Analog Devices, Norwood, MA, USA) with a gain of 100. The output signal of the amplifier was acquired by a digital oscilloscope (DSOX2014A, Keysight Technologies, Santa Rosa, CA, USA).
The dynamic performance of the DIC was then tested using the measurement set-up shown in Figure 5, which enables to change the frequency, amplitude, and waveform of B(t) and that of Rx(t). Three different experiments were carried out: (a) Experiment A, which was intended to observe the effects of frequency. The frequency of B(t) was varied from 10 Hz to the Nyquist frequency, the amplitude was the maximum (corresponding to a peak-to-peak amplitude of 20 V from the generator), and the waveform was sinusoidal. Three different values of C were tested: 100 nF, 330 nF, and 680 nF. (b) Experiment B, which was intended to observe the effects of amplitude. The frequency of B(t) was constant, the amplitude had three different levels (corresponding to a peak-to-peak amplitude of 5, 10, and 20 V from the generator), and the waveform was sinusoidal. A frequency of 1 kHz and a capacitor of 100 nF were selected. As shown later after presenting the results of Experiment A, this is the highest frequency that can be tested without the effects of the inherent LPF; note, from Table 1, that fs ≈ 10f when C = 100 nF and, hence, the attenuation factor is 0.1 dB. A higher frequency value could be tested using a smaller value of C, but then the resolution would be smaller than eight bits, which is usually considered as the minimum value in electronic instrumentation. (c) Experiment C, which was intended to observe the effects of the waveform. The inductor was PD2 RX/TX GND Two preliminary tests on the TMR2503 were initially conducted. The first test was intended to obtain the transfer curve (i.e., R x versus B) of the sensor. To do so, the inductor was excited by a DC voltage source (2230G-30-1, Keithley Instruments, Cleveland, OH, USA) to generate a DC magnetic field that was measured by a magnetometer (Mag-01H, Bartington Instruments, Witney, UK), and the sensor equivalent resistance was measured by a digital multimeter (2110, Keithley Instruments, Cleveland, OH, USA). The second test was intended to monitor the sensor output signal through a classical read-out circuit when a sinusoidal magnetic field of 1 kHz was applied. In such a case, the sensor was supplied at 5 V and its differential output voltage was amplified by an instrumentation amplifier (AD620, Analog Devices, Norwood, MA, USA) with a gain of 100. The output signal of the amplifier was acquired by a digital oscilloscope (DSOX2014A, Keysight Technologies, Santa Rosa, CA, USA).
The dynamic performance of the DIC was then tested using the measurement set-up shown in Figure 5, which enables to change the frequency, amplitude, and waveform of B(t) and that of R x (t). Three different experiments were carried out: (a) Experiment A, which was intended to observe the effects of frequency. The frequency of B(t) was varied from 10 Hz to the Nyquist frequency, the amplitude was the maximum (corresponding to a peak-to-peak amplitude of 20 V from the generator), and the waveform was sinusoidal. Three different values of C were tested: 100 nF, 330 nF, and 680 nF. (b) Experiment B, which was intended to observe the effects of amplitude. The frequency of B(t) was constant, the amplitude had three different levels (corresponding to a peak-to-peak amplitude of 5, 10, and 20 V from the generator), and the waveform was sinusoidal. A frequency of 1 kHz and a capacitor of 100 nF were selected. As shown later after presenting the results of Experiment A, this is the highest frequency that can be tested without the effects of the inherent LPF; note, from Table 1, that f s ≈ 10f when C = 100 nF and, hence, the attenuation factor is 0.1 dB. A higher frequency value could be tested using a smaller value of C, but then the resolution would be smaller than eight bits, which is usually considered as the minimum value in electronic instrumentation. (c) Experiment C, which was intended to observe the effects of the waveform. The inductor was excited with a narrowband signal with different amplitudes and frequency components.
To be precise, the excitation signal emulated an electrocardiogram (ECG) signal with a fundamental frequency of 1.5 Hz that corresponds to a heart rate of 90 beats per minute. ECG monitoring requires a read-out circuit whose bandwidth should be no less than 40 Hz [24]. In order to have such a bandwidth and also optimize the performance of the DIC in terms of resolution, a capacitor of 4.7 µF was selected. This capacitor provides, from Equation (3), a sampling frequency of around 200 Sa/s and, from Equation (8), a 3-dB cut-off frequency of 90 Hz. The ECG signal applied to the inductor was also monitored by the digital oscilloscope. Figure 6 shows the results obtained in the preliminary tests of the magnetoresistive sensor. On the one hand, Figure 6a shows the transfer curve of the sensor for a DC magnetic field ranging from −30 µT to +30 µT. According to these experimental results, we can confirm that the sensor equivalent resistance linearly changes with the magnetic field applied. On the other hand, Figure 6b shows the output signal in the time domain when the sensor (subjected to a sinusoidal magnetic field of 1 kHz) was measured by a classical read-out circuit. The resulting signal was also sinusoidal with the same frequency as that of the magnetic field applied, as expected, and without experiencing any kind of saturation problems.

Experimental Results and Discussion
The results obtained in the experiment A are represented in Figure 7, where the y-axis shows the value of ∆R x normalized to that obtained at 10 Hz and expressed in dB. The results in Figure 7 show that the measurement suffers from a LPF behavior that limits the bandwidth of the dynamic signal to be sensed, as suggested before in Section 3.2. The theoretical frequency response predicted by Equation (8) is also represented (as a solid line) in Figure 7, which shows good agreement with the experimental data. As C increased, both f s and the bandwidth decreased, as predicted before by Equation (3) and Figure 4, respectively. According to Figure 7, if the DIC has to measure, for instance, resistance variations at 1 kHz, it is advisable to employ a capacitor of 100 nF, which limits the resolution to around eight bits. Resistance variations at frequencies higher than 1 kHz would require a lower value of C in order to avoid the effects of the inherent LFP, but then the resolution would be lower than eight bits. Figure 8 shows the results achieved in the experiment B. First of all, the frequency of 1 kHz under test was located in the pass band of the LPF, as shown in Figure 7 for C = 100 nF. Second of all, the experimental value of f s was 10.2 kSa/s, which was high enough to measure a signal of 1 kHz; in other words: around 10 samples per period were taken. The three levels of the magnetic field applied to the sensor (represented in Figure 8 as "Mag1", "Mag2", and "Mag3", being Mag1 > Mag2 > Mag3) caused a ∆R x of 120 Ω, 66 Ω, and 36 Ω, respectively. If Mag1 is assumed to be the maximum magnetic field under measurement, then ∆r = 577 mΩ, as reported before in Table 1, which generates quantization effects that are more evident when measuring low-amplitude signals. This is shown, for instance, in Figure 8 for the Mag3 case, where two consecutive samples taken close to the maximum of the sinusoidal signal have the same measurement result; in other words: the DIC was not able to detect the resistance change between these two samples. For this reason, the "sinusoidal" signal reconstructed from the samples was more distorted for Mag3 than for Mag1. from −30 μT to +30 μT. According to these experimental results, we can confirm that the sensor equivalent resistance linearly changes with the magnetic field applied. On the other hand, Figure 6b shows the output signal in the time domain when the sensor (subjected to a sinusoidal magnetic field of 1 kHz) was measured by a classical read-out circuit. The resulting signal was also sinusoidal with the same frequency as that of the magnetic field applied, as expected, and without experiencing any kind of saturation problems. The results obtained in the experiment A are represented in Figure 7, where the y-axis shows the value of ΔRx normalized to that obtained at 10 Hz and expressed in dB. The results in Figure 7 show that the measurement suffers from a LPF behavior that limits the bandwidth of the dynamic signal to be sensed, as suggested before in Section 3.2. The theoretical frequency response predicted by Equation (8) is also represented (as a solid line) in Figure 7, which shows good agreement with the experimental data. As C increased, both fs and the bandwidth decreased, as predicted before by Equation (3) and Figure 4, respectively. According to Figure 7, if the DIC has to measure, for instance, resistance variations at 1 kHz, it is advisable to employ a capacitor of 100 nF, which limits the resolution to around eight bits. Resistance variations at frequencies higher than 1 kHz would require a lower value of C in order to avoid the effects of the inherent LFP, but then the resolution would be lower than eight bits. Figure 8 shows the results achieved in the experiment B. First of all, the frequency of 1 kHz under test was located in the pass band of the LPF, as shown in Figure 7 for C = 100 nF. Second of all, the experimental value of fs was 10.2 kSa/s, which was high enough to measure a signal of 1 kHz; in other words: around 10 samples per period were taken. The three levels of the magnetic field applied to the sensor (represented in Figure 8 as "Mag1", "Mag2", and "Mag3", being Mag1 > Mag2 > Mag3) caused a ΔRx of 120 Ω, 66 Ω, and 36 Ω, respectively. If Mag1 is assumed to be the maximum magnetic field under measurement, then Δr = 577 mΩ, as reported before in Table 1, which generates quantization effects that are more evident when measuring low-amplitude signals. This is shown, for instance, in Figure 8  of the sinusoidal signal have the same measurement result; in other words: the DIC was not able to detect the resistance change between these two samples. For this reason, the "sinusoidal" signal reconstructed from the samples was more distorted for Mag3 than for Mag1.  The results from the experiment C are shown in Figure 9. The ECG signal was acquired by the oscilloscope operating at 250 Sa/s (upper trace in Figure 9) and by the DIC at 200 Sa/s (bottom trace in Figure 9). The signal reconstructed from the samples acquired by the DIC was very similar to the original one monitored by the oscilloscope. For the highest amplitudes (QRS complex of the ECG [25]), the shape of the reconstructed wave was well preserved and, hence, it was possible to estimate the fundamental frequency (i.e., 1.5 Hz) of this periodic signal. However, for low amplitudes (e.g., T and P wave of the ECG), the reconstruction of the signal was slightly distorted, as also observed before in Figure 8 for the Mag3 case. The results in Figure 9 demonstrate that a DIC can not only of the sinusoidal signal have the same measurement result; in other words: the DIC was not able to detect the resistance change between these two samples. For this reason, the "sinusoidal" signal reconstructed from the samples was more distorted for Mag3 than for Mag1.  The results from the experiment C are shown in Figure 9. The ECG signal was acquired by the oscilloscope operating at 250 Sa/s (upper trace in Figure 9) and by the DIC at 200 Sa/s (bottom trace in Figure 9). The signal reconstructed from the samples acquired by the DIC was very similar to the original one monitored by the oscilloscope. For the highest amplitudes (QRS complex of the ECG [25]), the shape of the reconstructed wave was well preserved and, hence, it was possible to estimate the fundamental frequency (i.e., 1.5 Hz) of this periodic signal. However, for low amplitudes (e.g., T and P wave of the ECG), the reconstruction of the signal was slightly distorted, as also observed before in Figure 8 for the Mag3 case. The results in Figure 9 demonstrate that a DIC can not only The results from the experiment C are shown in Figure 9. The ECG signal was acquired by the oscilloscope operating at 250 Sa/s (upper trace in Figure 9) and by the DIC at 200 Sa/s (bottom trace in Figure 9). The signal reconstructed from the samples acquired by the DIC was very similar to the original one monitored by the oscilloscope. For the highest amplitudes (QRS complex of the ECG [25]), the shape of the reconstructed wave was well preserved and, hence, it was possible to estimate the fundamental frequency (i.e., 1.5 Hz) of this periodic signal. However, for low amplitudes (e.g., T and P wave of the ECG), the reconstruction of the signal was slightly distorted, as also observed before in Figure 8 for the Mag3 case. The results in Figure 9 demonstrate that a DIC can not only measure dynamic signals with a sinusoidal behavior, but also more complex signals with a limited bandwidth.

Conclusions
This work has gone a step further in the field of DICs based on a RC circuit by applying them to measure a resistive sensor subjected to dynamic changes. The limitations and trade-offs have been identified and theoretically analyzed. It is remarkable the fact that the RC circuit not only generates a discharging time with information about the sensor resistance, but it also causes a sinc-based LPF behavior that limits the bandwidth. It has been shown that there is a trade-off between the sampling frequency and the resolution of the measurement, and this depends on the selected value of the capacitor of the RC circuit. Experimental tests have been carried out through a commercial microcontroller measuring a magnetoresistive sensor exposed to a magnetic field of different frequencies, amplitudes, and waveforms. According to these experimental results, sinusoidal variations of resistance with a frequency up to 1 kHz can be acquired with a resolution of eight bits. The capability of the DIC to monitor signals with a more complex waveform, such as an ECG signal, has also been demonstrated. The QRS complex of this ECG signal has been well identified and, therefore, the heart rate could be easily estimated.

Conclusions
This work has gone a step further in the field of DICs based on a RC circuit by applying them to measure a resistive sensor subjected to dynamic changes. The limitations and trade-offs have been identified and theoretically analyzed. It is remarkable the fact that the RC circuit not only generates a discharging time with information about the sensor resistance, but it also causes a sinc-based LPF behavior that limits the bandwidth. It has been shown that there is a trade-off between the sampling frequency and the resolution of the measurement, and this depends on the selected value of the capacitor of the RC circuit. Experimental tests have been carried out through a commercial microcontroller measuring a magnetoresistive sensor exposed to a magnetic field of different frequencies, amplitudes, and waveforms. According to these experimental results, sinusoidal variations of resistance with a frequency up to 1 kHz can be acquired with a resolution of eight bits. The capability of the DIC to monitor signals with a more complex waveform, such as an ECG signal, has also been demonstrated. The QRS complex of this ECG signal has been well identified and, therefore, the heart rate could be easily estimated.