Heart rate monitor using a programmable SoC
This article gives a glimpse of what a heart rate monitor is and why it’s needed. Next, the design considerations of a simple hand held heart rate monitor are discussed. Finally, it is shown how to implement it using a single programmable system-on-chip (PSoC).
What is a heart rate monitor?
A heart rate monitor is a device used to monitor the rate of heart-beat for human beings. The heart rate is expressed in units of number of beats per minute (BPM). The heart rate of a human body varies depending on daily physical activities, sleep, and general health.
Heart rate monitors are typically used in fitness equipment and in certain hospital equipment to diagnose cardiovascular diseases like tachycardia and arrhythmia. Many OEMs are now moving towards smartphone-connected and handheld/wearable health-related monitoring products.
Need for a heart rate monitor in fitness equipment
Keeping track of the heart rate during physical exercises enables people to ensure the safety of their fitness program. The normal heart rate for a person during rest is 60-100 BPM. However, the rate increases when the person does physical activity. The maximum allowable heart rate depends on the person’s age and decreases as the age of the person increases. Another good reason to record one’s heart rate during exercising is to gauge the progress of their health.
Many users also want to know how many calories they have burned throughout the day. Most fitness machines used in a gym have a built-in heart rate monitor along with a calorie counter. However, people who prefer jogging or walking instead of a machine assisted workout need portable equipment in hand to monitor their heart rate.
Behavior of blood flow during a heart beat
The contraction and relaxation of cardiac muscles causes blood to flow in and out of the heart. During each cardiac cycle, a group of tissues in the heart called the sinoatrial node generates electrical impulses that spread through the heart and cause rhythmic contraction and relaxation of heart muscles. During each cardiac cycle, the blood vessels pulsate in order to carry blood to/from different parts of the human body.
The general places used to measure heart rate are inside the elbow, ventral part of wrist, neck, behind the knee (popliteal artery) and chest (where a stethoscope is usually used). Heart rate monitoring machines are designed so as to measure the heart beat at these spots. However, these machines turn out to be bulky and difficult to carry as the methodology used to monitor the heart rate at these spots involves a complex process. On the other hand, the heartbeat may also be palpated in any place such as tip of the finger or the bottom of the ear lobe. This provides flexibility in bringing out portable heart rate monitors.
Counting calories based on heart rate
The calorie count burned during a workout depends upon the average heart rate, and workout duration. The other terms used in calorie computations are constant. Hence, the portable heart rate monitor can also have the feature of displaying the calories burned.
The following equations provide details on how to calculate the calories burned depending on the heart rate.
Calories Burned for Men (kCal) =
[(Age in years • 0.202) + (Weight in kg • 0.199) + (BPM • 0.631) – 55.1] • Duration in minutes / 4.18
Calories Burned for Women (kCal) =
[(Age in years • 0.074) + (Weight in kg • 0.126) + (BPM • 0.447) – 20.4] • Duration in minutes / 4.18
The person’s age and weight are manually entered into the machine before it can begin this computation.
Photoplethysmography technique in heart rate monitoring
Depending on the heartbeat rate, the volume of blood flowing through the fingertip or earlobe varies. Hence we need some mechanism to detect the change in the volume of blood so as to determine the rate at which the heart is beating.
One of the most common methods to monitor heart rate is to use an optical transceiver that contains a built-in IR transmitter and receiver. When light radiation such as infrared is passed through a blood vessel in a finger or earlobe, the received light signal is periodic and varies due to the rhythmic flow and absorption properties of blood. (In general, human blood tends to reflect IR waves incident on it.) This methodology is known as Photoplethysmography.
Photoplethysmography is of two types – transmission and reflection – using IR waves based on the place from which the light sensed.
Type-I: IR reflection method
Many IR transceiver chips with an IR LED and photo-diode/photo-transistor are available in the market specifically designed for heart rate monitoring systems, where the conduction of the photodetector varies depending on the amount of light reflected back on it.
Let us assume that the IR LED is excited by a constant source. When the blood volume at the position where the IR transceiver is placed changes, the amount of light reflected back also changes. The change in output of this optical transceiver translates the heartbeat into the electrical domain, which then has to go through a signal conditioning process. Finally, digital logic is needed so as to count the number of pulses per minute.
Figure 1 IR reflection method
Type-II: IR transmission method
The IR reflection method is often the best one to choose when a finger tip is chosen as the source of heartbeat measurement. However, it is tough to place a similar device on the earlobe. In this case, one side of an earlobe clip contains the IR LED, while the other side of the clip contains the photodetector. When the blood volume increases, the amount of light received by the photo-transistor decreases (i.e., the reverse behavior of the reflection method).
Figure 2 IR transmission method
- The IR transmitter consists of a cleanly powered IR LED.
- The IR receiver comprises a phototransistor whose base to emitter voltage (Vbe) changes depending on the light falling on it. To detect a change in Vbe, the collector of the phototransistor is pulled to 5V through a resistor.
Figure 3 IR transmitter/ receiver
- Since the change in the IR receiver output per change in volume of blood flow is very small (on the order of 50-70µV, depending upon the diode-transistor pair used), there is a need to amplify the signal so as to bring it up to a measurable voltage range. Hence the amplifier gain has to be on the order of 50,000 to bring the voltage into a measurable range.
- There are many possible noise sources to be considered when designing such equipment, a few of which are: measurement (or body contact) noise, electromyogram (EMG) noise (muscle contraction), and movement artefacts (common while doing physical activities). These noises from high frequency sources have to be eliminated using a 1st or 2nd-order low-pass filter.
- Obtaining a gain of 50,000 typically requires cascading two amplifiers (e.g., of gains 250 and 200). Thus two op-amps can be used to design a 2nd order low-pass filter with an overall gain of 50,000.
Finally, to generate a square wave train so as to count the number of pulses, we need to feed the output of the two-stage amplifier to a comparator with a suitable threshold. Note that the threshold depends on the IR transmitter and receiver used.
Now, the comparator generates a series of pulses of the same period as our heart beat. We need to feed this output to a digital block or an MCU (microcontroller unit) to count the number of pulses per minute and thus display the resultant output on an LCD. Also, the MCU has to store personal data like height and weight to be able to perform calories-burned calculations.
From the above description, we see that we need:
- Heart rate sensor (IR diode and photo-transistor pair)
- Three external op-amps: two in the filtering and amplifying stage, and one as a comparator
- One MCU to count the heartbeat rate, calculate the calories burned, and control the display unit. If the MCU cannot directly drive the LCD, an external chip will be required
- One LCD to display the heart rate and the calories burned.
To reduce component count, a single low-cost programmable system on chip such as the PSoC 4 from Cypress can replace the op-amps needed in this application as well as the MCU and LCD interface. Featuring the low-power ARM Cortex-M0 core, combined with programmable mixed-signal hardware, this chip provides a flexible and scalable low-power mixed-signal architecture capable of meeting the analog I/O, signal processing, and real-time computational requirements of this type of application.
Figure 4 shows how a heart rate monitor of both types can be implemented. For the two-stage amplifier and filter, dedicated op-amps are available. Since the input voltage range is limited to 0 to Vdda (Analog supply; say 5V), the negative voltage input gets clipped, and only the positive waveform goes through the amplification and filtering stage. The output of the phototransistor is passed through a HPF (High Pass Filter) with a cutoff of 0.7Hz to remove DC fluctuation. The output voltage of the analog signal conditioning blocks would be of the range 0 to 1.75V (35µV x 50,000 gain = 1.75V).
Figure 4 Circuit diagram of a heart rate monitor (screenshot from PSoC Creator)
The output of the amplifier stage has to be fed to a comparator to generate a train of square wave signals whose frequency is proportional to the heartbeat rate. Dedicated comparator blocks perform this operation. A highly accurate 1.024V reference is used for the ADC (Analog to Digital Converter). This same voltage source can be fed to the negative terminal of the comparator block.
The pulses coming out of the comparator block can be fed into a counter block (dedicated TCPWM block in PSoC 4) to count the number of pulses occurring per minute. Once the heartbeat is calculated, the internal ARM Cortex M0 core can be used to compute the calories burned. The system can flexibly display the heart rate as well as the calories burned through a dedicated segment LCD block which can operate in either “Digital Correlation mode” or in normal “PWM mode”.
Calorie computations involve entering parameters like age and weight. In the past, machines used mechanical buttons that the user pressed to increment/ decrement the age and weight value being displayed on the LCD. Today, most consumers prefer using capacitive sensing touch buttons in the place of mechanical buttons. Capacitive buttons can also be included to start and stop the calorie computation & heart rate monitoring. Capacitive sensing (PSoC CapSense) can supports as many as 35 buttons with high range proximity sensing, water tolerant operation, low power consumption, high scan speed, and high SNR (Signal to Noise ratio).
Power is also a critical design consideration for heart rate monitors. The programmable system on chip must provide low power feasibility and put the system to sleep when it is not performing any operations. Useful power mode options include active, sleep, deep sleep, hibernate, and stop modes, to balance responsiveness with power efficiency.
Since a heartbeat occurs at only one to four times per second, we can put the system into sleep once it finishes computing the calories and beat-rate. The comparator’s output acts as a wake-up source, and hence, all these computations can be performed once the device wakes up from sleep. When the computation is complete, the device can again be put back to sleep. Segment LCD components in PSoC 4 have the feature of driving the segment LCD even when the device is in sleep/deep-sleep modes. Since this is a battery operated device, utilizing low power techniques like these enable OEMs to differentiate their products with long battery life.
- Pulse oximetry benefits from the latest programmable SoCs
- Cypress Adds an ARM Cortex-M0 to a New PSoC Family
- Cypress’s PSoC selected for intuitive touchpad in Korg handheld music synthesizers
- Analog Devices introduces a single-lead heart-rate monitor AFE
- Important design considerations for heart-rate and fitness monitors
- EKG-Based Heart-Rate Monitor Implementation on the LaunchPad Value Line