MEASURING HEART RATE USING A PHOTOPLETHYSMOGRAPHIC CARDIOTACHOMETER using pic-microcontroller
The heart rate is an important measure of health and physical fitness. Medical professionals rely heavily on the rate as a measure of health status and use it to prescribe treatment to individuals. Athletes value the heart rate highly as a tool for regulating frequency and intensity of workouts because the rate provides a quantification of exercise intensity. By looking at the rate, athletes can tailor their workouts to a heart rate target and receive quick feedback. Instant feedback is highly desired for these individuals, and fortunately simple devices can provide that to them.
A plethysmograph is a device that measures the amount of blood in a particular part of the body. A photoplethysmograph performs the task optically by measuring the variation of the amount of light passing through a part of the bodyin our case, a finger caused by the pulsatile nature of blood flow. This measurement allowed us to determine the heart rate by looking at the period of the blood flow.
A simple block diagram of the photoplethysmograph system we designed is shown below courtesy of Erik Cheever.
The finger is placed into a box with a red LED on one side and a Cadmium Sulfide (CdS) cell on the other side. The resistance of the CdS cell varies with the intensity of the light hitting it, and this intensity depends on the amount of blood in the finger. The change in the resistance is transduced into a change in voltage, and in its raw form gives a voltage range of 0 to 2.5 volts. We want to measure the variation in this
signal caused by the pulsatility of blood flow in the finger. By carefully examining the raw signal on an oscilloscope, we found that this variation is at most 10mV. This signal must be amplified into a 0-5 V range to take advantage of the full range of the A/D converter. The raw signal also
includes a great deal of noise which must be filtered out. After being converted to digital, the signal is analyzed using the PIC microcontroller, and the output is displayed on a 10-LED ladder. In one mode, the LEDs are set up to all light up when the CdS detects little light from having most of it blocked by the blood flow, and all turn off when encountering much light, corresponding to no fluid. In the second mode, the heart rate in beats per minute (bpm) is calculated from the period of the signal and different LEDs are lighted to indicate the bpm range in which the heart rate falls.
In this section, we have provided an overview of our project. In the following sections, we discuss our design process in greater depth and present our results.
Transduction, Amplification, and Filtration
Single supply design (Vcc = 5V) was required to power the circuit components.
The CdS cell changes resistance in response to the amount of light it receives. To work with this signal requires that it be transduced into a voltage. The CdS cell was placed in series with a 47 kOhm resistor, and the signal was taken between them. The signal then ranged from 0 to Vcc/2 or 2.5 volts as the CdS resistance varied.
We chose the inverting configuration of a TLCV2772 (manufactured by Texas Instruments) rail-to-rail operational amplifier as it is common to use this kind in single supply design. These amplifiers can output voltages quite near the power supply voltage or “rail.” And since we wanted to measure the changes of the 2.5 voltage signal due to the blood flow, we needed to amplify the changes rather than the entire signal. We also needed the signal in the 0-5V range after amplification, rather than being centered around 0V. A virtual ground was employed to achieve this by amplifying the changes with respect to the Vcc/2 volts. A TLE2426 rail-splitter (also from Texas Instruments) was used and attached to the positive terminal of the op-amp to function as a virtual ground. Below is a diagram of the design constructed so far.
Notice that the inverting configuration was chosen because it can easily be modified to also act as a filter as we shall soon see. A secondary gain stage was implemented using the same configuration to invert the inverted signal from the primary gain stage.
The gain of an inverting amplifier is equal to -Rf/Ri where Rf is the feedback resistance and Ri is the input resistance. Because the gain stages will function with the filtering, we will consider the gain in the next section.
Once again, the signal we want to end up with consisted of tiny variations (changes in light intensity due to blood flow into and out of the finger), superimposed on a large constant signal (average light flowing through finger). Recall that we only want the time varying part of the signal amplified, and if we were to amplify the raw signal, the DC (constant) part of the signal would saturate the amplifier before obtaining desired amplification of the AC (time varying) part.
To get rid of the DC signal we used a high-pass filter because DC signals are extremely low frequency. We had to be careful, however, not to attenuate the pulse signal, which is usually about 1 Hz (equivalent to one heart beat per second). High frequency noise was a concern as well with most of it coming from the 120 Hz signal of the light fixture (due to positive and negative portions of the 60 Hz power noise). Considering these requirements, a band-pass filter with a frequency band from .5 Hertz to 10 Hertz was chosen. We decided that a second-order simple band-pass filter, which could be implemented by modifying the amplifier design, would be sufficient. A capacitor in series with the input resistance constitutes a high-pass filter, and one in parallel with the feedback resistance constitutes a low-pass. RC values were selectively chosen to set not only the pass-band frequencies, but also the gains as described below.
Gain and Filter Considerations
From looking at the oscilloscope, the amplitude of the AC part of the raw signal was difficult to read. We proceeded to build the first gain stage with the filter built into it having a theoretical gain of 50. We decided to implement the filter in the first stage of the gain with appropriate low and high cutoff frequencies, which was obtained by the following transfer function.
For more detail: MEASURING HEART RATE USING A PHOTOPLETHYSMOGRAPHIC CARDIOTACHOMETER
We recommend EasyEDA for electronic circuit design.
From Schematic Drawing to PCB Production, Just Need One Tool
Cheap PCB Prototype: 10 pcs 2 layers only $10, quick delivery, 100% E-test
Current Project / Post can also be found using:
- microcontroller based project related to medical application