Академический Документы
Профессиональный Документы
Культура Документы
a r t i c l e i n f o a b s t r a c t
Article history: A novel time domain method and its implementation in a simple smart impedance sensor controlled by
Received 11 May 2011 an 8-bit microcontroller is presented in the paper. The method is based on stimulation of a voltage divider
Received in revised form 17 October 2011 consisting of a resistor working as a current-to-voltage converter and the impedance sensor by a single
Accepted 17 October 2011
square-voltage pulse with a duration time T directly generated by the output of the microcontroller and on
Available online 20 October 2011
sampling the resulting voltage on the sensor at three different selected moments T/8, T/2 and 7T/8 by the
internal ADC of the microcontroller. The sensor is modeled by a three-components circuit. The duration
Keywords:
time T is determined by the rst timer and the ADC is triggered by the second timer of the microcontroller.
Time-domain measurement
Microcontroller interfacing
The measurement procedure takes less than 1 ms and the determination of model component values is
Impedance sensors based on basic calculus. Thanks to this, smart sensors basing on this solution are energy-saving, they
can work on the same batteries by a few years, and low cost on the level tens euros. Hence, they can be
used in wireless sensor networks, especially basing on the ZigBee protocol. The results of the simulation
investigation and the experimental verication of the method are included in this paper.
2011 Elsevier B.V. All rights reserved.
0924-4247/$ see front matter 2011 Elsevier B.V. All rights reserved.
doi:10.1016/j.sna.2011.10.018
Z. Czaja / Sensors and Actuators A 173 (2012) 284292 285
resistor working as a current-to-voltage converter (CTVC resistor) vout = vin i(Rsp , Rp , Cp )Rr (1)
and the sensor (Fig. 1) by a single square voltage pulse and on
Thanks to this solution, we can treat the measurement circuit as
sampling the resulting voltage on the sensor at three different
a four-terminal circuit and therefore we can adapt ideas from fault
selected moments. Because the impedance model is known, the
diagnosis methods of analog circuits [1315] for determination of
values of three model components are calculated from three
components values of the impedance sensor model.
measurement results. The electronic circuit is simple. It consists of
only the microcontroller (exactly: its internal devices: two timers
and an ADC) and the CTVC resistor. The rst timer determines the 2.2. Circuit analysis
duration time of the single square pulse directly generated by the
output of the microcontroller, and the voltage response is sampled The measurement circuit is stimulated by a single square pulse
by the ADC triggered by the second timer. If we need measurement vin (t) with the duration time T (Fig. 2). In the time domain this
results with a better voltage resolution, we have to add an external excitation can be described by the formula:
ADC to the system. Determination of model component values is vin (t) = VCC (1(t) 1(t T )) (2)
based on basic calculus, which can be made with success by 8-bit
microcontrollers. Converting it to Laplaces domain, we obtain the form:
Obviously, there are methods [46] which need about ten times 1 1 sT
less calculation to determine component values from measurement Vin (s) = VCC e (3)
s s
results and they are also characterized by smaller inuence of mea-
surement uncertainty in estimation of component values than the It is assumed that the output signal vout (t) is sampled by an ADC
proposed method. But, their implementation in such simple sys- at three moments as shown in Fig. 2: tk = k, tl = l, tm = m, where
tems is considerably more difcult. Their measurement procedure k, l, m, n N, k < l < m n, t = T/n, and n is the number of the period
is complex, it takes more time and it requires complex calculations T division. Hence, we obtain the following voltage samples: Vk , Vl ,
and storage of the set of acquired measurement data. Additionally, Vm . After normalization (after division of these values by VCC ) we
there are high requirements on measurement conditions minimiz- obtain: vk = Vk /VCC , vl = Vl /VCC , vm = Vm /VCC .If we assume that
ing the measurement errors, which cannot be fullled by the ADC vm vk v vm
of the microcontroller. p= and q = l (4)
vk vl vk vl
we can simplify (A.13) (see Appendix A) to the following form:
2. Description of the method
m + pl + qk = 0 (5)
The method consists of two parts: the measurement part, where
the sensor is stimulated by a single square pulse, its voltage time From (5) it is seen that it is important to set values k, l, m for
response is sampled three times, and the calculation part in which which the equation is analytically resolvable. It is possible for exam-
the measurement result is used to analytical computations of com- ple, when n = 8 and k = 1, l = 4, m = 7. For these values (5) can be
ponents values of the sensor model. written as:
It is assumed that the sensor is modeled by a three-component 7 + p4 + q = 0 (6)
circuit consisting of a resistance Rsp connected in series with par-
allel connection of a resistance Rp and a capacitance Cp (Fig. 1) what gives:
according to rules described in [2,46]. Nominal values of model
6 + p3 + q = 0 (7)
components are the following: Rsp = 100 , Rp = 1000 , Cp = 1 F.
These values were used for a simulation analysis and an exper- If we assume that x = 3 we obtain from (7) the square equation:
imental verication of the method. They are the same as in the
template model in [2] what allows a better estimation of the pro- x2 + px + q = 0 (8)
posed method. Its solution giving good results is
At the current stage of investigations of the method, whose
results are presented in the paper, the above sensor model p p2 4q
is assumed, because a constant-phase element (CPE) involves x= (9)
2
too complex calculations to be implemented in an 8-bit micro-
controller. It follows from the fact that it needs considerably Hence = 3 x. Because = e = eT/n the is calculated from:
more calculations to determine component values as presented n
= ln (10)
in [1], what is inconvenient for systems controlled by 8-bit T
286 Z. Czaja / Sensors and Actuators A 173 (2012) 284292
Fig. 2. Timings of the stimulation signal of the measurement circuits and the voltage time response of the impedance sensor.
Assuming that k = k and l = l we can transform (A.7) to the form: microcontroller, e.g., the ZDM-A1281-A2 module [17] and also the
ATmega128RFA1 microcontroller family used in the 2.4 GHz RF
vk = + k transceiver.
(11)
vl = + l Thanks to this, the approach presented in the paper can be
implemented directly in wireless sensor networks. It is sufcient to
After derivations of (11) we have:
connect the impedance sensor to the ZigBee module (to appropriate
vk l vl k pins of the microcontroller), obviously if it is required, via the con-
= (12a)
l k ditioning circuit to assure good levels of stimulation and response
vk (l 1) vl (k 1) signals, and to add functions serving the impedance sensors (real-
= (12b) izing measurement and calculation procedures) to the ZigBee stack
l k
application layer. In other words, the proposed method allows to
Therefore, we calculate the values of model components of the extend the functionality of the existing wireless module without
impedance sensor Rsp , Rp , Cp basing on these indirect parameters its extension with electronic circuits. In this way, we obtain a small
, , : and compact wireless smart sensor.
As was mentioned above, to test the method and its possibili-
Rsp = Rr (13a) ties, the laboratory microcontroller system based on the ATmega16
1
microcontroller (Fig. 3) was realized.
The measurement circuit is directly connected to the micro-
Rp = Rr (13b)
1 1 controller pins. The stimulating square pulse is generated on the
OC0 pin. Its duration time T is determined by the 8-bit Timer 0
1/1 working in the Compare Match Output Mode. The voltage response
Cp = (13c)
Rr ((/1 ) (/1 ))1/1 of the impedance sensor applied to the ADC0 pin is sampled
We have got vk, vl, vm values of voltage samples after the mea- three times by the 10-bit ADC, which is triggered by the 16-bit
surement part. Thus, to determine the Rsp , Rp , Cp component values Timer 1 operating in the Clear Timer in Compare Match (CTC)
we rst have to calculate p and q values from (4), next we solve (9) Mode.
and determine the value and we compute indirect parameters The measurement procedure is realized by the measurement()
from (10), from (12a) and from (12b), which are put into nal function. It consists of four code sections. The code placed in the
formulas (13a) for Rsp , (13b) for Rp and (13c) for Cp . Hence, these main body of the function is responsible for initializing timers and
calculations are no more complex, thanks to this they can be real- the ADC, setting 1 on the OC0 output, starts the Timer 0 with the
ized by 8-bit microcontrollers. For example, the ATmega16 running value corresponding to the duration time T and the Timer 1 with
with a 4 MHz quartz crystal oscillator needs about 8 ms to execute the value equivalent to T/8. The interrupt service of the Timer 0
these calculations. hardware sets 0 on the OC0 output and stops the Timer 0. The
interrupt of the Timer 1 hardware triggers the ADC conversion and
2.3. The microcontroller system writes in the next value to the Timer 1 representing 4T/8 (the rst
interrupt activation) or 7T/8 (the second one), or stops (the third
The laboratory microcontroller system for measurement of one) the Timer 1. The rst interrupt service of the ADC saves the
three independent components in impedance sensors is built with 10-bit conversion result in the variable v k, the second one in the
only the ATmega16 microcontroller of Atmel [16]. We decided variable v l, and the third one in the variable v m and set the ag
to use the microcontroller with the AVR core, because Atmel end measurement used by the main function to nish the measure-
offers compact 802.15.4/ZigBee modules with the ATmega1281 ment procedure.
Z. Czaja / Sensors and Actuators A 173 (2012) 284292 287
1
I
Table 1
Optimum values of Ti opt and Rr i opt assuring the best measurement conditions.
Table 2 Table 3
Maximum ranges of changes of absolute measurement errors for complete ranges Relative uncertainties of components determination as a function of a measurement
of component value changes. uncertainty.
Absolute error vkl [*5 mV] vlm [*5 mV] vmk [*5 mV] Measurement absolute Relative uncertainty of values components
component (relative) uncertainty determination
Fig. 7. Graphs of measurement results represented by values of differences between respective voltage samples: vkl = vk vl , vlm = vl vm , vmk = vm vk .
290 Z. Czaja / Sensors and Actuators A 173 (2012) 284292
Fig. 8. Graphs of relative errors of component value determination from measurement results.
presents simulation results basing on the Monte Carlo method [24] set one optimum value of the duration time T and one optimum
of relative uncertainties of component determination as a function value of the CTVC resistor Rr for this range.
of a measurement uncertainty. A rectangular probability distribu- Summarizing we can afrm that the proposed microcontroller
tion function (pdf) of the measurement uncertainty was assumed system for measurements of three independent components in
and a 99.73% coverage interval of the uncertainties of the compo- impedance sensors using a single square pulse works properly
nents determination. according to the presented theory. The measurements character-
From Table 3 it is seen that the values of relative uncertainties ize an unusually big repeatability for this hardware, what was
of component determination for Rsp (Rsp ), Rp (Rp ) and Cp (Cp ) are exactly tested. The experimental results conrm that an advan-
about 10 times, 38 times and 13 times higher than the measurement tage of the presented time-domain method (very short time of
uncertainty (meas ), respectively. Unfortunately, this disadvantage measurements) is simultaneously its disadvantage (a small accu-
follows from the fact that the proposed method belongs to a class racy of determination of component values of the sensor model).
of time-domain methods. Obviously, it is possible to improve this accuracy. Usually, in real
The described feature of the method is particularly visible applications changes of values of a given physical quantity have a
for the relative errors Rsp (Fig. 8) of the Rsp value compo- predominant inuence typically on values of one component of the
nent determination. For relatively constant values of absolute sensor model. Thus, it allows to match the best measurement con-
measurement errors (Fig. 7) and more and more smaller val- ditions for this component and to change these conditions (e.g., the
ues of the Rsp component (more and more smaller impact of duration time T) according to expected values of this component.
the Rsp component on the sensor impedance) set during the Moreover, changes of values of a given component can be presented
measurements, the relative error Rsp grows and for Rsp = 10 in the form of identication curves [1315] scaled directly in values
achieves even 120% (the graph Rsp as a function of Rsp /Rsp of a given physical quantity (it allows to use a look-up technique),
nom ). what eliminates rstly the calculations biased by the bad numerical
Around nominal values of sensor model components the rela- conditions needed for component value determination and sec-
tive errors of the values of component determination are similar ondly the calculations converting these values to values of a given
to uncertainties corresponding to them presented in Table 3, what physical quantity.
conrms that measurements were made in the best possible mea-
surement conditions. These conditions are not optimal for extreme 5. Conclusion
values of the components, what leads to effective growth of the
relative errors. Moreover, the numerical conditions cause that, e.g., In the paper a microcontroller system for measurement of three
for two the smallest values of the Cp component, for which vl = vm , independent components in impedance sensors using a single
the formula (8) is incomputable. square pulse and the new time domain method elaborated for this
The described problems follow from the fact that we have taken system are presented. The system is simple, because it consists only
restrictive assumptions for investigations of the microcontroller of the 8-bit microcontroller (exactly: its internal devices, i.e. two
measurement system. That is, we assumed a very wide range of timers and the ADC), the inverter built from two MOSFETs and
value changes for all components of the sensor model and we have the CTVC resistor. The measurement procedure is short (it takes
Z. Czaja / Sensors and Actuators A 173 (2012) 284292 291
less than 1 ms) and determination of model components values is If we place = and = e into (A.6), we obtain the following
based on basic calculus. These advantages follow from the fact that equations:
the system was designed for simple small smart sensors, especially
vk = + k
battery-powered and also working in wireless sensor networks,
vl = + l (A.7)
e.g., basing on the ZigBee protocol.
vm = + m
Thanks to this, smart sensors basing on this solution are energy-
saving, they can work on the same batteries for a few years, and low Subtracting the rst equation from the second one of (A.7) we
cost on the level of tens of euros, what allows to implement them obtain:
in large wireless sensor networks.
vl vk = (l k ) (A.8)
As an analysis of uncertainties of component determination and
experimental investigations proved, the proposed time-domain From (A.8) we determine:
method characterizes the small accuracy of the component value vl vk
determination. Hence, with regard to its small accuracy and the = (A.9)
l k
advantages quoted above, smart sensors basing on this method are
ideally suitable for monitoring of physical objects, and testing that We put this result to the third equation of (A.7) what gives:
their parameters do not exceed the assumed threshold values. For vl vk
vm = + m (A.10)
example if threshold values are exceeded, the smart sensor working l k
as an endpoint of the wireless network can send this information to
From (A.10) we assign :
a network coordinator, who can turn on an another more advanced
sensor basing on the more energy-consuming but more accurate vl vk
= vm m (A.11)
frequency-domain method. l k
Next, the is put to the rst equation of (A.7), what gives:
Appendix A. vl vk vl vk
vk = vm m + k (A.12)
l k l k
The measurement circuit can be treated as a four-terminal cir-
cuit (Fig. 1). Hence, its voltage transmittance can be written as: what after transformations gives the equation with only one
unknown quantity :
Vout (s) s +
Ku (s) = = (A.1) vm vk v vm
Vin (s) s+ m + l + k l =0 (A.13)
vk vl vk vl
where Vin (s) described by (3) and Vout (s) are Laplace transforms of
Formula (A.13) is used as a basis to next transformations made
the input voltage vin (t) given by (2) and the output voltage vout (t)
in the text.
of the measurement circuit adequately, and
Rr + Rsp + Rp References
= (A.2.a)
Cp Rr Rp + Cp Rsp Rp
[1] J. Lario-Garcia, R. Palls-Areny, Constant-phase element identication in con-
Cp Rsp Rp ductivity sensors using a single square wave, Sensors and Actuators A 132
= (A.2.b) (2006) 122128.
Cp Rr Rp + Cp Rsp Rp
[2] J. Lario-Garcia, R. Palls-Areny, Measurement of three independent compo-
nents in impedance sensors using a single square wave, Sensors and Actuators
Rsp + Rp
= (A.2.c) A 110 (2004) 164170.
Cp Rr Rp + Cp Rsp Rp [3] F. Reverter, O. Casas, Direct interface circuit for capacitive humidity sensors,
Sensors and Actuators A 143 (2008) 315322.
That is, the response signal Vout (s) of the impedance sensor is the [4] A. Meja-Aguilar, R. Palls-Areny, Electrical impedance measurement using
output signal of the four-terminal circuit (Fig. 1) what is expressed pulse excitation, in: Proceedings of 16th IMEKO TC4 Symposium, September
2224, Florence, Italy, 2008, pp. 567572.
by: [5] A. Meja-Aguilar, R. Palls-Areny, Electrical impedance measurement using
voltage/current pulse excitation, in: Proceedings of XIX IMEKO World Congress,
September 711, Lisbon, Portugal, 2009, pp. 662667.
Vout (s) = Ku (s)Vin (s) = VCC + . (A.3)
s+ s (s + ) [6] M.T. Ehrensberger, J.L. Gilbert, A time-based potential step analysis of elec-
trochemical impedance incorporating a constant phase element: a study of
commercially pure titanium in phosphate buffered saline, Journal of Biomedical
After transformations in the time domain the output signal vout (t)
Materials Research Part A 93 (2010) 576584.
has the form: [7] S. Bayoudha, A. Othmane, L. Ponsonnet, H.B. Ouada, Electrical detection
and characterization of bacterial adhesion using electrochemical impedance
VCC et + (1 et ) for 0 t < T spectroscopy-based ow chamber, Colloids and Surfaces A: Physicochemical
vout (t) = (A.4) and Engineering Aspects 318 (2008) 291300.
VCC (et e(tT ) ) for t T [8] S. Kumar, P.K. Singh, G.S. Chilana, Study of silicon solar cell at different inten-
sities of illumination and wavelengths using impedance spectroscopy, Solar
Energy Materials & Solar Cells 93 (2009) 18811884.
if we assume = / that: [9] M.A. Danzer, E.P. Hofer, Electrochemical parameter identicationAn efcient
method for fuel cell impedance characterisation, Journal of Power Sources 183
VCC ( + ( )et ) for 0 t < T (2008) 5561.
vout (t) = . (A.5) [10] C.E.B. Neves, M.N. Souza, A method for bio-electrical impedance analysis based
VCC ( )(et e(tT ) ) for t T on a step-voltage response, Physiological Measurement 21 (2000) 395408.
[11] A.R. Waterworth, P. Milnes, R.H. Smallwood, B.H. Brown, Cole equation mod-
It is assumed that the output signal vout (t) is sampled by an ADC elling to measurements made using an impulse driven transfer impedance
at three moments: tk , tl , tm as it is shown in Fig. 2 and described in system, Physiological Measurement 21 (2000) 137144.
[12] J. Hoja, G. Lentka, Interface circuit for impedance sensors using two spe-
the main text (before formula (4)). Thus, basing on (A.5) we derived cialized single-chip microsystems, Sensors and Actuators A 163 (2010)
formulas for vk , vl , vm : 191197.
[13] Z. Czaja, A diagnosis method of analog parts of mixed-signal systems controlled
vk = + ( )ek by microcontrollers, Measurement 40 (2007) 158170.
vl = + ( )el (A.6) [14] Z. Czaja, Using a square-wave signal for fault diagnosis of analog parts of mixed-
signal electronic embedded systems, IEEE Transactions on Instrumentation and
vm = + ( )em Measurement 57 (2008) 15891595.
292 Z. Czaja / Sensors and Actuators A 173 (2012) 284292
[15] Z. Czaja, A method of fault diagnosis of analog parts of electronic embedded [23] Z. Czaja, Wykorzystanie przetwornikw A/C wbudowanych w mikrokon-
systems with tolerances, Measurement 42 (2009) 903915. trolery do pomiarw parametrw sygnaw zmiennych (Using inter-
[16] Atmel Corporation, 8-bit AVR microcontroller with 16k Bytes In-System Pro- nal ADCs of microcontrollers for measurements of alternating signal
grammable Flash, ATmega16, ATmega16L, PDF le, 2003. parameters), Przeglad Elektrotechniczny (Electrical Review) 86 (2010)
[17] MeshNetics (Atmel Corporation), ZigBit OEM Modules ZDM-A1281 58.
Ultra-Compact 2.4 GHz 802.15.4/ZigBee Modules for Wireless Networking [24] JCGM 101:2008, Evaluation of measurement data Supplement 1 to the Guide
Applications, PDF le, 2007. to the expression of uncertainty in measurement Propagation of distributions
[18] F. Reverter, J. Jordana, M. Gasulla, R. Palls-Areny, Accuracy and resolution of using a Monte Carlo method, JCGM 2008.
direct resistive sensor-to-microcontroller interfaces, Sensors and Actuators A
121 (2005) 7887.
[19] F. Reverter, O. Casas, Interfacing differential capacitive sensors to micro- Biography
controllers: a direct approach, IEEE Transactions on Instrumentation and
Measurement 59 (10) (2010) 27632769.
[20] International Rectier, IRF7105 HEXFET Power MOSFET, PDF le, 2003. Zbigniew Czaja was born in Czluchow, Poland, in 1970. He graduated from Gdansk
[21] F. Reverter, J. Jordana, R. Palls-Areny, Internal trigger errors in microcontroller- University of Technology, Faculty of Electronics, Telecommunications and Informat-
based measurements, in: Proceedings of XVII IMEKO World Congress, June ics in 1995. The PhD degree in electronics was received in 2001 from the same
2227, Dubrovnik, Croatia, 2003, pp. 655658. university. He works as assistant professor at this University. His research interests
[22] F. Reverter, R. Palls-Areny, Uncertainty reduction techniques in are in technical diagnosis, especially for fault diagnosis of electronic analog circuits,
microcontroller-based time measurements, Sensors and Actuators A 127 and electronic mixed-signal embedded systems controlled by microcontrollers. He
(2006) 7479. is also interested in applications of small 8-bit microcontrollers.