Information Technology Reference
In-Depth Information
Figure 1. Photo of sensors used
Microcontroller
measurements and decision are sent via UART2
serially to a MAX232 which transforms the signal
into one that can be read by the PC. The MAX232
outputs its data to the serial onboard Bluetooth
chip, which communicates with the USB dongle
placed on the nearby PC. Note that no negative
voltage is needed in all the circuit, thus a simple
9V battery followed by a 5V regulator (L7805)
is enough to power up the circuit.
The microcontroller used for this device is the mi-
crochip DSPIC 30F6014. This DSPIC was chosen
because of the need for floating point accuracy as
well as the computation of exponential expressions
which are needed for SVM to determine the agita-
tion state of the subject. It is powered by the 5V
source, and uses a 7.3728MHz oscillator. The 4
analog channels (RB2, RB4) and (RB3, RB5) are
used to measure the voltage output of the RTD and
GSR bridges respectively. It is imperative to use
2 channels for each bridge to find the 2 voltages
at both nodes and then find their difference. Note
that it is not possible to feed both bridges to the
same PIN and choose it as a reference for the A/D
conversion process, because of the small variation
of the resistors from their theoretical value. This
could create a difference between the two reference
points of each bridge. As for the heart rate sensor,
it is connected to the external interrupt pin RF6.
The A/D conversions as well as the IBI measure-
ments are described in the next subsection. The
Algorithm
The acquisition of all sensors and the decision
is provided by the DSPIC which implements the
algorithm described in this section. Pins RB2,
RB3, RB4, RB5 and RF6 are initialized as input
pins. Timer2 is used to find the inter-beat interval
while Timer3 is used to fix the sampling rate of 1
sample per second. The clock driving the timer is
Fosc X PLL/4 with a pre-scalar set to 1:256 which
yields, using a PLL=4 and Fosc=7.3728MHz, a
frequency of 28800Hz. At every heart beat a 5V
is generated and fed to pin RF6. The external
Search WWH ::




Custom Search