Information Technology Reference
In-Depth Information
Figure 2. Photo of the device prototype
interrupt INT0 is fired and the inter-beat interval
is calculated using the following equation:
using the A/D module: Pins RB2, RB3, RB4 and
RB5 are connected to a 12 bits A/D converter
which generates a number between 0 and 4095
that corresponds to the interval 0V to 5V. By using
a simple linear interpolation, it is possible to find
V RTD and V GSR defined by V RB4 -V RB2 and V RB5 -V RB3
respectively. Hence having the voltage V RTD , the
resistance of the RTD is calculated by:
IBI=Timer2/28800
Then Timer2 is reset to zero. To avoid sharp
changes in the inter-beat interval due to noise, a
moving average is deployed. An array of the last
10 measured values is kept in memory and the
inter-beat interval is given as their average. Once
a new IBI measure is taken the oldest value in the
table is discarded and this new value is added to
generate the new average.
Timer3 is also driven by the same frequency
of 28800Hz and is calibrated to overflow every 1
second. This is the sampling frequency at which
a new decision is generated. When Timer3 over-
flows, interrupt T3_Interrupt is fired. This interrupt
results in the computation of the voltage across
the RTD as well as the voltage across the GSR
V
0 5
.
+
RTD
5
RTD
=
100
.
V
0 5
.
RTD
5
and the temperature is calculated by:
RTD
100
0 385
T
=
.
 
Search WWH ::




Custom Search