scieee AI-readable full text Open interactive document viewer

Demodulating AM square signals via a digital timer for sensor applications

Reverter Cubarsí, Ferran,Gasulla Forner, Manuel

Abstract

This paper evaluates theoretically and experimentally the performance of a timer-based demodulator applied to low-frequency amplitude-modulated (AM) square signals coming from sensor circuits. The demodulator extracts the amplitude of the AM square signal by measuring the period of a reference triangular signal that is altered by the AM signal itself, as already suggested in a previous paper but for AM sinusoidal signals.

Full text

IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT  Abstract—This paper evaluates theoretically and experimentally the performance of a timer-based demodulator applied to low-frequency amplitude-modulated (AM) square signals coming from sensor circuits. The demodulator extracts the amplitude of the AM square signal by measuring the period of a reference triangular signal that is altered by the AM signal itself, as already suggested in a previous paper but for AM sinusoidal signals. The demodulation and digitization are carried out simultaneously via a digital timer and without requiring a rectifier, a mixer, a low-pass filter, or an analog-to-digital converter, thus resulting in a simple and low-cost design solution. Unlike the sinusoidal case, this paper proposes to infer the amplitude of the AM square signal by measuring the bias of the period measurement with respect to the ideal (known) value. Experimental results show a non-linearity error lower than 0.03% full-scale span and a resolution of 13.3 bits. Index Terms— AM signal, demodulator, digital timer, time-to- digital converter, sensor interface electronics. I. INTRODUCTION HE continuous process scaling in the design of CMOS integrated circuits is characterized by the reduction of both the transistor channel length and the supply voltage, but the noise floor does not go down in the same way [1]. Accordingly, voltage-based signal processing circuits undergo a resolution degradation since the headroom becomes smaller. However, time-based signal processing circuits do not have such a limitation because there is no limit in the measurement of time. In addition, since the transistor switching speed increases, the resolution in time becomes finer [2]. For these reasons, time-based signal processing circuits are becoming quite attractive in electronic instrumentation. The output signal of time-based signal processing circuits is generally read by a time-to-digital converter (TDC), which relies on a digital timer/counter, whereas that of voltage-based circuits by an analog-to-digital converter (ADC). In microcontroller-based designs, the current consumption of an embedded TDC is lower than that of an ADC [3] and, in integrated designs, the layout area occupied by a TDC [4] is Manuscript received Month xx, 2xxx; revised Month xx, xxxx; accepted Month x, xxxx. This work was supported by the Spanish Ministry of Economy and Competitiveness and the European Regional Development Fund under project TEC2016-76991-P. Ferran Reverter and Manel Gasulla are with the Department of Electronic Engineering, Universitat Politècnica de Catalunya – BarcelonaTech, Castelldefels (Barcelona), 08860, Spain (e-mail: [email protected]du; manel.g[email protected]). clearly smaller (up to two orders of magnitude) than that required by an ADC. Consequently, in terms of digitization of the information, time-based signal processing circuits also offer significant advantages. Taking into account the benefits of using time instead of voltage as the medium to transmit information, time-based circuits have been extensively analyzed and developed in the last decade for sensor applications. For example, there are circuits that measure the charging or discharging time of an RC or RL network that includes a resistive [5]-[7], capacitive [8]-[10], or inductive [11]-[13] sensor. A similar approach has also been proposed to measure sensors that provide a voltagemodulated output [14], [15], but this is assumed of very low frequency or quasi static. The only attempt to measure sinusoidal amplitude-modulated (AM) sensor signals, with a carrier frequency in the range of kilohertz, through a digital timer was suggested in [16] and then improved in [17]. Unlike conventional demodulation techniques [18], [19] that require a rectifier/mixer, a low-pass filter (LPF), and an ADC, the demodulator proposed in [16] extracts and digitizes the AM- signal amplitude mainly via a digital timer. Its feasibility, however, was only demonstrated for AM sinusoidal signals. Some examples can be found in the literature where the sensor (e.g. resistive [20],[21] or capacitive [22]-[24]) is excited by a square wave and then provides an AM square signal. The main advantage of operating with square instead of sinusoidal signals is the simplicity to generate the excitation signal, which can be directly done by a microcontroller unit (MCU) [25]. As in the sinusoidal case [18],[19], such AM square signals are usually demodulated by a rectifier/mixer and an LPF, and then an ADC for the digitization. The first stage can be either asynchronous or synchronous. As for the asynchronous topology, the simplest circuit is the peak detector, but it is not suggested for instrumentation purposes due to its high noise sensitivity. An alternative is the averaging detector that is usually implemented by an active full-wave rectifier [23]. On the other hand, synchronous topologies, which provide a better noise/interference rejection, generally rely on a 1 switched-gain amplifier [20],[22] that can be also adapted to a single-supply operation [25]. For those sensors with a pre-amplifier stage providing a differential AM square signal, the mixer is normally synchronous and relies on four switches properly interconnected [26], [27]. Another reported technique is based on synchronous sampling, where the singleended or differential AM square signal is sampled at the carrier frequency or at a submultiple [28]. This paper, which continues and expands the work in [29], aims to prove that the timer-based demodulator proposed in Demodulating AM Square Signals via a Digital Timer for Sensor Applications Ferran Reverter and Manel Gasulla T IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT [16], [17] is also valid for AM square signals, without requiring a rectifier/mixer, an LPF, or an ADC. The paper is organized as follows. Section II describes the operating principle. Section III analyzes the optimal operating conditions and limitations. Section IV describes the materials and method. Section V reports the experimental results. Section VI compares the performance with the state of the art. Finally, Section VII draws the main conclusions. II. O PERATING P RINCIPLE Following the approach suggested in [16], the timer-based demodulator presented herein extracts the amplitude of the AM square signal by measuring the period of a reference triangular signal, which suffers from interference effects [30] generated by the AM signal itself. A block diagram of the proposed demodulator is shown in Fig. 1(a). The sensor (or a sensor circuit such as a charge amplifier) is excited by an MCU, thus generating a square signal with a certain carrier frequency (f c ), a duty cycle of 50%, and a peak-to-peak amplitude (A s ) modulated by the measurand. This signal, via a simple front-end stage, is ac-coupled to a constant threshold voltage that is then compared to the reference triangular signal with a frequency f 0 , as shown in Fig. 1(b). As a consequence of this comparison, a square signal is generated at the comparator output whose period is modulated by A s . This signal is then measured by an embedded digital timer. The schematic of the circuit to carry out such a demodulation is shown in Fig. 2 and is composed of: 1) an oscillator providing a triangular-wave voltage (V 1 ) with an amplitude of V DD , an offset of V DD /2, and a period of T 0 (= 1/f 0 ); 2) a shifting and AC-coupled circuit that generates a voltage V 2 equal to V DD /2 plus the AM square signal; 3) a voltage divider made by R 2 and R 3 yielding a low voltage (V 3 ); 4) a 2:1 analog multiplexer (MUX) that provides an output voltage (V 4 ) equal to either V 2 or V 3 ; 5) a comparator (CMP) that compares V 1 and V 4 and outputs a square-wave voltage (V 5 ) whose period equals T; and 6) a digital timer that measures T from rising to rising edge. The position of the MUX depends on the logic level of V 5 : position “0” when V 5 is low, and position “1” when V 5 is high. Fig. 3 shows the operating principle of the circuit in Fig. 2 by representing the waveform of its main signals. Initially, the MUX is at position “0” so that V 1 is compared to V 2 . At instant t 1 we have the first trigger point: V 1 becomes higher than V 2 and, then, V 5 swaps to a high level that implies the start of the period measurement and the change of the position of the MUX. From now on, V 1 is compared to V 3 , which is a low value (e.g. 50 or 100 mV). Afterwards, at instant t 2 , V 1 becomes lower than V 3 and, hence, V 5 swaps to a low level. This moves the MUX to position “0”, thus comparing again V 1 and V 2 . Then, at instant t 3 , we have the second trigger point: V 1 crosses again V 2 causing a low-to-high transition in V 5 that stops the period measurement. Therefore, the result is T instead of T 0 due to the interference effects caused by the AM square signal. Of course, if A s = 0 then T = T 0 . Variations of the threshold voltage (e.g. caused by the input offset voltage of the CMP or the mismatch between the two resistances, R 1 , of the front-end stage) do not affect the period measurement. (a) (b) Fig. 1. (a) Block diagram of the proposed timer-based demodulator for AM square signals. (b) Basics of the operating principle showing the main waveforms. Ref. triang. signal A s 1/f c T 0 =1/f 0 CMP Timer Constant threshold voltage T  T 0 Couples to… AM square signal Fig. 3. Waveform of the main signals in Fig. 2. T VDD T0 t VDD t V5 V1 V2 V3V4 t1t2 As t3 VDD/2 t4t5t6 Fig. 2. Timer-based demodulator for AM square signals. IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT Thanks to the MUX, the comparison between the triangular and AM signals is carried out just at the beginning and at the end of the period measurement. Any potential crossing between V1 and V2 from t1 to t2 does not affect the measurement, thus avoiding aberrant period readings and extending the operating range [17]. If the MUX was not moved to position “1” after t1, the comparison between V1 and V2 would have non-desired crossings at instants t4, t5, and t6 that would generate an aberrant value of T. The response of the circuit in Fig. 2 highly depends on the ratio fc / f0 [16],[29]. The preliminary experimental results reported in [29] showed that using fc / f0 = m + 0.5, m being any positive integer including the zero, provides the most promising results in terms of linearity. In such conditions, the period measurement undergoes a bias with respect to the ideal (known) value that linearly increases with As. This is theoretically analyzed in Section III. III. THEORETICAL ANALYSIS A. Scenarios under study Let us assume the triangular and square signals as described in Section II, fc / f0 = m + 0.5, and that period measurements are taken every other cycle [16]. When these signals are compared, three scenarios are possible: 1) At both trigger points, the square signal has a null slope (i.e. horizontal line), as shown, for instance, in Fig. 4(a). In such a case, there is a time deviation at each trigger point that can be expressed, in absolute value, as t s 2SR e A (1) where SR (=2VDD/T0) is the slew rate of the triangular signal. The time deviation in (1) has the same sign at both trigger points and, hence, the overall bias is s s 0 T t DD 2 SR 2V A AT e e   (2) From (2), the bias increases with increasing As with the following sensitivity T0 1 s DD 2V e T SA     (3) 2) At both trigger points, the triangular signal intersects a vertex of the square signal, as shown, for example, in Fig. 4(b). Here, (1) is applicable but now the two contributions have opposite signs and, consequently, the overall bias equals zero. 3) The square signal has an infinite slope (i.e. vertical line) at one trigger point, but null slope at the other, as shown, for instance, in Fig. 4(c). In such conditions, we have a sensitivity S3 = S1/2 since the fact of increasing As just modifies the bias at a single trigger point. The overall bias can take here any value between the two found before: s 0 T DD 0 2V AT e  (4) The comparison between the triangular and square signals will be in one of the three previous scenarios depending on the phase shift () between these two signals; here,  is quantified in degrees with reference to the triangular signal. Scenario #1 is the optimal since its provides the highest sensitivity. B. Analysis for m = 0 Fig. 5 shows how the overall (normalized) bias depends on  for m = 0. For  = 0º, as shown in Fig. 4(a), the comparison is in scenario #1, thus achieving the maximum bias. This situation is valid until  = 90º, as shown in Fig. 4(b), where scenario #2 becomes applicable and the bias is zero. For a higher value of , the comparison is in scenario #3. A particular case of that is what happens at  = 90º, which is represented in Fig. 4(c). Here, just one of the two trigger points suffers from a bias and, hence, |eT| = |et|. Scenario #3 is applicable until  = 90º+, as shown in Fig. 4(d). From now on, scenario #1 is again experienced, as represented in Fig. 5. The value of  can be found by means of Fig. 4(b), where there is a time interval (t) that can be expressed as s s 0 DD 2SR 4V A AT t   (5) which corresponds to Fig. 4. Waveforms in the time domain assuming fc / f0 = 0.5 for different phase shifts: (a)  = 0º; (b)  = 90º; (c)  = 90º; and (d)  = 90º+. IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT s 0 DD φ 360 º 90º V A t T     (6) According to (6), the higher As, the higher  and, hence, the narrower the region in which scenario #1 is applicable, which is qualitatively represented in Fig. 6. Considering that the maximum value of As to be demodulated is 4.75 V at VDD = 5 V, which is a rail-to-rail (R2R) operation with a small safety margin, we can find from (6) that  = 85.5º. Therefore, operating at 4.5º <  < 175.5º is not recommended if the maximum sensitivity (S1) related to scenario #1 is the target. Note that  = 0º, which in principle seems the easiest to be generated by the MCU, is valid for a R2R operation. C. Analysis for m > 0 If m = 1, which means that fc is three times higher than with m = 0, then three regions experiencing the effects of scenarios #2 and #3 are present along the 360º, as shown in Fig. 7. The centers of these three regions are separated by 120º (= 360º/3). On the other hand, if m = 2, which implies that fc is five times higher, then five regions are affected by scenarios #2 and #3 whose centers are separated by 72º (= 360º/5). In summary, the higher the value of m, the narrower the interval of phase shift in which scenario #1 is applicable. Let us analyze in more detail the case with m = 1 represented in Fig. 7. Scenario #1 is feasible whenever 2 < 120º. Accordingly, from (6), the maximum value of As (As,max) that can be demodulated at S1 is opt 1 s,max DD φ 2 3 m A V  (7) which corresponds to an optimal operating phase, at the first quadrant, of opt = 30º (= 90 – 120º/2). Operating at both  = 0º and S1 is also possible, but now As,max equals 1 s,max DD φ 0 3 m A V    (8) which can be obtained from (6) assuming that  < 30º in order to have 1 < 360º in Fig. 7. Applying  = 90º (or 210º or 330º) does provide a R2R operation, but at S3 (= S1/2). A similar analysis for m = 2 enables us to find As,max at S1 applying opt (= 54º) and  = 0º, which are, respectively, opt 2 s,max DD φ 2 5 m A V  (9) 2 s,max DD φ 0 5 m A V    (10) Accordingly, the operating range at maximum sensitivity becomes clearly lower as m increases. D. Response for As > As,max Each operating phase has its own As,max at S1. The effects of operating at As > As,max is evaluated considering two different situations: 1) moving from scenario #1 directly to scenario #3, or 2) moving from scenario #1 to scenario #3 through scenario #2. These two situations are graphically represented in Figs. 6 and 8 assuming two operating phases a and b, respectively. In the former case (a), the higher As, the higher the bias, but when As > As,max,a the sensitivity becomes S3 (= S1/2). Note that the increment of bias in Fig. 6 when As increases from As2 to As3 (from point 2 to 3) is half of that expected if the circuit still was in scenario #1. In the latter case (b), when As > As,max,b, the bias suffers from a significant decrease. This can be seen, s3 0 DD 2V A T s2 0 DD 2V A T s1 0 DD 2V A T s1 0 DD 4V A T Fig. 6. Bias versus the phase shift for different As (As3 > As2 > As1). |norm. bias| Fig. 7. Normalized bias versus the phase shift for fc / f0 = 1.5. Unlike Fig. 5, the effects of scenarios #2 and #3 are repeated every 120º. Fig. 5. Normalized bias versus the phase shift for fc / f0 = 0.5. Fig. 8. Bias versus As for different values of the phase shift. IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT for example, in Fig. 6 when A s increases from A s1 to A s2 , but the bias decreases from point 1 to 2. After that, the bias increases with increasing A s but at S 3 , as represented in Fig. 8. IV. M ATERIALS AND M ETHOD The timer-based demodulator shown in Fig. 2 was built in a printed circuit board (PCB) using the following commercial off-the-shelf components and devices: 1) an ultrafast singlesupply CMP (AD8561 from Analog Devices); 2) a CMOS single-supply MUX (ADG719 from Analog Devices) with a high switching speed and a low on-resistance; and 3) R 2 and R 3 were chosen to have V 3  100 mV at V DD = 5 V. The operating principle was experimentally proven using the setup shown in Fig. 9 with the following instrumentation. A two-channel waveform generator (Keysight 33510B) provided the triangular and AM square signals. The triangular signal had an amplitude of 5 V, an offset of 2.5 V, and a frequency of f 0 . On the other hand, the AM square signal had a peak-to-peak amplitude of A s , an offset of 2.5 V (so that the shifting and AC-coupled circuit was not required), a duty cycle of 50 %, and a frequency of f c . The phase shift between these two signals was also under control through the same equipment. A bench-top universal counter (Agilent 53220A) measured the period of the CMP output. This was configured to carry out a single-period measurement, which was realized every other cycle according to the internal firmware of the instrument. A power supply (Keysight E3631A) provided the supply voltage to the CMP, MUX, and voltage divider of the demodulator. The performance of the circuit in Fig. 2 was experimentally evaluated for different values of A s , f c /f 0 and . The ratios f c /f 0 under test (0.5, 1.5 and 2.5) were obtained by changing f c (0.5, 1.5, and 2.5 kHz) and keeping f 0 constant to 1 kHz. Noise effects on the circuit were also tested by intentionally adding noise to the signals under comparison. The noise was Gaussian and white with a bandwidth of 7 MHz, and provided by another waveform generator (Agilent 33210A). V. E XPERIMENTAL RESULTS A. Preliminary measurements When the proposed demodulator was tested applying f c / f 0 = m + 0.5, the period measurement showed a bias with respect to the ideal value that depended on A s , as expected. Such a bias was either positive or negative, but it always had the same sign provided that period measurements were taken every other cycle [16]. The histogram of a set of period measurements was clearly Gaussian with a standard deviation (STD) of around 25 ns, regardless of the value of A s . This STD can be ascribed to the inherent noise of the two signals under comparison and of the comparator. Fig. 9. Measurement setup to prove the timer-based demodulator. Fig. 10. Experimental bias versus the amplitude for fc / f0 = 0.5 (m = 0). 0 50 100 150 200 250 300 350 400 450 500 0 1 2 3 4 5 Bias (ms) Amplitude of AM signal (V) = 0º = 90º Fig. 11. Experimental bias versus the amplitude for fc / f0 = 1.5 (m = 1). 0 50 100 150 200 250 300 350 400 450 500 0 1 2 3 4 5 Bias (ms) Amplitude of AM signal (V) = 0º = 90º  opt =30º 3.25V 1.65V Fig. 12. Experimental bias versus the amplitude for fc / f0 = 2.5 (m = 2). 0 25 50 75 100 125 150 175 200 225 250 0 1 2 3 4 5 Bias (ms) Amplitude of AM signal (V) = 0º 0.95V 1.95V = 90º  opt =54º IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT B. Bias versus signal amplitude Figs. 10, 11, and 12 show the experimental results of the bias (in absolute value) in the period measurement versus A s for m = 0, 1, and, 2, respectively. In Fig. 10 (m = 0), the circuit shows a linear R2R operation for the two values of  under test, but the sensitivity at  = 0º is twice that obtained at  = 90º, which agrees with the explanation provided in Section III. For  = 0º, the response in Fig. 10 has a sensitivity of 99.4 µs/V, which is very similar to the theoretical value (100 µs/V) predicted by (3). In Fig. 11 (m = 1), the circuit was able to linearly demodulate the signal at maximum sensitivity (S 1 ) up to 1.65 V when  = 0º, and 3.25 V when  opt = 30º, which agree with the values estimated by (8) and (7), respectively. For higher values of A s (represented in Fig. 11 in discontinuous line), the response of the circuit was as predicted in Fig. 8. For  = 0º and A s > 1.65 V, the bias continues increasing with A s but at S 1 /2 because the circuit enters directly into scenario #3. However, for  opt = 30º and A s > 3.25 V, the bias undergoes a significant decrease since the circuit enters in scenario #3 through scenario #2. For  = 90º, the circuit shows a R2R operation but at S 1 /2, as in Fig. 10. In Fig. 12 (m = 2), the situation is quite similar to that described before in Fig. 11 but with a smaller operating range. The maximum sensitivity can be achieved up to 0.95 V at  = 0º, and 1.95 V at  opt = 54º, which are in accordance with the values predicted by (10) and (9), respectively. C. Linearity The linearity of the proposed demodulator was evaluated for the most promising case in terms of sensitivity and operating range (i.e. Fig. 10 with m = 0 and  = 0º). This case is again represented in Fig. 13 but now on a log-log scale to better perceive the response of the circuit at low values of A s . The non-linearity error (NLE) was calculated by fitting a straight line to the experimental data using the least-squares method, and then expressed as a percentage of the full-scale span (FSS). As shown in Fig. 13, the maximum NLE was 0.03% FSS, which is a very remarkable value taking into account the simplicity of the circuits involved in the measurement. D. Resolution and measuring time An STD = 25 ns and S 1 = 100 µs/V involve an inherent root mean square (RMS) noise voltage of 250 µV. Accordingly, the circuit was tested to detect changes of A s twice of that value, to be precise: from 500.0 to 500.5 mV. The resulting histograms are represented in Fig. 14, which shows two data populations that are clearly distinguishable and whose means are separated by 50 ns. An effective resolution of 500 µV over a range of 5 V (assuming Fig. 10 with m = 0 and  = 0º) corresponds to 13.3 bits, which is again a very remarkable value. The previous numbers of resolution assume that the period is measured by a universal counter. However, in an actual sensor application, the period will be measured by a timer embedded into an MCU. This can usually operate at frequencies up to 16 MHz, which involves a quantization error of 62.5 ns. Therefore, if this is the predominant error source in the timing process, a resolution similar to that found in the previous paragraph should be expected. The minimum demodulating time equals the period of a single triangular signal (i.e. 1 ms) plus/minus the bias generated by A s (i.e. 0.5 ms for the highest value of A s in Fig. 10). If the measurement is mainly affected by trigger noise, as shown in Fig. 14, the resolution could be improved by using the average of N period measurements (taken every other cycle) as an estimator. If N = 10, a resolution of 150 µV (500 mV/√10󰇜 corresponding to 15 bits and requiring 20 ms is expected. In any case, a demodulating time of units or tens of millisecond is acceptable for sensor circuits that measure slowly varying magnitudes such as temperature, relative humidity or oil water content. E. Effects of noise The effects of intentional noise were evaluated for the case m = 0,  = 0º and A s = 2.5 V (half scale), with noise peak-to- peak amplitudes (A n ) up to 1 V. Under these conditions, the histogram of the bias was clearly Gaussian, as in Fig. 14, with: 1) an average value equal to that obtained in the noise-free scenario, and 2) an STD that increased quite linearly with A n Fig. 13. Non-linearity error (NLE) for fc / f0 = 0.5 (m = 0) and  = 0º. -0.04 -0.03 -0.02 -0.01 0.00 0.01 0.02 0.03 0.04 1 10 100 0.01 0.10 1.00 NLE (%FSS) Bias (µs) Amplitude of AM signal (V) Fig. 14. Histograms of the bias for two consecutive values of As (500.0 and 500.5 mV) at fc / f0 = 0.5 (m = 0) and  = 0º. 49.5 49.55 49.6 49.65 49.7 49.75 49.8 49.85 49.9 |Bias| (us) 0 0.05 0.1 0.15 0.2 0.25 500.5 mV 500.0 mV IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT with a noise sensitivity of 5 ms/V. Hence, the higher the noise level, the higher the number of measurements to be averaged so as to have an estimator with a lower variability. In addition, the results were very similar when the noise was added to either the AM square signal or the reference triangular signal. VI. DISCUSSION AND COMPARISON A. Comparison with the sinusoidal case The circuit proposed herein and that employed in [17] are the same, but their operating conditions are completely different, as summarized in Table I. When the circuit in Fig. 2 was applied to demodulate AM sinusoidal signals, the optimal performance was achieved at fc / f0 = (m + 0.5)·(1+Δ) with |Δ| << 1, thus generating a low-frequency alias component at fc·|Δ|; in other words: the wave reconstructed from the period samples evolved as a sinusoidal signal in the time domain with a frequency equal to fc·|Δ|. In such conditions, As was estimated by computing the STD of the set of period measurements carried out, at least, during one period of the alias component [i.e. 1/(fc·|Δ|)]. On the other hand, when the circuit in Fig. 2 is applied to demodulate AM square signals, the optimal response is achieved when fc / f0 is exactly equal to m + 0.5 (especially when m = 0), thus generating an alias component at 0 Hz (i.e. all the samples of period have the same value). These samples show a bias with respect to the ideal value of period that can be employed to estimate As. The method proposed herein has some significant advantages: 1) the input-output characteristic is very linear, even for high values of As (see Fig. 13); 2) the data processing is simpler and faster since it is not mandatory to take samples during one period of the alias component; and 3) the circuitry required to have fc / f0 = m + 0.5 is expected to be simpler than that to achieve fc / f0 = (m + 0.5)·(1+Δ). This method, however, is not so appropriate for AM sinusoidal signals since the bias strongly depends on ; see (A.2) in [16] where a sinusoidal dependence is demonstrated in a small-signal model. Note that for AM square signals, the bias can be constant for a wide range of  values (see, for instance, Fig. 5) and, therefore, the sensitivity to phase should be a minor issue here, especially for m = 0. B. Comparison with conventional demodulators The timer-based demodulator in Fig. 2 is qualitatively compared in Table II with conventional asynchronous and synchronous demodulators for sensor applications. The main advantage of the proposed circuit is the fact that both demodulation and digitization are carried out simultaneously via a digital timer, without requiring an ADC. The circuitry and processing involved in the demodulation are of low complexity and, therefore, its implementation via an MCU is expected to be of low power and low cost. As also occurs in asynchronous topologies, the proposed circuit is not able to carry out an In-phase and Quadrature components (IQ) detection. However, this is not a major concern if the circuit is applied to measure sensors that are purely resistive, capacitive or inductive. Another limitation of the proposed circuit is that the trigger points involved in the period measurement can be affected by noise/interference. For this reason, the circuit in Fig. 2 is not suggested for sensors prone to interference, such as capacitive touch sensors [24]. In the proposed circuit, the demodulating time equals T0, but it can increase to 2·N·T0 if N period measurements are digitally averaged to overcome noise effects; the factor of 2 is due to the fact that readings are taken every other cycle. On the other hand, in conventional demodulators, the demodulating time of the rectifier/mixer equals Tc (= 1/fc), but the overall time response mostly depends on the cut-off frequency of the ensuing LPF, which also determines the noise rejection. VII. CONCLUSIONS In the context of sensor interface electronics based on digital timers, this paper has evaluated the feasibility of a timer-based demodulator, previously proposed for AM sinusoidal signals, for AM square signals. It has been proven that the amplitude of an AM square signal can be extracted by measuring –via a digital timer– the period of a reference triangular signal that is altered by the AM signal itself. Under certain operating conditions, such a period measurement TABLE I COMPARISON BETWEEN THE DEMODULATION OF AM SQUARE AND SINUSOIDAL SIGNALS VIA A DIGITAL TIMER Square Sinusoidal [17] fc / f0 m + 0.5 (m + 0.5)·(1+Δ) with |Δ| << 1 Aliasing frequency 0 fc·|Δ| Estimator Bias STD Linearity (a) Very high Medium Resolution High Medium Demodulating time T0 (b) 1/(fc·|Δ|) R2R operation Yes Yes a At m = 0. b Plus/minus the bias generated by As TABLE II COMPARISON BETWEEN THE PROPOSED DEMODULATOR AND CONVENTIONAL TECHNIQUES Proposed Asynchr.(a) Synchr.(b) Circuit complexity L M M/H ADC required No Yes Yes Ref. signal required Yes No Yes Power consumption L M M IQ detection No No Yes Interference/noise sensitivity M L/M L Demodulating time T0 (c) Tc (d) Tc (d) L: low; M: medium; H: high. a An averaging detector based on an active rectifier is assumed [23]. b A 1 switched-gain amplifier is assumed [20],[22],[25]. c No averaging of measurements is considered. d The time required by the ensuing LPF and ADC is not considered. IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT undergoes a bias that linearly increases with the AM-signal amplitude. Experimental results have shown a non-linearity error smaller than 0.03% FSS and a resolution of 13.3 bits. The proposed timer-based demodulator is a simple and lowcost design solution since it does not require a rectifier/mixer, a low-pass filter, or an analog-to-digital converter. REFERENCES [1] L. Xiu, “Clock technology: the next frontier,” IEEE Circuits Syst. Mag., vol. 17, no. 2, pp. 27-46, 2017. [2] F. Reverter and R. Pallàs-Areny, “Uncertainty reduction techniques in microcontroller-based time measurements,” Sens. Actuators A Phys., vol. 127, no. 1, pp. 74–79, Feb. 2006. [3] F. Reverter and M. Gasulla, “Experimental characterization of the energy consumption of ADC embedded into microcontrollers operating in low power,” in Proc. IEEE Int. Instrum. Meas. Technol. Conf., Auckland, New Zealand, 20-23 May 2019. [4] Y. L. Lo and Y. T. Chiu, “A high-accuracy, high-resolution, and lowcost all-digital temperature sensor using a voltage compensation ring oscillator,” IEEE Sensors J., vol. 16, no. 1, pp. 43-52, Jan. 2016. [5] E. Sifuentes, R. Gonzalez-Landaeta, J. Cota-Ruiz, and F. Reverter, “Seat occupancy detection based on a low-power microcontroller and a single FSR,” Sensors, vol. 19, no. 3, 699 (11pp), Feb. 2019. [6] P. R. Nagarajan, B. George, and V. J. Kumar, “Improved single-element resistive sensor-to-microcontroller interface,” IEEE Trans. Instrum. Meas., vol. 66, no. 10, pp. 2736-2744, Oct. 2017. [7] R. Anandanatarajan, U. Mangalanathan, and U. Gandhi, “Enhanced microcontroller interface of resistive sensors through resistance-to-time converter,” IEEE Trans. Instrum. Meas. (in press). [8] F. Reverter and Ò. Casas, “Interfacing differential capacitive sensors to microcontrollers: a direct approach,” IEEE Trans. Instrum. Meas., vol. 59, no. 10, pp. 2763-2769, Oct. 2010. [9] J. Pelegrí-Sebastiá et al., “Low-cost capacitive humidity sensor for application within flexible RFID labels based on microcontroller systems,” IEEE Trans. Instrum. Meas., vol. 61, no. 2, pp. 545-553, Feb. 2012. [10] M. Demori et al., “Low-frequency RFID signal and power transfer circuitry for capacitive and resistive mixed sensor array,” Electronics, vol. 8, no. 6, p. 675, Jun. 2019. [11] Z. Kokolanski, J. Jordana, M. Gasulla, V. Dimcev, and F. Reverter, “Direct inductive sensor-to-microcontroller interface circuit,” Sens. Actuators A Phys., vol. 224, pp. 185-191, 2015. [12] N. Ramadoss and B. George, “A simple microcontroller based digitizer for differential inductive sensors,” in Proc. IEEE Int. Instrum. Meas. Technol. Conf., pp. 148-153, 2015. [13] A. Asif, A. Ali, and M. Z. U. Abdin, “Resolution enhancement in directly interfaced system for inductive sensors,” IEEE Trans. Instrum. Meas. (in press). [14] L. Bengtsson, “Direct analog-to-microcontroller interfacing,” Sens. Actuators A Phys., vol. 179, pp. 105-113, 2012. [15] L. Dutta, A. Hazarika, and M. Bhuyan, “Nonlinearity compensation of DIC-based multi-sensor measurement,” Measurement, vol. 126, pp. 13– 21, Oct. 2018. [16] F. Reverter and M. Gasulla, “Timer-based demodulator for AM sensor signals applied to an inductive displacement sensor,” IEEE Trans. Instrum. Meas., vol. 66, no. 10, pp. 2780- 2788, Oct. 2017. [17] F. Reverter, “Rail-to-rail timer-based demodulator for AM sensor signals,” IEEE Trans. Instrum. Meas., vol. 68, no. 1, pp. 306-308, Jan. 2019. [18] N. Mandal, B. Kumar, R. Sarkar, and S. C. Bera, “Design of a flow transmitter using an improved inductance bridge network and rotameter as sensor,” IEEE Trans. Instrum. Meas., vol. 63, no. 12, pp. 3127–3136, Dec. 2014. [19] R. Gonzalez-Landaeta, J. Cota-Ruiz, E. Sifuentes, J. Diaz, and O. Casas, “A fully differential synchronous demodulator for AC signals,” IEEE Trans. Instrum. Meas. (in press). [20] P. C. Talmadge, “Square wave excitation of a transducer,” U.S. Patent 5 088 330, Feb. 1992. [21] N. A. Gilda et al., “Current excitation method for R measurement in piezo-resistive sensors with a 0.3-ppm resolution,” IEEE Trans. Instrum. Meas., vol. 61, no. 3, pp. 767–774, Mar. 2012. [22] S. K. Kar, K. B. M. Swamy, B. Mukherjee, and S. Sen, “Systematic development of integrated capacitance measurement system with sensitivity tuning,” IEEE Trans. Instrum. Meas., vol. 64, no. 10, pp. 2738–2746, Oct. 2015. [23] K. Loizou and E. Koutroulis, “Water level sensing: State of the art review and performance evaluation of a low-cost measurement system,” Measurement, vol. 89, pp. 204–214, Jul. 2016. [24] J.-S. An, S.-J. Jung, S.-K. Hong and O.-K. Kwon, "A highly noiseimmune capacitive touch sensing system using an adaptive chopper stabilization method," IEEE Sens. J., vol. 17, no. 3, pp. 803-811, Feb. 2017. [25] J. Aguirre, D. Garcia-Romeo, N. Medrano, B. Calvo, and S. Celma, “Square-signal-based algorithm for analog lock-in amplifiers,” IEEE Trans. Ind. Electron., vol. 61, no. 10, pp. 5590–5598, Oct. 2014. [26] J. Pérez Sanjurjo, E. Prefasi, C. Buffa and R. Gaggl, “A capacitance-to- digital converter for MEMS sensors for smart applications,” Sensors, vol. 17, no. 6, p. 1312, Jun. 2017. [27] A. Utz et al., “A high-precision and high-bandwidth MEMS-based capacitive accelerometer,” IEEE Sens. J., vol. 18, no. 16, pp. 6533– 6539, Aug. 2018. [28] M. Gasulla-Forner, J. Jordana-Barnils, R. Pallas-Areny and J. M. Torrents, “Subsurface resistivity measurements using square waveforms,” IEEE Trans. Instrum. Meas., vol. 47, no. 1, pp. 74-77, Feb. 1998. [29] F. Reverter and M. Gasulla, “Timer-based demodulator for AM square signals coming from sensor circuits,” in Proc. IEEE Int. Instrum. Meas. Technol. Conf., Auckland, New Zealand, 20-23 May 2019. [30] F. Reverter, M. Gasulla, and R. Pallàs-Areny, “Analysis of interference effects on period-to-digital conversions,” Meas. Sci. Technol., vol. 16, pp. 2261-2264, 2005 Ferran Reverter was born in Llagostera, Spain, in 1976. He received the B.Sc. degree in industrial electronic engineering from the University of Girona, Girona, Spain, in 1998, the M.Sc. degree in electronic engineering from the University of Barcelona, Barcelona, Spain, in 2001, and the Ph.D. degree in electronic engineering from the Universitat Politècnica de Catalunya (UPC), Barcelona, Spain, in 2004. Since 2001, he has been with the UPC, where he is an Associate Professor in Analog Electronics and Digital Systems. Since 2018, he has also been with the Open University of Catalonia, where he is a Course Instructor in Electronic Instrumentation. He was a visiting Post- Doctoral Researcher with the Delft University of Technology, Delft, The Netherlands from 2005 to 2007, and with the Imperial College London, London, U.K., in 2012. His current research interests include interface electronics for smart sensors, power-processing circuits for autonomous sensors, and MOSFET thermal sensors for IC testing. He was awarded “Outstanding Reviewer” from the IEEE Instrumentation and Measurement Society in 2014 and 2018. He is an Associate Editor of the IEEE SENSORS JOURNAL and IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT. Manel Gasulla was born in Vinaròs, Spain, on May 26, 1967. He received the Enginyer (MEng) and Doctor Enginyer (PhD) degrees in Telecommunications from the Universitat Politècnica de Catalunya (UPC), Barcelona, in 1992 and 1999, respectively. Since 1993 he has been with the UPC, where he is an associate professor, engaged in teaching on Analog and Power Electronics and Electronic Instrumentation. In 2001-2002 he was a Visiting Postdoctoral Fellow at the Electronic Instrumentation Laboratory, Delft University of Technology, The Netherlands. His research interests include capacitive sensors, direct sensor-to-microcontroller interfaces, and energy harvesting and wireless power transfer circuits for autonomous sensors. He is co-author of more than 50 papers in journals and conferences, six Spanish patents, several chapters in books and the book Powering Autonomous Sensors (Springer, 2011).