2736
IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 66, NO. 10, OCTOBER 2017
Improved Single-Element Resistive Sensor-to-Microcontroller Interface Ponnalagu Ramanathan Nagarajan, Boby George, Member, IEEE, and V. Jagadeesh Kumar, Senior Member, IEEE Abstract— Direct resistive sensor interface to a microcontroller has several advantages but has one prominent disadvantage, namely, the measurement is affected by the resistances of: 1) wires that connect the sensor to the port pins and 2) the internal resistances of the port pins of the microcontroller. A direct sensor-to-microcontroller interface scheme that compensates the effect due not only to resistances of lead wires but also the effect of microcontroller port pin’s internal resistance and any offset present in those pins is presented in this paper. Since the resistances of lead wires are compensated, automatic temperature compensation (temperature effect of lead wires) is also obtained. Simulation study and results obtained from a prototype built and tested establish the efficacy of the proposed method. A maximum error of 0.06% was observed from the prototype developed, when it was tested under room temperature, after interfacing it with the sensor Pt100, with a lead wire resistance RLD = 21 . The error increased to a maximum of 0.08%, when the RLD varied from 0 to 100 . When the same prototype was tested under elevated room temperature of 30 °C to 100 °C, the maximum error observed was 0.18%. Index Terms— Direct sensor interface, lead resistance compensation, microcontroller sensor interface, resistive sensors.
I. I NTRODUCTION ESISTIVE sensors are available in single-element, differential, and bridge forms [1]. As the name indicates, single-element resistive sensor has one sensing element whose resistance changes as a function of the physical quantity being measured. Examples are: resistive temperature detectors (RTDs), thermistors, light dependent resistors, strain gauges, resistive gas sensors, and piezoresistive sensors [2]. These sensors are connected through wires to the measuring unit. Typical value of lead resistance of a wire, say 30 m of 30 standard wire gauge (SWG) copper wire, at 25 °C, is 10.5 and hence the resistances of such connecting wires pose a problem in obtaining proper measurements with resistive type sensors in general, but particularly single-element resistive sensors. The relative error introduced by the lead resistance RLD in the measurement of sensor resistance Rx would be RLD /Rx . Apart from the added resistance, the variation in the resistances of connecting wires due to temperature change also affects the measurement. For example, the temperature coefficient of copper is 0.00385 //°C which is comparable to the thermal sensitivity of RTD-Pt100, a popular RTD that possesses
R
Manuscript received January 28, 2017; revised April 6, 2017; accepted April 24, 2017. Date of publication June 27, 2017; date of current version September 13, 2017. The Associate Editor coordinating the review process was Dr. Subhas Mukhopadhyay. (Corresponding author: Boby George.) The authors are with the Department of Electrical Engineering, IIT Madras, Chennai 600036, India (e-mail:
[email protected]). Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TIM.2017.2712918
a nominal resistance of 100 at 0 °C and sensitivity of 0.00385 //°C. If such a sensor is used, even a few meters of connecting wire will introduce large errors due to not only lead resistances but also due to variations in the lead resistances as a result of temperature variations [3]. Use of three wire and four wire connection strategies enable precise measurement of low resistance by compensating the lead resistances but such systems require additional leads running from measurement unit to sensor side and will be efficient only when the supply and return leads have equal resistance values [4]. A lead resistance compensation scheme using opamps proposed for three-wire [5] and four-wire RTD [6] is simple but the output will be affected by the nonidealities present in the opamps. The circuits proposed in [7] and [8] use a current source, diodes, sample, and hold and hence are quite complex. The technique proposed in [9] is also based on diodes similar to [7] and [8] but the circuit complexity is reduced, and the resistive sensor is used as a grounded load in an opamp-based v-to-i converter. The schemes reported in [5]–[8] use a current source, and hence the output depends on the reliability of the current source. To exploit the excellent processing power and better user interface available with the digital instrumentation systems, digital outputs are preferred from measurement circuit of such sensors. To obtain a digital measurement from these resistive sensors, we have to use an analog signal conditioning circuit cascaded to an analog-to-digital converter (ADC). Quasi-digital systems that convert resistance to frequency, pulsewidth, or time period are available but they suffer from the drawback of requirement of another interface to covert the quasi-digital to digital [10]–[13]. Direct digital converters based on dual-slope ADC are reported, wherein the structure of a dual-slope ADC is altered to make the sensor elements to become an integral part of the ADC. Such schemes provide a digital output dispensing with analog signal conditioning circuits [14], [15]. Even though these converters provide good accuracy, they are complex compared to direct interface of sensor element to a microcontroller reported in [16]–[19]. Thus, the optimal solution is to directly connect a resistive sensor to the port pins of a microcontroller and obtain measurements from there. In the direct resistive sensor interface to microcontroller schemes presented earlier, the measurement will be significantly affected due to the resistances of connecting (lead) wires. Hence the effect due to lead wire resistances will be pronounced if the sensor is connected using long lead wires. Any change in the operating temperature will lead to variations in the resistances of such lead wires resulting in additional temperature dependent errors in the measurement. Moreover, in a direct sensor-to-
0018-9456 © 2017 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
NAGARAJAN et al.: IMPROVED SINGLE-ELEMENT RESISTIVE SENSOR
2737
Fig. 1. Block diagram of the proposed method. The measurement unit with microcontroller, connecting wires with lead resistances and the sensor, is indicated. AC-analog comparator.
microcontroller interface scheme, the internal resistance of the port pin (≈25 ) of the microcontroller gets added with the resistance under measurement and affects the accuracy of the measurement. It is reported that the relative error will be more with higher value of port pin resistance [17]. To compensate for the port pin resistance either two calibration resistors are required [17] or an additional offset measurement has to be performed [16]–[19] with the total resistance path that includes only the microcontroller port pin and a current limiting resistor. Also in direct sensorto-microcontroller interface schemes implemented with more than one charge–discharge cycles, all the discharge cycles do not happen through the same microcontroller port pin. When different microcontroller port pins are used then the resistances of the microcontroller port pins may have a mismatch of about few tenths of ohms as reported in [17]. Hence the offset measurement performed in [16]–[19] will also not guarantee accurate results. In the scheme presented here, judicious use of three singlepole double-throw (SPDT) switches not only compensates for lead resistances but also ensures that discharge happens through a single microcontroller pin in every discharge cycle, thus eliminating the effects due to mismatch in the resistances of port pins. The measurement process is also modified in such a way that without performing an offset measurement, the effect of microcontroller port pin resistance on the measurement is eliminated. Compared to the scheme reported in [19] that uses four matched diodes and also requires four charge–discharge cycles for one measurement, the proposed method requires just two matched diodes and requires only three charge–discharge cycles for a measurement. Hence the update rate of the proposed sensor interface will be better than the sensor interface reported in [19]. II. I MPROVED S ENSOR - TO -M ICROCONTROLLER I NTERFACE The block diagram of the proposed improved direct sensorto-microcontroller interface scheme suitable for a singleelement resistive sensor is shown in Fig. 1. The sensor Rx
located at a distance is connected to the measurement unit using two diodes D1 and D2 and connecting wires, whose resistances are represented as RLD1 and RLD2 . The measurement unit consists of a microcontroller, three SPDT switches S1 , S2 , and S3 , three resistances R P , R S , and R R , and a capacitor C. Four microcontroller port pins P1, P2, P3, and P4 are used in the measurement process. The resistor R P connected between microcontroller port pin P1 and the capacitor C improves the rejection of power supply noise/interference as reported in [16]. Resistor R S is introduced to limit the discharge current drawn by the capacitor C to be less than the maximum output current that is acceptable for a microcontroller port pin when Rx is zero [16]. The resistor, R R connected between the two terminals of switch S3 is chosen to be equal to the nominal resistance Ro of the sensing element. The port pin P1 is programmed to perform two functions, namely, 1) to permit the capacitor C to charge during the charge cycle and 2) to serve as the inverting input of the internal analog comparator of the microcontroller during discharge cycle. Port pin P2 is used to provide control signals simultaneously to the switches S1 and S2 and pin P4 functions as the control signal to switch S3 . The port pin P3 acts as the discharging pin and provides the path for the discharge current of the capacitor C to flow to ground during the discharge periods (during these periods, this pin is set to low). The measurement process involves three cycles of “charging and discharging of capacitor C,” as illustrated in Fig. 2. Whenever C needs to be charged, pin P1 of the microcontroller is set at digital high (say, voltage VDD ) and pin P3 is set to operate in the high-impedance state. The switch control pins P2 and P4 can be set to any state (high, low, or high impedance) as the logic states of these pins do not affect the charging operation. Thus, the capacitor C is charged to VDD , through R p and the charging time TCH is set to be >5R p C so that C gets fully charged [16]. A discharge cycle follows every charge cycle. A. Discharge Cycle 1 In the first discharge cycle, P1 is set to high impedance, P2, P3, and P4 are set to low. For this condition all the three SPDT
2738
IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 66, NO. 10, OCTOBER 2017
Fig. 2. Charging and discharging sequence. TCH shows duration for charging while Tx , T R , and Tl indicate different discharging intervals during the measurement of RT 1 , RT 2 , and RT 3 . This waveform was recorded during a measurement using the prototype developed. For the prototype developed, the time TCH required to charge the capacitor is 5 R p C = 0.6 ms. To clearly view the waveform in the snapshot, TCH for the charging cycles is kept intentionally long as 2 ms.
switches S1 , S2 , and S3 are set to position “0”. Hence diode D1 conducts (forward biased) and diode D2 is in the cutoff mode (reverse biased). Capacitor C now discharges through resistance RT 1 = Rx + Ros , where
The discharging is continued till the capacitor voltage drops down to a threshold voltage, VTL hence
Ros = R S + RLD1 + RLD2 + R S1 + R S2 + R S3 + Rpin . (1)
Rearranging and applying natural logarithm to (7), we get VDD − V D1 Tx = Nx Tc = RT 1 C ln . (8) VTL − V D1
Here, RS1 , RS2 , and RS3 are the ON-state resistances of the switches S1 , S2 , and S3 and Rpin is the internal resistance of the microcontroller port pin P3. The internal timer/counter unit of the microcontroller is reset and started as soon as the capacitor C is set to discharge and stopped when the capacitor voltage v c (t) equals the threshold voltage VTL . The count value Nx at the time the counter is stopped will indicate the time taken by the capacitor to discharge, say Tx during the first discharge cycle. Here Tx = Nx Tc , where Tc is the period of the clock fed to the internal counter-timer unit of the microcontroller. During this period, discharge current i 1 (t) is i 1 (t) =
(VDD − V D1) − R t C e T1 . RT 1
(2)
Here, V D1 is the ON-state forward voltage drop of the diode D1 . The voltage, v RT1 (t) across RT 1 can be expressed as v RT 1 (t) = i 1 (t)RT 1 = (VDD − V D1 )e
−R
t T 1C
(3)
and the capacitor voltage v c (t) can be expressed as in the following: v c (t) = V D1 + v RT 1 (t).
(4)
By substituting v RT1 (t) from (3) into (4), we get v c (t) = V D1 + (VDD − V D1)e
−R t C T1
.
− R Tx C T1
.
(7)
For a system, if the values of C, VDD , VTL , and V D1 are considered to be constants, then Tx will be proportional to the total resistance RT 1 . As soon as Tx is measured, the capacitor C is again charged to VDD and the second recharge cycle starts. B. Discharge Cycle 2 In the second discharge cycle, P1 is set to high impedance, P2 and P4 are set high, and P3 is set to low. For this condition all the three switches S1 , S2 , and S3 are set to position “1.” Hence diode D1 is OFF and diode D2 conducts. Capacitor C now discharges through resistance RT 2 = R R + Ros . Here too the time TR taken for the capacitor C to discharge and reach the threshold voltage VTL is measured using the internal counter and stored as N R . As detailed in discharge cycle 1, TR can be calculated as VDD − V D2 TR = N R Tc = RT 2 C ln . (9) VTL − V D2 Here V D2 is the cut-in voltage of diode D2 . Once the second discharge cycle is over, the capacitor C is once again charged to VDD and the third discharge cycle as detailed next is initiated. C. Discharge Cycle 3
(5)
The capacitor voltage, v c (t) at the time of the start of discharge (t = 0) will be v c (t) = VDD .
VTL = V D1 + (VDD − V D1 )e
(6)
In the third discharge cycle, P1 is set to high impedance, P2 is set high, and P3 and P4 are set to low. For this condition switches S1 and S2 are set at position “1” and S3 alone is set to position “0.” Hence diode D1 is OFF and diode D2 conducts. Capacitor C discharges through resistance RT 3 = Ros . Once again, the time Tl taken for the capacitor C to discharge and
NAGARAJAN et al.: IMPROVED SINGLE-ELEMENT RESISTIVE SENSOR
2739
TABLE I M EASUREMENT P ROCESS
reach the threshold voltage VTL is measured using the internal counter of the microcontroller as Nl Tc . On similar lines Tl can be derived as VDD − V D2 Tl = Nl Tc = RT 3 C ln . (10) VTL − V D2 Table I details the status of the three discharge cycles as explained above. From the above measurements, first the value of Tx − Tl is calculated from (8) and (10) as Tx − Tl = (Nx − Nl )Tc VDD − V D1 VDD − V D2 = RT 1 C ln − RT 3 C ln . VTL − V D1 VTL − V D2 (11) Substituting the values of RT 1 and RT 3 in (11) and assuming that V D1 = V D2 since the diodes D1 and D2 are identical we get VDD − V D1 (Nx − Nl )Tc = C ln [Rx + Ros − Ros ]. (12) VTL − V D1 Similarly the value of TR − Tl is calculated using (9) and (10) as VDD − V D1 (N R − Nl )Tc = C ln [R R + Ros − Ros ]. (13) VTL − V D1 Dividing (12) by (13) and rearranging we get Nx − Nl Rx = R R . N R − Nl
(14)
Equation (14) illustrates that the value of the sensor element is easily calculated from the three count values Nx , N R , and Nl obtained during the three charge–discharge cycles and that the effect of all other interfering resistances are eliminated. It should be noted here that this is achieved without using a current source or complex signal processing circuits. The proposed scheme employs only three charge–discharge cycles but the scheme presented in [19] employs four. Hence the update rate of the proposed scheme would be better. In contrast to the schemes reported in [3]–[9], that provide an analog output, a direct digital output proportional to the measurand is obtained in the proposed scheme. The scheme is amenable to direct reading of not just the sensor resistance, but also direct reading of the parameter being sensed by the sensor. For example, if we use an RTD as the sensor, then Rx = Ro (1 + kθ), where θ is the temperature being sensed and k is
the sensitivity of the RTD. In such a case by choosing R R to be equal to Ro , we get Nx − Nl Ro (1 + kθ ) = R R . (15) N R − Nl Rearranging (15) we get θ=
1 k
Nx − N R . N R − Nl
(16)
Once again (16) indicates that the temperature being sensed is easily computed from the three counts Nx , N R , and Nl obtained during the three charge–discharge cycles and the transformation constant k of the RTD. Equation (14) is derived by assuming that all the components used in the interfacing circuit are ideal. However, in a practical implementation, errors may be introduced in the output due to the nonideal characteristics of practical circuit components. Various sources of errors and their effect in the final output that may arise due to the nonideal characteristics of practical components are discussed next. III. S OURCES OF E RROR IN THE P ROPOSED S CHEME The only assumptions that are invoked in deriving (14) are 1) the two diodes D1 and D2 are identical (cut-in voltage and ON resistances are equal); 2) the diodes have infinite resistances in the reverse bias; and 3) the switches have infinite resistance between the pole and the unconnected terminal (position “1” or “0” as the case may be). Errors may arise if the above assumptions are not valid. The succeeding sections analyze the effect of the above assumptions not being met in a practical implementation. In addition, the accuracy of the final output depends on the accuracy of the known resistor value R R . A low tolerance resistor should be used as R R to achieve good accuracy. A. Effect of Non-ideal Characteristics of Diodes D1 and D2 Equation (14) is derived under the assumption that V D1 and V D2 , the ON-state forward voltage drops of diodes D1 and D2 , respectively, are equal. However, in practice there may be a mismatch between the two voltage drops. Let ±V D be the difference between the forward voltage drops of the two diodes and hence V D2 = V D1 ± V D .
(17)
2740
IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 66, NO. 10, OCTOBER 2017
Let α and β be defined as in the following: VDD − V D1 α = ln V − V D1 TL VDD − V D2 . β = ln VTL − V D2
(18) (19)
Substituting (18) and (19) in (12) and (13); obtaining new values for Tx , TR , and Tl and calculating Rx using (14), we get α−β α M0 + Ros . Rx = Rx (20) β β Here RxM0 is the measured value of Rx , when the two diodes D1 and D2 are not identical. Hence a mismatch between the forward voltage drops of diodes introduces a gain error and offset error in the measured resistance. A gain error of 0.06% and an offset error of 0.23% is observed when V D1 = 0.46 V, V D2 = 0.461 V (V D = 1 mV), Rx = 146.2 , Ros = 520 ; VDD = 5 V and VTL = 1.1 V. The effect due to mismatch between the diode cut-in voltages can be reduced by a careful selection of matched diodes. The offset error in (20) depends on Ros . The major contributor in Ros is R S and hence it becomes necessary to choose an optimal value for R S to keep the error minimal as well as to maintain the required time constant. The reverse saturation current and forward voltage drop of the diode vary as a function of the ambient temperature. Since, one of the diodes is always present in every discharge cycle of the measurement process, the associated effect in the final output is very small when matched diodes are used. In place of diodes D1 and D2 , low ON -resistance analog switches can be used, but switches will need control signals and power supply for which, additional control wires have to run from the measurement unit to sensor, to control such switches. B. Effect Due to OFF-State Resistances of Diodes and Switches The diodes and switches used in the proposed direct sensor interface are assumed to be ideal, and the sensor resistance is obtained as in (14). However, practical diodes and switches may have finite resistances in the ON- and OFFstates. Since ON-state resistances simply modify Ros , and the final output is independent of Ros , the ON-state resistances of the switches and diodes will not affect the output. But the OFF -state resistances R S1 OFF , R S2 OFF , and R S3 OFF of the switches S1 , S2 , and S3 will affect the performance of sensor interface as presented in the following: R R − Rx M1 Rx = Rx 1 + (21) R S1OFF R R − Rx RxM2 = Rx 1 + (22) R S2OFF RR . (23) RxM3 = Rx 1 + R S3OFF Here RxM1 is the measured value of Rx when switch S1 possesses OFF-state resistance of R S1OFF . Similarly RxM2 is the measured value when switch S2 possesses OFF-state resistance
of R S2OFF and RxM3 is the measured value when switch S3 possesses OFF-state resistance of R S3OFF . Equations (21), (22) indicate that the OFF-state resistances of switches S1 and S2 introduce a gain error and nonlinearity in the measurement. Equation (23) implies that OFF-state resistance of switch S3 introduces only a gain error in the output. The diode OFF resistance R D OFF will introduce a nonlinear term in the measured sensor resistance as in the following: Rx RxMD = Rx 1 − . (24) R DOFF Here RxMD is the measured value of Rx when diodes D1 and D2 possess OFF-state resistance of R D OFF . An error of 0.0001% will result in the output when R D OFF = 100 M. Switches and diodes having very high OFF resistance can be chosen to reduce this effect. IV. S IMULATION S TUDY The functionality of the proposed scheme was first verified by simulating the circuit shown in Fig. 1 using the circuit simulation tool, linear technologies spice. The control logic was simulated using switches, pulse signals, and logic gates. The forward voltage and OFF resistance of the diodes, D1 and D2 used in the simulation were selected to reflect the diode 1N4007 (used in the prototype). The lead resistances RLD1 and RLD2 were set as 10 (corresponding to 33 m of 30 SWG copper wire), the nominal resistance Ro and reference resistance R R were set as 100 each, and the sensor resistance was incremented in steps of 1.925 from 100 to 146.2 which is equivalent to a temperature variation from 0 °C to 120 °C in steps of 5 °C for an RTD-Pt100 resistive temperature sensor. Tx , TR , and Tl were obtained from the simulation and the sensor resistance was calculated using (14). The maximum error observed from the simulation study was 0.005%. Second set of simulations were performed by varying the lead resistances RLD1 and RLD2 in steps of 5 (each) in the range of 0 to 50 while the sensor resistance Rx was set at 119.25 (≈50 °C for RTD-Pt100). The Tx , TR , and Tl values obtained were found to be independent of the changes in RLD1 and RLD2 thus establishing the efficacy of the proposed scheme’s ability to compensate the effect of lead wire resistances and their variations. A temperature sweep analysis was also performed in simulation for which Rx was set as 119.25 , RLD1 and RLD2 were set as 10 each, and the temperature sweep was performed in the range of 30 °C to 70 °C in steps of 10 °C. The results obtained showed that the maximum error in the output was 0.13%. Stray capacitances may exist between the connecting wires and ground and also between the two connecting wires. In order to assess the effect of stray capacitances on the output, three capacitors Cs1 , Cs2 , and Cs3 were intentionally introduced into the circuit to mimic the stray capacitances. Capacitor Cs1 was put between wire 1 (left terminal of RLD1 in Fig. 1) and ground, Cs2 was introduced between wire 2 (left terminal of RLD2 ) and ground, and Cs3 was connected between wire 1 and wire 2. The chosen capacitor values were as Cs1 = Cs2 = 3.3 nF and Cs3 = 10 pF (values
NAGARAJAN et al.: IMPROVED SINGLE-ELEMENT RESISTIVE SENSOR
2741
Fig. 5. Experimental results showing temperature, obtained from the proposed direct sensor interface when RLD1 = RLD2 = 10 . Fig. 3. Experimental setup of the proposed improved direct sensor interface.
Fig. 6. Experimental results showing the output R x , when lead resistance is varied from 0 to 100 . Fig. 4. Experimental results showing R x measured using the proposed improved direct sensor interface when RLD1 = RLD2 = 10 .
corresponding to 33-m length of wire) [20]. Simulation was run with these capacitors in place and the maximum error observed in the output was 0.02%. To minimize the effect of interference and stray capacitance, a twisted pair of wires enclosed in a shielded sheath can be used for connecting the sensor to the measurement unit. The effect of mismatch between diode forward voltages was studied in simulation by setting V D1 = 0.46 V and V D2 = 0.461 V. Hence a V D = 1 mV (0.2% mismatch) resulted in an error of 0.5%. The results observed from the simulation proved the efficacy of the proposed improved direct sensor interface. V. E XPERIMENTAL S ETUP AND R ESULTS A prototype of the circuit shown in Fig. 1 was developed and tested by interfacing it with a temperature sensor, RTDPt100 to verify the efficacy of the proposed scheme. A. Details of the Prototype The resistors R S , R P and the capacitor C were selected as 470 , 120 , and 1 μF, to have an optimal time constant of ≈0.6 ms which gives better speed and resolution for a processor speed of 16 MHz. The reference resistance, R R was chosen as 100 (to match with the nominal resistance of RTDPt100). Two 1N4007 diodes having matching V D values were selected to serve as D1 and D2 . Two MAX4602 ICs (quad single pole single throw switch IC) and one 7404 IC (Hex inverter) were used to realize the three SPDT switches S1 , S2 , and S3 .
An RTD-Pt100 was chosen as the sensor and connected to the digital port of an ATmega328 microcontroller in the Arduino Uno board through the switches and diodes, as illustrated in Fig. 1. The control signals and switching signals necessary for the measurement process was generated by the microcontroller. The Arduino board was interfaced to a personal computer (PC) through the on board USB port, and the measured count values were read by the PC, which then evaluates (14) and (16) and displays the results. The analog comparator available inside the microcontroller served as the comparator. It should be noted that port pin P1 serves both as the inverting input of the internal comparator as well as an input–output port pin. By setting the analog comparator band gap select bit in the analog comparator control and status register of the microcontroller to 1, a fixed band gap reference voltage of 1.1 V available internally in the microcontroller was tied to the noninverting input of the analog comparator [21]. Thus the threshold voltage, VTL was set as 1.1 V. When v c (t) drops below 1.1 V, the analog comparator interrupts the microcontroller and the corresponding interrupt handling program stops the internal timer/counter and sends the timer/counter value to the PC. Thus, the counts corresponding to the time taken by the capacitor voltage to reach from VDD to 1.1 V for the three discharge cycles as indicated in Fig. 2 are sent to the PC. Three different tests were performed to study the effectiveness of the proposed scheme. First, a test to obtain the input–output characteristic of the proposed improved direct sensor interface scheme was conducted. The second test was designed and conducted to ascertain the effect of the variation
2742
IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 66, NO. 10, OCTOBER 2017
in the resistances of the connecting wires on the performance of the sensor interface. The third and final test was conducted to determine the effect on the output due to variation in the operating temperature. The details of the three tests are presented in the following sections. B. Output Characteristics for an RTD-Pt100 Sensor The RTD-Pt100 sensor connected to the microcontroller was placed inside the bath of a temperature calibrator (Model: MP40R, range: −40 °C to 123 °C) manufactured by Nagman Instruments and Electronics, Chennai, India. The resistances RLD1 and RLD2 of the connecting wires were set as 10 each. The photograph of the experimental setup showing the improved sensor interface developed on bread board and tested using RTD-Pt100 placed inside a temperature calibrator is shown in Fig. 3. The temperature of the bath was varied in steps of 5 °C from 0 °C to 120 °C. Every time, when a temperature was set in the bath, the charge–discharge cycles as described in Section II were performed and the count outputs Nx , N R , and Nl were obtained. From the counts obtained, the sensor resistance Rx was calculated using (14) and was plotted, as shown in Fig. 4. As expected, Fig. 4 showed a linear variation of measured Rx with respect to temperature (sensing quantity). The relative error between the measured Rx and actual Rx (obtained from a 6(1/2) digit multimeter) was calculated and also plotted in the graph, shown in Fig. 4. The maximum error in the output characteristic obtained was 0.06%. Substituting Nx , N R , and Nl in (16) the temperature was obtained and compared to the set temperature. Fig. 5 shows the results obtained and the relative error observed in the measurement. The capacitor charging and discharging time periods obtained using a digital storage oscilloscope for a measurement is shown in Fig. 2. The reference resistor R R used in this prototype was 100 , which is appropriate as it is in the mid-range of the Rx (Pt100). For a higher value of sensor resistance, say Pt1000, an R R of 1 k will be appropriate as reported in one of the earlier studies [19]. Thus, to extend the interface to measure a wide range sensor like Thermistor, multiple numbers of R R will be required to achieve good accuracy. The range of the sensor resistance that can be measured accurately is limited when a fixed reference resistor is employed. C. Experimental Study to Assess the Effect of Lead Resistances To establish that the proposed scheme is unaffected by the magnitude and variations in the resistances of the connecting wires, two standard variable resistance boxes were intentionally introduced in the places of resistances RLD1 and RLD2 . The temperature of the calibrator was set at 50 °C. Then the values of RLD1 and RLD2 were incremented in steps of 5 (each) in the range of 0 to 100 . The counts Nx , N R , and Nl corresponding to each measurement were recorded, and the sensor resistance was obtained using (14). Rx measured was found to vary between 119.21 and 119.36 , and the maximum error observed was 0.08%,
Fig. 7. Experimental results showing the output R x , when external temperature is varied from 30 °C to 100 °C.
as shown in Fig. 6. This proves the efficacy of the proposed scheme’s ability to compensate the resistances of connecting wires. D. Experiment Performed to Assess the Effect of Operating Temperature In order to study the effect of variations in the temperature of the operating environment on the output, the interface was enclosed in a sealed chamber and the temperature of the chamber was varied using a temperature heat gun KX1800 (1800 W, 400/550 °C). By varying the voltage supplied to the heat gun using an auto transformer, the heat produced by the heat gun was varied which in turn varied the temperature of the chamber. To measure and record the temperature, IC LM 35 (temperature sensor) was mounted inside the chamber and its output was connected to one of analog input pins of the microcontroller. While performing this study, RLD1 and RLD2 were set as 10 each and the temperature of the calibrator was set at 120 °C (Rx = 146.2 ). To observe the variations in the forward voltage drops of diodes D1 and D2 with respect to the operating temperature, the voltage drops V D1 and V D2 were also connected to analog input pins of the microcontroller. The temperature of the chamber varied in the range 30 °C to 100 °C and the measurement process was run at cardinal points in this range. Along with the counts Nx , N R , and Nl , the chamber temperature, V D1 and V D2 were also measured. Using (14), Rx was obtained for each temperature setting and it was found to vary between 145.95 and 146.42 which corresponds to a change of 0.011 /°C. The maximum V D observed was 0.002 V which resulted in an error of 0.18% in the measurement of Rx . The results obtained are shown in Fig. 7. VI. D ISCUSSION AND C ONCLUSION An improved direct sensor-to-microcontroller scheme suitable for single resistive element is presented in this paper. The proffered scheme compensates the effect due to the resistances of wires that connect the sensor to the microcontroller. Hence the sensor can be connected using long lead wires. The scheme proposed uses low-cost components such as diodes and switches. A comparison of the advantage and
NAGARAJAN et al.: IMPROVED SINGLE-ELEMENT RESISTIVE SENSOR
2743
TABLE II C OMPARISON S TUDY
limitations of proposed scheme with the existing schemes is shown in Table II. The direct sensor-to-microcontroller interface method suggested in [19] requires four matching diodes, while the present scheme requires only a pair of matched diodes. A prototype of the proposed system has been developed and tested. The efficacy of the proposed scheme has been established by the results obtained from simulation studies as well as from the experimental results observed from the prototype unit. The results show that the proposed method has very less sensitivity to the resistances of connecting wires, thus resistive sensors placed remotely can be directly connected to the microcontroller. For the prototype developed, the typical conversion time observed was 5.3 ms, when the sensor interface was tested using RTD-Pt100 sensor under room temperature. The time indicated includes the time taken for one complete measurement, i.e., three charging and three discharging cycles. The microcontroller was operated at a frequency of 16 MHz, which corresponds to a time base of 62.5 ns. The effective number of bits obtained was 12.18 b, which gives a resolution of 0.03 . As RTD-based temperature measurement is widely used in process control plants, the proposed improved direct sensor-to-microcontroller interface is best suited for modern industries and process control plants as it avoids the use of an analog signal conditioning circuit.
R EFERENCES [1] E. O. Doebelin, Measurement Systems-Application and Design, 5th ed. New York, NY, USA: McGraw-Hill, 2004. [2] W. Kester, Practical Design Techniques for Sensor Signal Conditioning. New York, NY, USA: Analog Devices Inc., 1999. [3] “Overview of two-wire and four-wire (Kelvin) resistance measurements,” Keithly Instrum., Inc., Cleveland, OH, USA, Appl. Note 3176, May 2012. [Online]. Available: http://www.tek. com/sites/tek.com/files/media/document/resources/2110_2Wire 4WireKelvinResistanceAppNote.pdf [4] D. Vyroubal, “A circuit for lead resistance compensation and complex balancing of the strain-gauge bridge,” IEEE Trans. Instrum. Meas., vol. 42, no. 1, pp. 44–48, Feb. 1993. [5] S. Pradhan and S. Sen, “An improved lead compensation technique for three-wire resistance temperature detectors,” IEEE Trans. Instrum. Meas., vol. 48, no. 5, pp. 903–905, Oct. 1999. [6] S. K. Sen, T. K. Pan, and P. Ghosal, “An improved lead wire compensation technique for conventional four wire resistance temperature detectors (RTDs),” Measurement, vol. 44, no. 5, pp. 842–846, 2011. [7] T. K. Maiti, “A novel lead-wire-resistance compensation technique using two—Wire resistance temperature detector,” IEEE Sensors J., vol. 6, no. 6, pp. 1454–1458, Dec. 2006. [8] W. Petchmaneelumka, P. Julsereewong, A. Julsereewong, and J. Tongpakpanang, “Simple interface circuit with lead-wire-resistance compensation for single resistive sensors,” in Proc. IEEE ICCAS, Jeju, Jeju Island, South Korea, Oct. 2012, pp. 1076–1079. [9] T. K. Maiti and A. Kar, “Novel remote measurement technique using resistive sensor as grounded load in an opamp based V-to-I converter,” IEEE Sensors J., vol. 9, no. 3, pp. 244–245, Mar. 2009. [10] K. Mochizuki and K. Watanabe, “A high-resolution, linear resistanceto-frequency converter,” IEEE Trans. Instrum. Meas., vol. 45, no. 3, pp. 761–764, Jun. 1996.
2744
IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 66, NO. 10, OCTOBER 2017
[11] T. Islam, L. Kumar, Z. Uddin, and A. Gangopadhyay, “Relaxation oscillator-based active bridge circuit for linearly converting resistance to frequency of resistive sensor,” IEEE Sensors J., vol. 13, no. 5, pp. 1507–1513, May 2013. [12] S. Kaliyugavaradan, “A linear resistance-to-time converter with high resolution,” IEEE Trans. Instrum. Meas., vol. 49, no. 1, pp. 151–153, Feb. 2000. [13] Z. Kokolanski, C. Gavrovski, V. Dimcev, and M. Makraduli, “Simple interface for resistive sensors based on pulse width modulation,” IEEE Trans. Instrum. Meas., vol. 62, no. 11, pp. 2983–2992, Nov. 2013. [14] N. M. Mohan and V. J. Kumar, “Direct digital converter for a single active element resistive sensor,” in Proc. IEEE IMTC, Singapore, May 2009, pp. 828–831. [15] N. M. Mohan, B. George, and V. J. Kumar, “A novel dual-slope resistance-to-digital converter,” IEEE Trans. Instrum. Meas., vol. 59, no. 5, pp. 1013–1018, May 2010. [16] F. Reverter and R. Pallàs-Areny, Direct Sensor-to-Microcontroller Interface Circuits: Design and Characterisation, Barcelona, Spain: Marcombo, 2005. [17] F. Reverter, J. Jordana, M. Gasulla, and R. Pallàs-Areny, “Accuracy and resolution of direct resistive sensor-to-microcontroller interfaces,” Sens. Actuators A, Phys., vol. 121, no. 1, 2005, pp. 78–87. [18] O. López-Lapeña, E. Serrano-Finetti, and O. Casas, “Low-power direct resistive sensor-to-microcontroller interfaces,” IEEE Trans. Instrum. Meas., vol. 65, no. 1, pp. 222–230, Jan. 2016. [19] R. N. Ponnalagu, B. George, and V. J. Kumar, “A micro-controller sensor interface suitable for resistive sensors with large lead resistance,” in Proc. ICST, Liverpool, U.K., Sep. 2014, pp. 327–331. [20] W. G. Jung, Op Amp Applications Handbook (Analog Devices Series), 1st ed. Amsterdam, The Netherlands: Elsevier, 2005. [21] Atmel Corp. ATmega328 Data Sheet, accessed on Jan. 25, 2017. [Online]. Available: http://www.atmel.com/Images/Atmel-42735-8-bitAVR-Microcontroller-ATmega328-328P_Datasheet.pdf
Ponnalagu Ramanathan Nagarajan received the B.E. degree in electrical and electronics engineering from Madurai Kamaraj University, Madurai, India, in 2000, and the M.E. degree in electronics and control from Sathyabama University, Chennai, India, in 2005. She is currently pursuing Ph.D. degree with the Department of Electrical Engineering, IIT Madras, Chennai. She has been an Assistant Professor with the Department of Electrical and Electronics Engineering, Rajalakshmi Engineering College, Chennai, since 2000. Her current research interests include sensors, signal conditioning, measurements, and instrumentation.
Boby George (M’07) was born in Kannur, India, in 1977. He received the M.Tech. and Ph.D. degrees in electrical engineering from IIT Madras, Chennai, India, in 2003 and 2007, respectively. He was a Post-Doctoral Fellow with the Institute of Electrical Measurement and Measurement Signal Processing, Technical University of Graz, Graz, Austria, from 2007 to 2010. He joined the Faculty of the Department of Electrical Engineering, IIT Madras, in 2010, where he is currently an Associate Professor. His current research interests include measurements, sensors, and instrumentation. He is currently serving as an associate editor for IEEE Sensors Journal.
V. Jagadeesh Kumar (M’96–SM’11) received the B.E. degree in electronics and communication engineering from the College of Engineering Guindy, Chennai, India, in 1978, and the M.Tech. and Ph.D. degrees from IIT Madras, Chennai, in 1980 and 1986, respectively. He joined King’s College London, London, U.K., in 1988, the Asian Institute of Technology, Bangkok, Thailand, in 1996, the University of Braunschweig, Braunschweig, Germany, in 1998, and the University of Aachen, Aachen, Germany, in 1999, 2007, 2011, and 2013. He is currently a Professor of Electrical Engineering with IIT Madras, where he also serves as the Dean Academic. He is the Head of the Central Electronics Center, Chennai. He has guided seven Ph.D. Scholars and 11 M.S. (Research) Scholars. He has authored over 50 Journal articles (mostly in the IEEE Journals) and presented over 90 papers in International Conferences. He has obtained 6 patents. His current research interests include measurements, instrumentation, biomedical engineering, and signal processing. Dr. Kumar received the Young Scientist Award from the Department of Science and Technology in 1988 and the DAAD Fellowship Award in 1997.