Al Khawarizmi Engineering Journal Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal, Vol. 5, No. 3, PP 23 - 27 (2009) Low Cost Heart Rate Monitor Using Led-Led Sensor Ahmed Mahrous Ragib Department of Mechatronics Engineering/ Al-Khwarizmi College of Engineering/ University of Baghdad Email: amrk1978@yahoo.com (Received 27 January 2009; accepted 1 July 2009) Abstract A high sensitivity, low power and low cost sensor has been developed for photoplethysmography (PPG) measurement. The PPG principle was applied to follow the dilatation and contraction of skin blood vessels during the cardiac cycle. A standard light emitting diodes (LEDs) has been used as a light emitter and detector, and in order to reduce the space, cost and power, the classical analogue-to-digital converters (ADCs) replaced by the pulse-based signal conversion techniques. A general purpose microcontroller has been used for the implementation of measurement protocol. The proposed approach leads to better spectral sensitivity, increased resolution, reduction in cost, dimensions and power consumption. The basic sensing configuration presented is capable of detecting the PPG signal from a finger or toe, and it is very simple to extract the heart rate and heart rate variability from such a signal. Keywords: photoplethysmography (PPG), heart rate, light emitting diode 1. Introduction Photoplethysmography is a combination of the Greek word, ‗plethysmos‘ meaning increase and ‗graph‘ is the word for write. It is an instrument used mainly to determine and register the variations in blood volume or blood flow in the body. It is based on the determination of optical properties of vascular tissue using a light source and photo detector (PD). The emitted light is reflected, absorbed or scattered by the blood and tissues and the resultant emerging mojdulated light is measured using a suitable PD. There are two different modes of detection: a transmission mode and a reflection mode. Transmission mode, where the light source is on one side of the tissue and the detector on the other, is limited to areas such as the finger, earlobe or toe. However, reflection mode, where the light source and PD are placed in parallel, allows measurement of backscattered light virtually on any skin area. The intensity of the light reaching the PD is measured and the variations are amplified, filtered and recorded as a voltage signal—PPG. Variations in the intensity of detected light are caused by blood volume changes underneath the probe.[1] The PPG signal has two components: a dc component, which is a relatively constant voltage, but changes in magnitude depending on the nature of the tissue through which the light passes (skin, cartilage, venous blood, etc) and an ac or pulsatile component synchronous with heart rate (HR) and related to arterial blood volume. The ac pulse shapes are indicative of vessel compliance and cardiac performance and the amplitude is usually 1 to 2% of the dc value. A normal PPG probe consists of an LED– photodiode configuration, where LEDs are light emitters and photodiodes (usually p-type, intrinsic, n-type diode (PIN)) are PDs. In addition to the detector, good quality operational amplifiers and mid to high resolution analogue-to- digital converters (ADCs) are required. These other components not only increase system complexity and cost, but also size and power dissipation, all-important factors in miniature, battery-powered systems. The photodiode detectors are also not ideal as they are not spectrally selective and indiscriminately detect Ahmed Mahrous Ragib Al-Khwarizmi Engineering Journal, Vol. 5, No. 3, PP 23 -27 (2009) 24 wide spectrum light ranging from near infrared to UV. Hence, we have developed an LED–LED- based PPG sensor requiring only a simple microcontroller and a pair of LEDs. One of the LEDs is driven in reverse bias mode to function as a light detector. This is a short reverse biasing step (100–200 μs) to the supply voltage (3.3 or 5V) and the only power draw associated with the detector itself. It is possible to make a very accurate measurement of the LEDs‘ photocurrent (about 10–100 times smaller than the PIN‘s) by using a simple built-in timer circuit and the capabilities of the Hi-Z input state of the microcontroller port. The time it takes for the photocurrent generated on the detector LED to discharge its capacitance from logic ‗1‘ to logic ‗0‘ is measured. Additionally, the receiving LED operates as a band-pass filter; this leads to a response similar to its emission spectral profile, significantly reducing ambient noise. Therefore, the proposed system provides a simple, low cost, battery-powered sensing platform with very good sensitivity and signal-to-noise characteristics.[2] Fig.1. A Schematic of the Basic PPG Sensor Configuration. 2. Material and HR Measuring Approach The sensing technique proposed in this paper is digital and based on the voltage to pulse duration conversion, eliminating the need for relatively expensive, high-resolution ADCs and analogue amplifiers. In its HR detector form, it uses a simple circuit shown in figure 1. The two standard LEDs (usually IR) are connected to the I/O pins of a general-purpose microcontroller. The emitter LED is driven directly from output pin P1. The receiver PD is connected to pin P2, which can operate in output or input mode depending on I/O DIR. Figure 2 illustrates the sensing principle by algorithmic steps ‗Trans.‘ and ‗Rec‘ (see figure 2(a)). During ‗Trans‘ the emitter diode is switched on (see figure 2(b)) and the receiver diode is immediately (within 100–200 μs) charged to +5 V. This charge is sustained by the inherent capacitance of the diode (typically Cr = 10–15 pF). Pin P2 is then switched into the high- impedance (Hi-Z) state (approximately 10 15 ), ‗Rec‘. Fig.2. (a) Algorithmic Steps, (b) LED’s Biasing Process and, (c) Equivalent Circuits. This decreases the leakage current iL through the pin P2 down to 0.002 pA. This leakage current is insignificant compared with the typical photocurrent of 50 pA through the diode itself, in normal ambient laboratory lighting when the emitting LED is off. Figure 2(c) shows electrical models of the diode circuit for direct and reverse biasing. Under reverse bias conditions, a simple model for PD is a capacitor in parallel with a current source iR ), which models the optically induced photocurrent for incoming light intensity. The process of LED discharging, supposing that iR) has a constant value, can be expressed as Equation (1) shows that vP2(t) linearly decreases by time t to zero. [3] Using a software timing routine (see figure 2(a)), based on a 16 bits microcontroller timer/counter (TCNT), the voltage vP2(t) is continually polled through its digital equivalent, the logic state of the input pin P2 (see figure 1), until the logic ‗0‘ threshold VTR (~2.2 V) is Bone LED PD Finger +5 P1 P2 LED PD Microcontroller Trans: Rec: (a) (b) (c) )1...(. )( )( 1 0 2    t R RP t Cr i Vccdtti Cr Vccv Ahmed Mahrous Ragib Al-Khwarizmi Engineering Journal, Vol. 5, No. 3, PP 23 -27 (2009) 25 reached. The decay time (Td) is proportional to the amount of light detected; hence, it measures the diode photocurrent iR(). Td is calculated as where NTCNT represents the integer number of timer‘s counts, ftclk is the timer‘s clock, Np is the pre-scale factor (1/2, 1/8, 1/64, 1/256, 1/1024) and fclk is the main clock frequency. Td decreases when the amount of light received increases, and the diode discharges more rapidly, and therefore, when the amount of light received decreases the diode discharges more slowly and Td increases. By measuring Td with the emitter LED on and off, the differential can be ascertained and compensation made for the effects of ambient lighting. The measurement of Td depends on ftclk and could be adjusted by the general microcontroller clock depending on the choice of Np. In order to verify the response characteristics of the light receiver LED, a simple experiment was performed, the results of which can be seen in figure 3. An obstacle in the form of a metal plate is linearly dislocated from the IR–IR reflective sensor configuration, the tracevP2(t)and Tds are recorded for different distances (d). Figure 3(a) illustrates vP2(t) for three distances; these correspond to three reflected light levels 1,2 and  3 ( 1 <  2 <  3), whilst figure 3(b) gives the dependence Td = f (d) as its second- order polynomial approximation. Consequently, it can be seen that the experimental results follow equation (2). Additionally, the presented measurement principle could be effectively used as a simple LED–LED distance meter. [4] In the case of human finger or toe, due to the configuration of the light paths, the photocurrent is proportional to the volume and fluctuations of blood inside the finger or lobe. It is in the range of 10 −12 A (1 pA) in total darkness to about 10 −6 A (1μA) under maximal reflectance. Fig.3. (a) Discharging Processes for Different 1, With Corresponding Decay Times Tdi and (b) Td as a Function of d for Reflective Sensor Configuration. 3. Results and Discussion The proposed PPG sensor has been tested in its HR configuration. The heart signal acquired using PPG sensing probe comprised an IR (910 nm)–IR (910 nm) 5 mm LED (Near-infrared 710nm- 1400nm) combination and the signal was collected in reflectance mode from a finger or toe. An 8 bits AVR RISC ATtiny90S2313 microcontroller (ATMEL corporation) running at 8 MHz and 16 MHz was used and a 16 bits timer counter (Np = 1), allowing the resolution of 0.125 μs (8 MHz), measured the decay time (Td). Data were collected via an RS232 link between the microcontroller and the PC. Visual Basic and interface card were designed for the importing, post-processing and displaying of data. This combination had the ability to implement filtering, fast Fourier transform (FFT), time–frequency analysis and statistical analysis.  2... 1 1 )( )( clkp TCNT tclk TCNT clkTCNTTR R d fN N f T TNVVcc i Cr T      Fig. 3a. Fig. 3b. Ahmed Mahrous Ragib Al-Khwarizmi Engineering Journal, Vol. 5, No. 3, PP 23 -27 (2009) 26 Fig.4. (a) The Original PPG Signal from the Sensor, (b) The Filtered PPG Signal, (c) The FFT of the PPG Signal with Time, (d) The FFT of the PPG Signal with Frequency. Figure 4(a) shows the original PPG signal obtained by IR–IR combination with the processor clock set at 8 MHz (fclk = ftclk = 8 MHz). The signals received contain large dc components or offsets, superimposed with ac characteristics (between 0.1 and 1% of the dc level), which reflect the pulsatile component and can be used to calculate SpO2 (SpO2 Is a measurement of the amount of oxygen attached to the haemoglobin cell in the circulatory system. Put simpler it is the amount of oxygen being carried by the red blood cell in the blood. SpO2 Is given in as a percentage, normal is around 96%. The "S" stands for saturation.). The filtered ac component obtained by a third-order low-pass Butterworth filter with normalized border frequency ωn = 0.1 is shown in figure 4(b). The Fourier spectrum of the ac component is shown in figure 4(c) and the time corresponding to HR. The HR can be calculated by inversing the time for peak component which occur at t=0.016s, which result to HR= (1/0.016)=62.5 beats/min. The Fourier spectrum of the ac component is shown in figure 4(d) and the frequencies corresponding to HR is 62.5 beats/min is indicated. 4. Conclusion We have demonstrated that LED–LED-based PPG sensors in conjunction with the ability to measure the light-induced voltage decay time of the detector LED are useful while measuring PPG signals. This optical sensing approach uses very low cost optical and electronic components and is simple to construct and the device costs is only 7 USD. The proposed pulse-duration-based signal conversion technique gives good sensitivity as well as excellent signal-to-noise characteristics and low power consumption since it consumes only 3 mwatts. The results was compared with ordinary heart rate monitor, and it shows that the results was with accuracy of +1%. 5. References [1] B. S. Kim and S. K. Yoo, "Motion artifact reduction in photoplethysmography using independent component analysis," IEEE Trans Biomed Eng, vol. 53, pp. 566-8, 2006. [2] Miyazaki E, Itami S and Araki T 1998 Using a light-emitting diode as a high-speed, wavelength selective photo detector Rev. Sci. Instrum. 69 3751–4 [3] Asada, H, Shaltis P, Reisner A, Rhee S, Hutchinson RC., ―Wearable PPG- BioSensors‖, IEEE Engineering in Medicine and Biology Magazine, Vol.22, No.3, pp. 28- 40, 2003. [4] A.B. Hertzman, ―Photoelectric Plethysmo- graph of the fingers and toes in man,‖ Proc. Soc. Exp. Biol. Med., vol. 37, pp. 529, 1937. 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Time(s) Fig. 4a. 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Time(s) Fig. 4b. Frequency (Hz) Fig. 4d. Frequency (KHz) Fig. 4c. 0 Fs/2=4KHz Fs=8KHz 27 -23، صفحة 3، العذد 5مجلة الخىارزمي الهنذسية المجلذ احمذ محروس راغب 2009 27 مراقب عذد دقات القلب واطئ الكلفة باستخذام متحسس الثنائي الباعث للضىء احمذ محروس راغب جايعت بغذاد/ كهٍت انهُذطت انخىارسيً/ قظى هُذطت انًٍكاتزوٍَكض amrk1978@yahoo.com : انبزٌذ اإلنكتزوًَ الخالصة تى تطىٌز يتحظض قهٍم اطتهالكه نهقذرة وعانً انحظاطٍت وقهٍم انتكهفت الطتخذايه فً انجهاس انذي ٌزاقب عذد دقاث انقهب عٍ طزٌق يزاقبت جزٌاٌ انذو اطتخذو انثُائً انباعث نهضىء كًشع نهضىء وككاشف، . طبق نٍتبع ارتخاء واَقباض األوعٍت انذيىٌت خالل انذورة انقهبٍت (بً بً جً)يبذأ انـ . (بً بً جً) ونغزض تقهٍم انحٍش وانتكهفت وانقذرة انًظتههكت فقذ تى اطتبذال يحىل اإلشارة انتًاثهٍت إنى انزقًٍت انتقهٍذي تى اطتبذانه بتقٍُت تحىٌم اإلشارة باالعتًاد عهى أدث انطزٌقت انًقتزحت إنى تحظض اكبز، سٌادة فً انذقت، تقهٍم فً انكهفت، وكذنك األبعاد . يعانج دقٍق يتعذد االطتخذاياث قذ اطتخذو نهتُفٍذ وانقٍاص. انُبضت . يٍ اإلبهاو نهٍذ وانقذو وإٌجاد يعذل دقاث انقهب وتغٍزاته بصىرة طههت جذا (بً بً جً)انتزاكٍب انًقذيت قادرة عهى كشف إشارة انـ . وانقذرة انًظتههكت mailto:amrk1978@yahoo.com������