Professional Documents
Culture Documents
com
Visit us at http://www.sunrom.com
Pin Details
Board has 3-pin connector for using the sensor. Details are marked on PCB as below.
5V level
0V level
LED OFF when no beat detected
LED ON each high level when finger
when finger is not placed on sensor
is placed on sensor
Working
The sensor consists of a super bright red LED
and light detector. The LED needs to be super
bright as the maximum light must pass spread in
finger and detected by detector. Now, when the
heart pumps a pulse of blood through the blood
vessels, the finger becomes slightly more opaque
and so less light reached the detector. With each
heart pulse the detector signal varies. This
variation is converted to electrical pulse. This
signal is amplified and triggered through an
amplifier which outputs +5V logic level signal.
The output signal is also indicated by a LED
which blinks on each heart beat. F IGURE 1 S ENSOR P RINCIPLE
Fig.3 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.
LCD
Enable
Gled
Vled
R/W
Vdd
Vss
RS
D7
D6
D5
D4
D3
D2
D1
D0
VL
VCC
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
U2
40
AT89S52 VCC
39 21
VCC
38 P0.0/AD0 P2.0/A8 22
37 P0.1/AD1 P2.1/A9 23
36 P0.2/AD2 P2.2/A10 24
35 P0.3/AD3 P2.3/A11 25
34 P0.4/AD4 P2.4/A12 26
HEART BEAT SENSOR 33 P0.5/AD5 P2.5/A13 27 PR1
VCC
CN1 32 P0.6/AD6 P2.6/A14 28 50K PRESET
SUNROM #1157 P0.7/AD7 P2.7/A15
OUT 1 10
Display Contrast
2 P1.0/T2 P3.0/RXD 11
+5V VCC
3 P1.1/T2EX P3.1/TXD 12
4 P1.2 P3.2/INT0 13
GND P1.3 P3.3/INT1
5 14
6 P1.4/SS P3.4/T0 15
7 P1.5/MOSI P3.5/T1 16
8 P1.6/MISO P3.6/WR 17
P1.7/SCK P3.7/RD
31
VCC EA/VPP 29
+ PSEN 30
C1 ALE/PROG
10uF 9
XTAL1
XTAL2
RST
GND
R1
10K
20
19
18
Y1
11.0592
C2 C3
33p 33p
The pulse signal is applied to the P1.0 input of U2 that is AT89S52 (Can be any 8051 type) which is
monitored by the program whenever this input goes high. Internally to U2, there is a counter which
counts how many 1ms intervals there are between two high going heart beat pulses. This number is
then divided by 60,000 and the result is the pulse rate. For example, if the pulse rate is 60 BPM
(beats per minute) there will be a pulse every second. The duration of one heart beat will be one
seconds or 1000 x 1ms. Dividing 60,000 by 1000 will give the correct result of 60 which is shown
on the display. If there is invalid result (BPM>200) it is invalid and waits for next cycle.
while(SENSOR==0) //keep looping till signal goes back high, wait for next
{
DelayNmS(1); //wait 1msec
beatms++; //keep incrementing counter each 1ms
}
// beatms variable will now have time in ms between two high edge pulse
lcdClear();
lcdGotoXY(0,0);
lcdPrint("HEART RATE : ");