This is only a preview of the July 2001 issue of Silicon Chip. You can view 31 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "The HeartMate Heart Rate Monitor":
Items relevant to "Do Not Disturb Telephone Timer":
Items relevant to "Pic-Toc - A Simple Digital Alarm Clock":
Items relevant to "A Fast Universal Battery Charger; Pt.2":
Purchase a printed copy of this issue for $10.00. |
HEARTMATE
Build it & keep tabs on your t icker
Got a treadmill or exercise bike to help you keep fit? How do
you know whether you are overdoing it? Build this Heart Rate
Monitor and stop yourself carking it. You can monitor your
pulse beat rate to maintain it within certain limits. There is
a timer to limit the duration of your exercise, minimum and
maximum pulse rate buzzers and a recovery rate display.
By JOHN CLARKE
28 Silicon Chip
Y
EAH, YEAH we know there
are plenty of miniature heart
rate monitors for people who
want to jog but they don’t include all
the handy features of the SILICON CHIP
Heart Rate Monitor. It will display
pulse rates up to 235 beats/minute and
has a number of preset buzzers to help
you in your exercise program.
A Heart Rate Monitor is an essential piece of equipment when you are
exercising as you can maintain your
pulse rate at the desired level.
Fig.1 shows target pulse rates for
people aged between 20 and 70. The
target range is the pulse rate needed in
order to provide suitable exercise for
the heart. For a 25-year old, this range
is about 140-170 beats per minute
while for a 60-year old it is typically
between 115 and 140 beats per minute.
It is important not to overdo it. If you
begin to feel weak and light headed,
stop immediately.
The SILICON CHIP Heart Rate Monitor has an audible buzzer which can
be set to sound if your pulse rate falls
outside the target range that you set.
And having exercised within the target
range for a preset time, a buzzer will
sound to tell you to have a rest.
Feeling completely knackered? The
SILICON CHIP Heart Rate Monitor will
monitor your recovery. This is the time
to recover to your normal resting pulse
rate after the exercise period. If you are
really fit, your recovery time will be
quick and if you are not (like most of
us), it will be a lot slower.
The SILICON CHIP Heart Rate Monitor is housed in a small plastic case
which can be mounted onto the handle
bars of your exercise machine, be it an
exercise bike, treadmill or whatever. It
is powered from a 9-12V DC plugpack
so there are no batteries to go flat. The
3-digit display uses 7-segment LEDs
which are bright and easier to see than
small LCD units.
It has three pushbuttons to control
its operation and a column of LEDs
to indicate the current function or
reading on the display.
The pulse detector is a finger stall
with an inbuilt infrared LED and infrared detector. The finger stall is held
onto your finger with a strip of Velcro
(hook and loop).
The Heart Rate Monitor shows pulse
rates from 26 beats per minute to 235
beats per minute on its 3-digit display.
If your pulse rate is below 26b/m you
are either a lizard or you are dead.
Fig.1: this diagram shows the target pulse rates for people aged between 20
and 70 when undertaking exercise. For a 25-year old, the range is about
140-170 beats per minute, while for a 60-year old, the target range is about
115-140 beats per minute.
Either way, it will be displayed as
“Err” on the display. Actually the most
likely possibility is that the finger-stall
is not properly attached to your
finger.
At the other end of the scale, measured pulse rates above the 235b/m
limit will be displayed as three dashes
(---).
When the heart detector is working
properly, the top-most LED in the LED
column flashes in unison with each
pulse. The 3-digit display is updated
on every second pulse. When the pulse
Main Features
• Ideal for use with exercise
machines
• Adjustable timer with buzzer
• Visible pulse indicator
• Timer end buzzer
• Timer stops below minimum
•
•
•
•
pulse beat rate
Start/stop timer control
Recovery display 1,2,3,4 & 5
minutes
Error display for no pulse
Minimum & maximum pulse
settings for audible buzzer
rate is being displayed, the second LED
in the column is also lit.
A piezo buzzer will momentarily
sound if your pulse rate goes above
or below preset values.
The Timer setting can be displayed
by pressing the rate/timer switch and
this also lights the Timer LED in the
column display.
The SET switch is used to display
the three presets. Press
ing the SET
switch selects the minimum pulse
rate display and lights up the “Rate
min” LED. The minimum pulse rate
value can then be adjusted using the
up and down pushbuttons. The inbuilt
(default) setting is 130b/m. Once a
new value is selected, it is stored in
memory regardless of whether the
power is on or off.
Pressing the SET switch again lets
you set the maximum pulse rate and
also lights the “Rate max” LED. The
inbuilt set
ting is 160b/m. The SET
switch will also display the timer setting and light the Timer LED. Then you
can adjust the setting from one minute
to 255 minutes (4 hours 15 minutes)
in one-minute steps using the up and
down switches. The initial setting is
30 minutes.
To start the timing period, press the
Start/Stop switch when the display
is showing either the pulse rate or
July 2001 29
The circuit is built on two PC boards which are stacked
together inside a standard plastic utility case. Power is
supplied by a 12VDC plugpack.
current timer setting. The timer will
count down from its preset value if
the pulse rate is above the minimum
setting and the LEDs in the column
will begin chasing.
When the buzzer sounds, a LED
will flash to explain the warning. For
example, if your pulse is racing above
the set maximum, the buzzer sounds
and the “Max rate” LED flashes.
Similarly, if there is an error in detecting the pulse, the display will show
“Err” and the “Rate min” LED will
flash. This will stop the exercise timer.
You can start the timer again with the
Stop/Start switch but the timer will
only begin counting down when the
minimum pulse rate has been reached.
The buzzer will also sound when the
timer has counted down to zero.
Recovery mode
At the end of the timer countdown,
the Heart Rate Monitor goes into the
Recovery mode. For the next five
minutes the display will show REC,
then the current timer value, then
REC and the current pulse rate. The
corresponding Pulse Timer LEDs will
be displayed as each reading is shown.
At one-minute intervals, the buzzer
will sound and current heart beat rate
will be stored in memory, referenced
to the current minute. If there is an
error in the reading, then the pulse
value will be zero.
At the beginning of the recovery
30 Silicon Chip
period, the minute display will show
“-0” to indicate that the timer is less
than one minute into the recovery
period. After one minute the display
will show “-1” and then -2, -3, -4 and
-5 at each successive minute.
At the end of the five minutes, the
display changes to show the pulse
rates stored at each minute interval.
The display will show REC, then “-0”
and then the stored pulse rate. It then
shows “-1” and the next stored pulse
rate and so on.
The display will continue to cycle
through these values until either the
unit is switched off or a switch is
pressed. Pressing a switch will return
the unit to the pulse mode.
Circuit description
Now let’s have a look at the circuit
of Fig.2. IC1 is the PIC16F84 microcontroller which is the heart of the
circuit.
Three 7-segment displays DISP1DISP3 and a bargraph LED display
DISP4 are driven directly from the
RB1-RB7 outputs of IC1 via 150Ω limiting resistors. This is a multiplexed
display arrangement with all the “a”
segments on DISP1, DISP2 & DISP3
tied together and the same comment
applies to the “b” segments and the
“c”, “d”, “e”, “f” & “g” segments. The
LEDs within DISP4 are tied to the “b”,
“a”, “f”, “g”, “e” and “d” segments,
respectively.
The LED displays have their common anodes driven by tran
sistors
Q1-Q4 from the RA0, RA1, RA2 and
RA3 lines of IC1.
For example, if RA0 is brought low,
transistor Q1 will be switched on to
apply power to the common anode of
the LEDs in DISP4. At the same time,
a low output on RB1-RB7 will light
the corresponding LED in the display.
After DISP4 has been lit for about
1ms, the RA0 output is taken high
and the RA2 line is brought low to
drive Q2 and display DISP1. The new
7-segment data on the RB1-RB7 lines
is presented to DISP1 for the next 1ms.
Then the RA1 line is brought low to
drive DISP3 and so on.
Note that the “c” segment output
from RB3 also connects to one side of
the piezo transducer while the other
side is driven by transistor Q1 via diode D5. However, the piezo transducer
is driven only when DISP4 is on and
only if the RB3 output is brought low
at this time. If it is driven, it effectively
Fig.2 (right): the circuit is based on
a PIC microcontroller (IC1) which
drives three 7-segment LED displays
and a LED bargraph. IRD1 and RD1
form the infrared pickup – its output
is processed by op amps IC2a-IC2d
and used to drive the RB0 input of IC1
via transistor Q5.
July 2001 31
Fig.3: follow this layout
diagram to build the PC
boards and complete the
wiring. Note the orientation
of switches S1-S3 – they are
all mounted with their flat
side to the left.
Table 2: Capacitor Codes
gets a 1ms pulse every 4ms, an effective frequency of 250Hz.
Diode D5 isolates the transducer
from the circuit if the RB3 line is high
and Q1 is off. The 10kΩ resistor across
the transducer discharges its capacitance between each forward pulse.
The Set, Up and Down switches
(S1-S3) are monitored by the RA4
input. These switches also connect to
the RA2, RA3 & RA1 outputs respec-
tively via diodes D2, D3 & D4. Normally, RA4 is held high via the 10kΩ
resistor connected to the +5V supply.
Depending on whether RA1, RA2 or
RA3 is low when a switch is closed,
IC1 will respond with a programmed
action.
Diodes D2, D3 & D4 are included
to prevent the RA1, RA2 & RA3 lines
from being shorted if more than one
switch is pressed at the same time.
Value
IEC Code EIA Code
0.33µF 334 330n
0.1µF 104 100n
.033µF 333 33n
15pF 15 15p
IC1 runs at 4MHz due to the crystal
(X1) connected to pins 15 & 16. This
frequency is divided by four for the
internal opera
tion of the microprocessor. An internal counter further
divides this by four and then by 250.
The resulting signal drives the dis
Table 1: Resistor Colour Codes
No.
1
7
2
6
1
3
4
1
7
32 Silicon Chip
Value
2.2MΩ
1MΩ
100kΩ
10kΩ
2.2kΩ
1kΩ
680Ω
560Ω
150Ω
4-Band Code (1%)
red red green brown
brown black green brown
brown black yellow brown
brown black orange brown
red red red brown
brown black red brown
blue grey brown brown
green blue brown brown
brown green brown brown
5-Band Code (1%)
red red black yellow brown
brown black black yellow brown
brown black black orange brown
brown black black red brown
red red black brown brown
brown black black brown brown
blue grey black black brown
green blue black black brown
brown green black black brown
The signal processing board is fitted with 15mm tapped spacers and is mounted
in the bottom of the case by clipping it into the integral side slots. The display
PC board is then secured to the tops if the spacers using machine screws.
play multiplexing at 1kHz. Further
division by 1000 provides us with a
pulse once every minute which updates the timer.
The pulse signal is applied to the
RB0 input of IC1 which interrupts
the program whenever this input
goes high. Internally to IC1, there is
a counter which counts how many
2ms intervals there are between two
heart beat pulses. This number is then
divided into 60,000 and the result is
the pulse rate. For example, if the
pulse rate is 60b/m (beats per minute)
there will be a pulse every second. The
duration of two heart beats will be
two seconds or 1000 x 2ms. Dividing
1000 into 60,000 will give the correct
result of 60 which is shown on the
display.
The actual update period for the
pulse display is once every second
heart pulse. So the update is every 2
seconds at 60b/m, once every second
for 120b/m and so on.
Detection of the pulse is via an
optically-coupled pickup using an
infrared LED (IRLED1) and a photo
diode (IRD1). The infrared LED is powered from the +9V supply via a 560Ω
resistor and its light shines into the
flesh of your finger and is reflected off
the bone. The pulsating blood through
the vessels modulates the amount of
light being detected by the infrared
diode IRD1.
Op amp IC2a is connected as a
current-to-voltage converter for IRD1
which exhibits a varying reverse
current in response to the changing
light from the finger. The anode of
IRD1 and the non-inverting input to
IC2a is biassed at +4.5V. Pin 9 is the
inverting input and the cathode of
IRD1 connects to this via a 1kΩ stopper resistor. The gain of IC2a is set by
the 1MΩ resistor between pin 8 and
the cathode of IRD1 while the .033µF
capacitor provides high frequency rolloff above 4.82Hz. This is to attenuate
50Hz mains signals which might otherwise be amplified.
Note that there is also a 2.2MΩ
resistor from the cathode of IRD1 to
ground. This makes IC2a function as
an inverting DC amplifier with a gain
of -0.45 and this causes pin 8 to sit
at about +6.5V. The resulting current
through the 1MΩ resistor to the 2.2MΩ
resistor is enough to provide a very
The piezo transducer is secured to the bottom of the case using machine screws
and nuts, while the DC power socket is mounted on the side. Make sure that
none of the mounting screws can foul the PC board.
July 2001 33
Fig.4: here’s how it all
goes together inside
the plastic case. The
snap-in locators in the
case guides hold the
PC boards in place.
small reverse bias current through
IRD1 and thereby ensure that it works
at maximum sensitivity.
The output of IC2a is AC-coupled
via a 0.33µF capacitor, giving a low
frequency rolloff below 0.48Hz or the
equivalent of 29 beats per minute. IC2b
has a gain of 11, set by the 1MΩ feedback resistor and the 100kΩ resistor
connecting from pin 6 to the +4.5V
rail. The 47µF capacitor provides a
rolloff below .03Hz. The .033µF ca-
pacitor across the 1MΩ resistor gives
the same high frequency rolloff as in
IC2a.
IC2c is almost identical to IC2b
except that it includes a gain control,
VR1. IC2c’s output is AC-coupled to
op amp IC2d which is connected a
Schmitt trigger, by virtue of the positive feedback applied by the 1MΩ
resistor between pins 12 & 14. The
output drives the base of transistor
Q5 via a 10kΩ resistor to provide the
The U-shaped metal bracket on the back of the unit allows it to be attached to
the handlebars of an exercise bike or treadmill.
34 Silicon Chip
pulse signal to pin 6 of IC1.
Power for the circuit comes from
a 9V or 12V DC plugpack via diode
D1 and power switch S4, to feed two
3-terminal regulators.
REG1 produces +5V while REG2
produces +9V. The 9V supply is divided by two series 1kΩ resistors to
give a +4.5V supply to bias the inputs
of IC2.
Construction
The Heart Rate Monitor is constructed on two PC boards. Board 1, coded
04107011 and measuring 105 x 62mm,
contains the displays and microcontroller, IC1. Board 2, coded 04107012
and measuring 105 x 62mm, contains
the amplifier circuitry for the pulse
sensors. The two boards are stacked
together and housed in a plastic case
Fig.5: the mounting clamp details.
It attaches to the base of the case
using two M3 x 20mm screws and
M3 nuts.
Making The Infrared Pickup Sensor
Fig.6 (left): how the infrared pulse
sensor is made. The infrared transmitting and receiving LEDs are fitted
side-by-side into two slots that are
cut into a PVC saddle clamp section.
Below: the pulse sensor assembly is
fitted with a length of Velcro so that it
can be held in position on your finger.
You can use contact adhesive to
secure the Velcro to the PVC section.
measuring 130 x 67 x 44mm. The
full wiring details for both boards are
shown in Fig.3.
Begin construction by checking the
PC boards for shorts between tracks
or any breaks in the copper connections. Compare the patterns with the
published artwork to be sure they are
correct. Check hole sizes. The corner
mounting holes and regula
tor tab
mounting holes should be 3mm in
diameter. The holes for the PC stakes
should be drilled to give a tight fit for
these.
You can work on both PC boards
together. Insert the PC stakes first,
followed by the links and resistors.
Use the resistor colour codes in Table
1 when selecting the resistors and use
a digital multimeter to check each one
before it is installed.
Next, insert and solder in the
diodes, making sure that they are
oriented correctly. Note that D1 is
a 1N4004. The 7-segment displays
July 2001 35
Parts List
1 PC board, code 04107011,
105 x 62mm
1 PC board, code 04107012,
105 x 62mm
1 front panel label, 125 x 63mm
1 plastic case, 130 x 67 x 44mm
1 transparent red Perspex or
Acrylic sheet, 56 x 18mm x
2.5mm
1 DC panel socket (plus self-
tapping screws if required)
1 9V or 12V DC 300mA plugpack
3 snap-action keyboard switches
(S1,S2,S3)
1 miniature SPST rocker switch
(S4)
1 4MHz parallel resonant crystal
(X1)
1 piezo transducer
1 18-pin DIL socket
4 M3 x 15mm tapped standoffs
10 M3 x 6mm screws
2 M3 x 20mm screws
1 M3 x 6mm countersunk screw
6 M3 nuts
2 M2.6 x 15mm screws
2 M2.6 nuts
1 small rubber grommet
1 crimp eyelet with 3mm eyelet
hole
13 PC stakes
1 25.4mm saddle clamp
1 200mm length of 25mm wide
hook and loop tape (Velcro)
1 20mm saddle clamp (used for
conduit)
1 10mm length of 12.5mm diameter heatshrink tubing
1 120mm length of 0.8mm tinned
copper wire
1 50mm length of red medium
duty hookup wire
1 50mm length of black medium
duty hookup wire
are inserted with the decimal point
facing toward the switches. DISP4
should be inserted with the label side
towards IC1. Insert the socket for IC1
with its pin 1 oriented as shown in
Fig.3. IC2 can be soldered directly
into the PC board.
Now insert the capacitors. The
electrolytic types must be oriented
correctly with the positive side
placed as shown on the overlay diagram and with each one laid over on
36 Silicon Chip
1 50mm length of green medium
duty hookup wire
1 800mm length of single core
screened cable (small diameter
type)
1 100kΩ horizontal trimpot (VR1)
Semiconductors
1 PIC16F84P microprocessor
programmed with HEART.HEX
(IC1)
1 TL074 quad op amp (IC2)
3 LTS542A 7-segment common
anode red displays (DISP1DISP3)
1 DIL 10-LED (red) bargraph
(DISP4)
1 photo interrupter for IRLED1
(Jaycar Cat. Z-1901 or equivalent)
1 IR photo-diode BP104, BP104,
(IRD1)
1 7805 5V 1A regulator (REG1)
1 7809 9V 1A regulator (REG2)
4 BC328 PNP transistors (Q1-Q4)
1 BC338 NPN transistor (Q5)
1 1N4004 1A diode (D1)
4 1N914, 1N4148 switching diodes (D2-D5)
Capacitors
1 100µF 16VW PC electrolytic
2 47µF 16VW PC electrolytic
5 10µF 16VW PC electrolytic
3 0.33µF MKT polyester
2 0.1µF MKT polyester
3 .033µF MKT polyester
2 15pF NP0 ceramic
Resistors (0.25W, 1%)
1 2.2MΩ
3 1kΩ
7 1MΩ
4 680Ω
2 100kΩ
1 560Ω
6 10kΩ
7 150Ω
1 2.2kΩ
its side, as shown in the photographs,
to allow the PC boards to be stacked.
For the same reason, the crystal is
placed on its side and is secured at
its free end using a short length of
tinned copper wire soldered to the
PC board.
When inserting the pushbutton
switches make sure that the flat sides
are oriented as shown. The four transistors Q1-Q4 should be inserted so
that their tops are level with the top
of the displays. Q5 is the BC338 and
it does not need to be inserted so far
into the PC board. REG1 & REG2 are
mounted horizontally and the tabs are
secured with an M3 screw and nut.
The boards stack together as shown
in Fig.4, with 15mm tapped spacers
and M3 x 6mm screws. The integral
side slots in the case must be cut away
for the first 13mm to allow the assem
bly to slide into place.
Drill a hole in the end of the case
for the DC power socket and drill
another hole at the other end for the
rubber grommet required for the pulse
sensor leads.
Use the front panel artwork as a
guide to drilling the holes for the
switches and to make the display
cutout. The cutout is drilled and filed
so that the red Perspex or Acrylic
window is a tight fit. Attach the front
panel label and cut out the holes in
this with a sharp knife.
Drill two holes to mount the piezo
transducer on the base of the case
and drill a central hole for the sound
to escape.
The details of the mounting clamp
are shown in Fig.5. It attaches to the
base of the case with two M3 x 20mm
screws and M3 nuts, as shown in
Fig.4.
Sensor details
Fig.6 shows how the pulse sensor is made. A section is cut from a
20mm PVC conduit saddle clamp
and two slots cut into it install the IR
sensors. The IRLED is taken from the
IR interrupter assembly by carefully
breaking the plastic housing in which
the LED is secured. The IR LED is
the one which has the diode symbol
embossed on the top of the plastic
housing. You can break the housing
carefully with pliers and side cutters
to release the LED.
We do not use the detector within
the housing since this is a photo transistor and is not suitable for detecting
the small light changes involved.
Cut the saddle clamp as shown in
Fig.6 and mark, drill and file the rectangular slots for IRLED1 and IRD1.
IRD1 should be able to pass through
the hole so it is flush with the inside
surface of the saddle clamp. The IRLED
is best positioned so the rear face of
the package is flush with the outside
of the clamp.
We used an eyelet as a cable clamp
for the wires and this is attached with
The pulse sensor should be wrapped
firmly around your finger, to ensure a
reliable pickup. Note that the
sensor should go over the fleshy part
of the finger, not over the bone as
some bonehead has shown here.
a countersunk screw which taps into
the PVC material. Wires can be soldered to the IRD1 and IRLED1 leads
after passing them through the eyelet
crimp end. We used some spaghetti
sleeving to protect the wires from the
clamp. The leads are then secured in
place with a 10mm length of 12.5mm
diameter heatshrink tubing.
Testing
Connect the DC plugpack to the
socket and check that there is a nominal 5V between pins 5 and 14 of the
socket for IC1. There should also be 9V
between pins 4 and 11 of IC2. If these
voltages are correct, kill the power and
insert IC1 into its socket. Make sure
it is in the correct way. Apply power
again and check that the display lights
and the pulse rate LED lights. The
pulse LED should flash on and off if
you rapidly move your finger onto and
off the sensor assembly.
Placing the end of your finger over
the sensor should make the pulse LED
flash on and off (in time with your
pulse) and a plus rate should be shown
by the display. You may need to adjust
VR1 to obtain sufficient sensitivity or
it may need to be turned back for best
results. Too much sensitivity can make
the display show a higher figure than
it should.
You can set the minimum and maximum pulse rates using the graph of
Fig.1 as a guide. The timer is set by
selecting timer and adjusting the minutes displayed. Setting the timer to 60
will provide a timeout after 1 hour. You
cannot set the timer to a value that’s
less than 1 minute.
Fig.7: here are the full-size etching patterns for the two PC boards.
When the start switch is pressed,
the value in the set timer will be transferred to the timer and it will begin
counting down every minute.
The three lower display LEDs in
the bargraph should chase each other
when the timer is counting down
unless your pulse heart beat is above
or below the preset maximum and
minimum figures.
You will need to make a finger stall
with Velcro to hold the pulse sensor
securely onto your finger while you
SC
exercise.
Fig.8: this full-size front panel artwork can be used as a drilling template.
July 2001 37
|