
 
be used because it leds to increased power 
consumption.  
2.3 Measurement Principle 
The measurement is based on counting of 255 
periods of the measured signal. Microcontroller 
system clock is used as a sampling signal. Quiescent 
frequency of the oscillators is set to 4.5 kHz. The 
microcontroller counts 255 periods in 56 ms. Thus 
total measurement time is 112 ms. These 
calculations are not correct because the pair of 
oscillators are not really identical, but even if real 
measurement can be faster or slower, complete 
measurement time is constant. This attribute is given 
by design of the differential pressure sensor. The 
measurement algorithm is implemented in the 
microcontroller as follows: Counter/Timer0 (C/T0) 
is configured as an 8-bit counter (it means 255 
period of input signal). The Counter/Timer1 (C/T1) 
runs as a 16-bit timer with 125 kHz clock before the 
counting is allowed. The low system frequency of 
the microcontroller significantly reduces power 
consumption [3]. But minimal 1 MHz of the system 
frequency is needed to suppose desired measurement 
accuracy. Due to when 253 periods are counted the 
microcontroller is over-clocked to 2 MHz. The value 
in C/T1 is stored for next processing and C/T1 is 
cleared. When the 255 periods are counted, the 
interrupt is called and value in C/T1 is red. This 
value reflects the measured capacity. With no 
pressure the counter counts approximately 112 000 
pulses from each oscillator. By using equation  
2log
log
x
n =
, 
(2) 
where x represents numbers of levels and n is a bit 
resolution, we can calculate that we can measure 
oscillator frequencies with more than 16-bit  
resolution.  
This accuracy is adequate. For effective 
processing of the measured values, the working 
variable A(p) is evaluated. Variable A(p) represents 
uncorrected digital pressure  
21
21
)(
ff
ff
pA
+
= , 
(3) 
where  f
1
 and f
2
 are measured frequencies of 
oscillator output signals. At next stage the working 
variable  A(p) is calibrated using non-linear 
corrections by hi-order polynomial. The calibration 
provides linear response of the output value to the 
pressure. The calibrated output value presents the 
digital pressure and is set in specified units (bar, 
kPa, etc.). After all linearization and calibration 
processes the value is sent via SPI to the second 
microcontroller which provides transmitting into the 
current loop.  
2.4 Corrections  
Two corrections are calculated by the embedded 
microcontroller. At first, the linearization, offset 
calibration and gain correction are calculated. Next, 
the temperature dependence of the measuring 
electronics is compensated. Fig. 3 shows enumerated 
dependencies in a 3D graph. 
 
Figure 3: The oscillator output frequency dependence on 
pressure and temperature. 
 
There are a few calibration methods for example 
lookup tables but these methods are usually of a high 
cost and time consuming [2]. The polynomial of 
fifth to eighth order is used for calibration of the 
variable A(p). The basic form of the polynomial is  
n
n
xaxaxaay ++++= ..
2
210
 
(4) 
The Lagrange’s polynomial is used for calculation of 
the calibration constants. The Lagrange’s 
polynomial is the lowest order polynomial which 
goes through specified values [4]. The Lagrange’s 
polynomial can be calculated by 
∑
=
n
i
ii
xf
1
)(
λ
 
(5) 
where 
)
)
)( ) ( )
()( )( )( )( )
niiiiiii
nii
i
xxxxxxxxxx
xxxxxxxxxx
−−−−−
−−−−−
=
+−
+−
......
......
1121
1121
λ
. 
(6) 
The calibration data is stored in FRAM embedded 
on the oscillator board. 
 
ICINCO 2007 - International Conference on Informatics in Control, Automation and Robotics
246