TA: Shao Hsia
May 2, 2000
Project # 15
The Biotelemetry Unit takes in a patient’s vital signs and transmits the data to a
local PC for display and analysis. The vital signs are measured using three
electrocardiogram (ECG) electrodes and a temperature sensor. The electrodes are used to
measure the heart rate of the patient, and the temperature sensor is used to measure body
temperature. The signals are then processed using Basic Stamp and wirelessly
transmitted on one frequency using LINX modules. The data is then input to a MAX232
where it is converted to a RS-232 signal and sent into a PC. LabVIEW is used to display
the signals in real-time and to compare the data to predetermined thresholds. When a
threshold is reached a call for medical assistance is placed.
TABLE OF CONTENTS
2. DESIGN PROCEDURE……………………………………………….3
3. DESIGN DETAILS……………………………………………………8
4. DESIGN VERIFICATION……………………………………………16
5. COST ANALYSIS…………………………………………………….23
Our project is a Biotelemetry Unit, which provides data for heart rate and
temperature readings for monitoring and evaluation using a home PC. This will provide
patients who need special attention the ability to move freely about their home while
important vitals are measured and processed for emergency conditions. The home
computer will monitor the signals and if some predefined threshold is reached a call to
medical personnel is placed. The goal of our project is to save lives by speeding up
medical response to persons in need. By creating a relatively inexpensive, wireless home
monitoring system, we hope to add a new dimension to health care.
The function of the electrocardiogram (ECG) is to obtain accurate, real-time heart
rate measurements. The ECG signal is a measurement of the electrical activity from the
heart. By analyzing the signal for peaks, one can determine the heart rate of a patient.
The temperature sensor was used to obtain precise temperature readings from the
patient. The output of the sensor was directly proportional to the actual temperature.
After the sensors acquired the signals, analog to digital converters were used to input the
signals into the Basic Stamp. The Basic Stamp then combined the signals for
transmission on one frequency alternately sampling between the two inputs. A LINX 418
MHz transmitter is used to send the signal wirelessly to the matching receiver, where it is
then converted to an RS-232 signal through a MAX232 chip.
The PC monitors the signal and a life-threatening or intervention-required
situation will trigger a call to medical personnel. A home computer was chosen to keep
the cost to the patient down.
Figure #1 shows the block diagram for the Biotelemetry Unit.
LINX 418 MHz
Basic Stamp 2
Receiver MAX232 RS-232
Figure #1. Block Diagram of Biotelemetry Unit
The performance of our Biotelemetry Unit was determined by its ability to obtain
accurate readings of the specified vital signs. Real-time data sampling and error-free
transmission of the signals are important to the desired operation of the unit.
Transmission of data to a maximum of 30 feet without interference is also an important
performance factor. This radius would allow a patient to move freely within their home.
2. DESIGN PROCEDURE
Various sensors must be used in order to detect the vital signs of a patient. The
three measurements that are desired are the blood pressure, heart rate, and body
temperature. In the original design of the Biotelemetry Unit the blood pressure and heart
rate of the patient were to be taken using a flexible diaphragm tonometer. This device
consists of a polyurethane diaphragm, which expands into the tonometer case as the
artery expands against it. This expansion of the diaphragm causes a change in the
volume of a conductive liquid within the tonometer, which in turn changes the current
flow thorough electrodes within the tonometer. This device provides real time
measurements of the patient’s blood pressure and the heart rate can be deduced from the
frequency of the peaks in the blood pressure.
It was decided after approximately two weeks of research that utilizing the
tonometer for the Biotelemetry Unit would not be feasible in the time allowed. The
precision manufacturing required to construct it, as well as the minimal literature on the
devices exact operation, led to the rejection of the tonometer in the Biotelemetry Unit.
In place of the tonometer it was decided that a measurement of the patient’s
electrocardiogram or ECG signal would be used to obtain a heart rate from the patient.
This signal would be acquired from the body using standard ECG electrodes and then
amplified in order provide a signal which can be transmitted and analyzed in LabVIEW.
The signal itself is a difference of the biopotentials at two locations on the patient's body
taken in reference to circuit ground. Figure #2 shows the general layout of the ECG
circuit with each electrode listed and the process of achieving a measurable signal.
Difference Non-inverting D
A B Amp Amp D
Electrode (A-B)*G=C C*G=D D
B E D
Figure #2. Block Diagram of ECG Circuit
For measuring the patient’s body temperature an ambient temperature sensor was
used which produces an output current proportional to absolute temperature. This device
is small enough to be affixed to the patient comfortably under the armpit where an
accurate temperature can be measured. The signal of the temperature sensor must also be
amplified in order to enhance measurement capabilities. Because data is being converted
to a decimal scale of 0-255 the normal output of the sensor will only vary by one point
along this scale due to its millivolt magnitude. If the signal is amplified by a factor of ten
changes can be seen in body temperature resolved over the range of at least 3 points in
the decimal scale. This amplification is crucial in determining whether the patient’s
temperature is approaching dangerous levels.
The design procedure for the data conversion and transmission portion of the
project includes a transmit side and a receive side. The transmit side contains analog to
digital conversion of the signals from the sensors as well as signal combination and
transmission. The receive side includes reception and voltage conversion for RS-232
input using the serial cable. The analog output from the sensors was converted to digital
using two National Semiconductor ADC0831 chips. The Basic Stamp provided control
signals for the A/D converters and also combined the two digital signals for transmission
using the Linx modules. The receiver passed the combined signal to the MAX232 chip
for serial conversion and input to the local computer where LabVIEW separated and
analyzed the data. Figure #3 is a general circuit diagram that shows the layout of the
Temperature Sensor VIN+
ADC0831 U9A U7A
2 3 1 2
0 1 IN+ OUT IN OUT+
4 IN- 4 3
12 CON CON OUT-
U5 Basic Stamp II
ECG Signal VIN+
R1IN R1OUT PORTLEFT-L
11 R2IN R2OUT 14
10 T1IN T1OUT 7
1 2 T2IN T2OUT
IN OUT+ 1
4 3 3 C+
CON OUT- 4 C1-
Linx Reciev er
5V 2 C2-
Figure #3. Schematic of Data Conversion and Transciever
Motorola analog transmitters were considered as an alternative to the Linx
modules. The Motorola transmitters are smaller and this was desirable for our design, as
we wanted to keep it compact for comfort. They also eliminated the need for digital
conversion on the transmit side and this further reduced the number of necessary
components in the detection unit. Linx modules were chosen because digital
transmission is not only reliable but allows for combination of the signals and therefore
only one transmitter and receiver are needed. The Linx modules were also simple to
implement because there was no external circuitry required.
Once the data was received, it then needed to be displayed and analyzed. There
were a few possible solutions to be considered. A microcontroller could be used to
process and analyze the data and then use LED’s to warn the user when a threshold level
had been reached. This idea was rejected because LED’s would not provide an easy to
understand user interface. Also programming in assembly, which is a low level language,
would be tedious. Another option was to use an oscilloscope as the display, and build
hardware that would be suited for this particular application. This idea was rejected
because it would be too costly and time consuming to find the parts necessary for the
hardware. It also does not readily allow for upgrades for new features because new
hardware would be needed. For these reasons, National Intruments’ LabVIEW was
chosen as the best possible solution to display and analyze the data. It provides an easy
to understand user interface and graphical display. Because it is a graphical language, it
is also easy to program. Also as a software package, it can easily be upgraded. The
software package is also ideal because the consumer would not need to buy a special
monitor and display unit. Instead, the consumer could just load the program onto a
personal computer, keeping costs down.
LabVIEW was used to display and analyze the data. The data was input into the
personal computer through a serial port. LabVIEW then read the data, split it into the
heart rate and temperature components, and displayed the data in real time. The
frequency of the ECG signal was determined to calculate the heart rate and it was then
displayed. The data for the temperature sensor was converted to degrees Fahrenheit to
make it easier for the patient and physician to interpret. The data for both the heart rate
and temperature was also compared to predetermined thresholds. If the data exceeded
any of the thresholds, a warning indicator was displayed on the PC and a call for medical
attention sent along with the patient’s physiological data. This would allow for a more
prompt and informed response by medical staff.
3. DESIGN DETAILS
The electrocardiogram signal is taken from the patient’s body in accordance to a
procedure in Webster . The cardiac muscle is activated by an electrical impulse,
which produces a dipole across the patient’s chest from the right shoulder to left
abdomen. In order to achieve a large and consistent difference between biopotentials the
signal electrodes were attached to the right wrist and left wrist of the patient as
demonstrated in Webster . This created the largest possible difference in biopotentials
because the electrodes were at extreme opposites from the source of the electrical
impulse, the heart. The ground, which is the reference position for each individual
biopotential magnitude, was placed over the right side of the patient’s chest and
connected to the amplifier circuit’s ground port. The signals off the electrodes are
subtracted from one another and then this difference is amplified by the factor of gain in
(VA – VB)*(R2 / R1) = V1 (1)
This brings what is originally the difference of two signals with magnitude 5mV
and amplifies it to a signal of tens of millivolts. This signal is then further amplified by a
non-inverting amplifier with magnitude of
V1* ((R1 + R2) / R2) = V2 (2)
The layout of the circuit can be seen below in Figure #4. For the design a
quadruple operational amplifier chip was used, LM348, to provide the op amps for gain
circuit. The electrodes used to obtain the biopotentials are 3M Red Dot ECG electrodes,
which are based on a AgCl conductive gel.
Electrode (right arm) + 0 R5
R2 LM348 -12V R6
Electrode (lef t arm) 1k 3 U2A
30K OUT To A-to-D
Electrode (right chest) 0
Figure #4. Schematic of ECG Amplifier Circuit
The total gain involved in the ECG circuit can be calculated using the resistor
GT = GD * GN = (30K / 1K) * ((30K + 1K) / 1K) = 30 * 31 = 930 (3)
The temperature sensor used in the Biotelemetry Unit is a thermistor device,
which scales its output current as (1A / K). This output current is then dropped across
a 1K resistor in order to produce a millivolt signal, which can be further amplified. The
amplifier used is a basic non-inverting amplifier, which provides gain as follows
(I1 * 1000) * ((R1 + R2) / R2) = V3 (4)
Below in Figure #5 is the manufacturer’s graph of the input temperature in C vs.
output current in A. The temperature sensor used is the AD592.
Figure #5. Temperature vs. Iout in AD592
The op amp used in the amplifier was a dual LM747 and the amplifier circuit used
is shown in Figure #6 below. From the resistors used in the amplifier one can calculate
the gain of the amp as
G = ((100K + 10K) / 10K) = 11 (5)
R7 3 U4A
10V 0 10K OUT To A-to-D
AD592 0 2
Figure #6. Schematic of Temperature Sensor Amplifier Circuit
The design of the data conversion and transmission portion of the project consists
of the analog to digital converters, the Basic Stamp 2, the Linx module transmit and
receive pair, the Maxim 232 voltage level conversion chip and the RS-232 serial cable.
The analog output from the sensors was converted to digital output using two National
Semiconductor ADC0831 chips. The clocking and chip select signals were achieved
using the 'shiftin' command for the Basic Stamp 2. This command specifies the data and
clock pins as well as a variable name and number of bits. An eight-bit conversion format
was used, mapping zero to five volts to a three digit decimal value from zero to two
The Basic Stamp 2 also combined the two digital signals for transmission on the
Linx modules at 418 MHz. This combination of signals was achieved by alternating
between the two A/D converter chips in a loop of code that would enable the first chip,
shift in its data and then disable that chip and enable the next, repeating the process for
continuous data acquisition. The Basic Stamp also added delimiters for ease of signal
separation in LabVIEW. The signals were preceded with special characters and output
from the Basic Stamp 2 was formatted as:
[TAB][Signal 1][Carriage Return][Signal 2]
This combined signal was then passed to the transmitter for transmission using a
helical coil antenna. Upon reception, the receiver supplied the combined signal to the
MAX232 chip. The MAX232 chip inverts the signal and converts the voltage level from
5 volts to 12 volts for serial input to the local computer using the RS-232 cable. A wiring
diagram of the RS-232 cable connector was obtained. Data input was supplied to pin
two, pin five was grounded and pins one, four, six, seven, and eight were tied together to
complete the loop for one way transmission of data from the circuit into the computer.
In order to read the data, the Serial Read Virtual Instrument (VI) was used in
LabVIEW. By specifying the port number, and the number of data bytes to be read, one
could properly sample the incoming data from the serial port. The communications port
was arbitrary (COM 2 was chosen in this case). Different amounts of bytes to be read in
were tested, and ten bytes provided the best results. Ten bytes were read in at a time to
sample as quickly as possible without losing necessary information. Losing some
information was tolerable because the frequency of the heart rate was on the order of one
hertz, and the sampling rate, which is 9600 baud per second, was much higher than that.
Also the temperature signal was slowly changing. Thus even if some data was lost, the
frequency of the ECG signal and the temperature could be still calculated in real time for
The output of the Serial Read VI is a string consisting of the sampled data. The
data output from the Serial Read VI appears as follows:
[TAB][Signal 1][Carriage Return][Signal 2][TAB][Signal 1][Carriage Return][Signal 2][TAB] etc…
The brackets are shown to separate the words. They do not actually appear in the data.
Thus the string output from the Serial Read VI is of this form. Match Pattern VI’s were
used to separate Signal 1 and Signal 2 from the data stream. To separate Signal 1, one
Match Pattern VI returned all the elements of the string after the first TAB character.
Thus [Signal 1][Carriage Return][Signal 2] was returned. Another Match Pattern VI was
then cascaded to the diagram, to return the element(s) before the first carriage return.
Thus Signal 1 was returned and could be routed for display on a waveform chart. Signal
2 was separated in a similar way (i.e. returned elements after the first carriage return and
before the first TAB) and routed for display to a waveform chart. Care had to be taken
that there was always an element after and before the delimiters. Reading ten bytes from
the data assured this.
One problem that arose in displaying the data was that the ECG signal could not
be accurately displayed. This problem was due to the analog to digital converters (A/D).
Because the A/D’s would overheat if they sampled to fast, a fifty millisecond pause had
to be inserted into the Basic Stamp program. However, the pulses in the ECG signal that
would indicate a heart contraction were only thirty milliseconds long. Thus the ECG data
could not be sampled correctly and therefore the pulses could not be displayed on
LabVIEW. To resolve this issue, a function generator was used to simulate the heart rate.
Sinusoidal signals of frequencies ranging from one hertz to three hertz were tested
because that corresponds to the range of the heart rate for a human (60 beats per minute
to 180 beats per minute respectively). These signals could be displayed accurately on the
front panel of LabVIEW.
The frequency of the heart rate also needed to be displayed on the front panel.
Because LabVIEW does not work with real world time, calculating the frequency of the
signal was somewhat difficult. To calculate the frequency, the sampling rate had to be
known. Then by determining the number of peaks during a specified interval, the
frequency of the signal could be calculated. Thus by dividing the number of peaks by the
sampling rate for a known period, one could determine the frequency. A program had to
be written to detect the number of peaks. A counter was used that incremented anytime a
threshold was reached, where the threshold was the amplitude of the signal. A data
acquisition card could have been used that would have taken the frequency
measurements, but this would have significantly added to the cost of the system.
The temperature data also had to be converted to degrees Fahrenheit. This was
handled by a simple conversion routine. The formula to convert from degrees Kelvin to
degrees Fahrenheit is
F = [(K – 273) * 1.8] + 32 (6)
The output of the temperature sensor signals is an integer 0 to 255. To map it to a voltage
0 to 5 volts, one needs to divide the temperature input by 51. This was further divided by
11.15 to offset the gain from the amplifier. Finally Equation (6) was applied (subtract
273, multiply by 1.8, add 32) to make the final conversion to degrees Fahrenheit.
The data was then compared to thresholds that can be set by the physician. The
default values for the thresholds are as follows: Upper BPM Threshold is 104, Lower
BPM Threshold is 59, Upper Temperature Threshold is 102, and Lower Temperature
Threshold is 94. The BPM threshold levels are reasonable levels for concern for the
average person. The threshold levels for temperature were chosen based on a moderate
fever and hypothermia. The incoming data was then compared to the threshold levels. If
the data stayed within the normal range, then the data was displayed as usual. However,
if either the heart rate or the temperature exceeded a threshold, a red warning indicator
would light under the abnormal vital sign, and a call for medical attention would be
placed (simulated by a flashing message). Display and monitoring of the vital signs
would continue throughout. This is important because changing conditions of the patient
could also be monitored, and the medical staff would be immediately informed of such
cases. Figure #7 shows the LabVIEW front panel.
Figure #7. LabVIEW front panel
4. DESIGN VERIFICATION
Each sensors output was carefully compared to the actual values of temperature
and heart rate of the patient. The ECG amplifier was tested using DC voltages at set
differences to observe the gain induced by its amplifier circuit. Below in Table #1 one
can see the gain values observed in the sequence of difference amplifier and non-
TABLE #1. ECG AMPLIFIER PERFORMANCE
Va Vb Va - Vb V2 G
4.995 4.994 0.001 0.932 932
4.995 4.993 0.002 1.860 930
4.995 4.992 0.003 2.775 925
4.995 4.991 0.004 3.704 926
4.995 4.990 0.005 4.600 920
These gain values agree within 2% of the calculated gain of the amplifier. With
the amplifier circuit working properly the actual ECG waveform itself could be measured
from the output pin of the non-inverting amplifier. The waveform was measured for a
patient under two circumstances. First a resting measurement of the patient’s
electrocardiogram was made, and the waveform captured for analysis on a digital
oscilloscope. The heart rate of the patient can be deduced from measuring the frequency
of the voltage spikes in the ECG waveform and applying the following formula.
F (beats/sec) * 60 (sec/min) = BPM (beats/min) (7)
The waveform itself can be seen below in Figure #8 with the frequency and peak
to peak voltage measured by the oscilloscope. Note the peak to peak voltage, as it will be
compared to a subsequent waveform.
Figure #8. ECG waveform at rest
The patient also underwent a brief period of exercise after which another ECG
waveform was measured using the same technique as previously mentioned. This second
waveform is shown in Figure #9 and one can see that the patients heart rate has increased
as well as the magnitude of the peak to peak voltage. The BPM of the heart was
compared to a manual measurement made off the patient’s wrist and corresponded within
two BPM of actual value. This error is a result of waveform averaging within the
oscilloscope and to inconsistencies of timing with a manual measurement.
Figure #9. ECG Waveform after Exercise
It is also to be noticed that the peak to peak voltage has increased by about 50%.
This can be attributed to the increase in the strength of the cardiac muscles contractions.
As the patient undergoes physical activity, the body requires a higher blood volume. To
achieve this volume the heart must undergo stronger contractions. From the accuracy of
the BPM calculations one can see that this amplified ECG waveform provides a sound
method for measuring a patients heart rate.
The ambient temperature sensor (AD592) also had its output amplified by a non-
inverting amplifier with a gain previously calculated in Equation (5). This theoretical
gain value was compared to measurements made using a DC input voltage to the
amplifier circuit and observing the output voltage. Table #2 shows this experimental gain
TABLE #2. TEMPERATURE AMPLIFIER GAIN
Va V3 G
0.099 1.107 11.182
0.197 2.207 11.203
0.296 3.300 11.149
0.400 4.400 11.000
0.499 5.490 11.002
0.598 6.590 11.020
0.697 7.680 11.019
0.801 8.840 11.036
0.900 9.940 11.044
0.998 11.020 11.042
Overall the variation in experimental gain deviated 2% from the theoretical value.
The only values of interest were DC input values which would correspond to a patient’s
actual body temperature. This range was to be from 307mV to 314mV which
corresponds to a Fahrenheit temperature of between 94 and 104. At this range the
experimental gain was observed to be 11.15 . This gain value will be used later to
convert the decimal values of the signal produced by the analog to digital converters into
a real valued form.
The overall accuracy of the temperature sensor circuit was tested in comparison to
a commercial thermometer. When measuring room temperature the sensor was within
0.4 F of a thermometer, which is an acceptable error range for testing purposes. Ideally
it would be desired to use a contact temperature sensor with a 0.1 F accuracy, however
one was not available for this project.
In the case of both output signals, ECG and temperature, when converting to a
digital signal the absolute voltages are mapped on a scale of 0-255 decimal values. For
any output voltage from either sensors’ amplifier circuit you can convert to the
corresponding digital decimal value as such
( VO (in Volts) / 5 ) * 255 = decimal value (8)
The data conversion and transmission was tested to ensure accurate processing of
signals. The analog to digital conversion was tested using the Basic Stamp 2 debug
command. A DC voltage was supplied to the A/D converter and the output was observed
in the debug window of the Basic Stamp 2 editor. The voltage level was varied from zero
to five volts and the output was verified using the formula from Equation (8).
It was discovered that without a pause in the Basic Stamp 2 program the clock
signal to the A/D converters was too fast causing them to overheat. Several values for
the pause were tested. If the pause was too long, the input data was unreliable and if the
pause was too short, the A/D chips were unable to function properly. A fifty millisecond
pause was determined to optimize the functionality of our circuit. Testing of the Linx
module transmit and receive pair was performed using a 1 kHz square wave. The square
wave was input to the transmitter as well as displayed on channel one of the oscilloscope.
The output from the receiver was then displayed on channel two of the oscilloscope and
verified to match that of the transmitter. The receiver was tested this way at various
distances with a maximum test distance of approximately thirty feet. Connecting the
oscilloscope to both the input and output of the MAX232 chip, the voltage conversion
was tested for proper input to the computer. The voltage levels were then observed and
verified for inversion, which is necessary for TTL to RS-232 conversion. Figure #10 is
the output of the actual signal from the ECG and temperature sensors after
data conversion and transmission at points before and after the MAX232 chip. It shows
proper operation of the data conversion and transmission portion of the project.
Figure #10. Comparing Waveforms of BS2 Output and MAX232 Output
In order to test if the frequency measurements worked correctly, the LabVIEW
frequency measurement was compared with the output frequency of the function
generator. The frequency was found to compare quite well as shown in Table #3.
TABLE #3. COMPARISON OF BPM FROM FUNCTION GENERATOR
Frequency Function Generator Function Generator BPM LabVIEW BPM
0.50 Hz 30 30
0.75 Hz 45 48
1.00 Hz 60 60
1.25 Hz 75 72
1.50 Hz 90 90
1.75 Hz 105 108
2.00 Hz 120 120
2.25 Hz 135 132
2.50 Hz 150 150
2.75 Hz 165 168
3.00 Hz 180 180
3.25 Hz 195 192
3.50 Hz 210 210
5. Cost Analysis
$30.00/hour * 65 hours * 2.5 = $4875.00 per person
Total labor cost: $4875.00 * 3 = $14625.00
Basic Stamp 2 $ 49.00
Linx transmitter $ 12.00
Linx receiver $ 12.00
ADC0831 (2) $ 2.50
AD592 $ 7.00
3M Red Dot electrodes (25) $ 45.00
LM747 $ 2.00
LM348 $ .50
MAX232 $ 6.25
LabVIEW $ 995.00
Resistors/Capacitors $ 2.00
Serial Cable $ 9.00
9V Battery $ 4.00
Total Parts $ 1,146.25
Total Labor $14,625.00
Grand Total $15,771.25
The Biotelemetry Unit was able to successfully transmit vital signs wirelessly to a
local PC for display and evaluation. This project can be further improved by using a
more accurate temperature sensor, high quality A/D’s, and being packaged so that it is
comfortable to wear. This unit can be manufactured to be a reliable, low cost, compact
unit which can provide an alternative to expensive in-patient monitoring.
 V. Bansal, G. Drzewiecki, and R. Butterfield, “Design of a Flexible Diaphragm
Tonometer,” Proceedings of the Southern Biomedical Engineering Conference 13th,
University of the District of Columbia, April 1994.
 Parallax, Basic Stamp Programming Manual, Version 1.9, Parallax Inc., 1998.
 Webster, John G., Encyclopedia of Medical Devices and Instrumentation. New
York: Wiley, 1988.
 Webster, John G., Medical Instrumentation: Application and Design. 3rd Ed.
Philadelphia: W.B. Saunders Company, 1998.