Design of reflective infrared heart rate detector based on uPSD3234

Publisher:郑大大Latest update time:2014-02-14 Source: dzscKeywords:uPSD3234 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  0 Introduction

  The pulse wave originates from the heart beat and propagates from the heart to the peripheral arteries. The comprehensive information it presents, such as shape, intensity, rate and rhythm, largely reflects the blood characteristics of many physiological and pathological aspects of the human cardiovascular system. Heart rate is an important physiological indicator. It refers to the number of heart beats per unit time and is a physiological indicator for routine clinical diagnosis.

  In order to measure the heart rate signal, there are many technologies that can be applied, such as blood measurement, heart sound measurement, ECG measurement, etc. This article explores the use of the high opacity of blood and the great difference in light transmittance between tissue and blood to obtain the pulse signal through a photoelectric pulse sensor. After analog-to-digital conversion (A/D), the sampled data is digitally analyzed and processed to achieve the measurement of human heart rate.

  1. Heart rate monitor system composition and working principle

  The main components of the heart rate detector are shown in Figure 1. The pulse signal is collected by the photoelectric sensor, and the pulse signal data is obtained through pre-amplification, filtering, and sampling by the A/D conversion module of the microcontroller uPSD3234A and stored in the memory; the microcontroller performs digital signal processing on the obtained data and calculates the heart rate value, and the result is sent to the display module and the memory.

  

  Figure 1 Schematic diagram of digital heart rate monitor

  1.1 Heart rate signal acquisition preprocessing circuit

  The pulse signal acquisition preprocessing circuit mainly converts the pulse wave into an electrical signal and performs preliminary high-frequency filtering preprocessing. The key part is the photoelectric pulse sensor. Photoelectric pulse sensors can be divided into two types: transmission type and reflection type according to the light receiving method.

  The reflective type can not only accurately measure the changes in blood vessel volume, but also in practical applications, it only requires the sensor to touch any part of the body. When the blood flow in the irradiated area changes with the heartbeat, the infrared receiving probe will receive the arterial pulsation light pulse signal that contracts and relaxes periodically with the heart, thereby collecting the heart beat signal.

  This design uses a reflective infrared sensor. As shown in Figure 2, the photoelectric pulse sensor uses infrared tubes KP-2012F3C and KP-2012P3C, which are arranged in a reflective manner. KP-2012F3C has good epidermal illumination, and the current is generally set at 20mA. The brightness is controlled by software through PWM current, which enables the infrared LED to work in the saturation area and emit stable light intensity.

  

  Figure 2 Pulse signal acquisition preprocessing circuit

  The KP-2012P3C transistor uses an AC coupling structure to enhance the amplification of weak signals. The signal detected by the transistor is sampled in two ways. One is a DC signal line. It is the transistor output and input to the A/D conversion channel 0 of the microcontroller through an emitter follower, which can be used to detect whether the transistor is in an effective working state; the other is an AC signal line. It is first input to a two-stage filter shaping circuit through an emitter follower and then input to the A/D conversion channel 1 of the microcontroller. The filter circuit is a two-stage bandpass filter circuit. Since the spectrum of the pulse wave contains rich pathological information, especially the spectrum in the range of 5~40Hz carries a lot of information related to coronary heart disease, considering the future expansion of functions, the upper and lower limit frequencies of the preprocessing circuit are designed to be 48Hz and 0.86Hz.

  1.2 uPSD3234 MCU

  This solution uses ST (STMicroelectronics)'s new single-chip microcomputer uPSD3234 as the core component of the system. It is based on the enhanced MCS-51 core 8032 single-chip microcomputer, has rich peripherals, integrates PSD (Programmable System Device, programmable peripheral device) modules, and contains large-capacity FLASH and RAM memories, integrated I2C and USB interface circuits, digital display (DDC) channels, 5 pulse width modulation (PWM) controllers, 4-channel 8-bit AD converters, and programmable logic devices (PLD). It is a typical high-speed single-chip microcomputer with SOC characteristics. Therefore, it can fully meet the design requirements without adding complex peripheral circuits.

  The USB module in the uPSD3234 chip supports the low-speed USB1.1 communication protocol. The heart rate monitor sampling data and the data obtained during the signal processing can be transmitted to the PC for storage and further analysis and processing.

  2 Heart rate signal digital processing and algorithm

  During the measurement process, the pulse signal detected by the preprocessing circuit is easily interfered by the outside world, and the interference noise needs to be processed.

  Generally, there are two ways to deal with noise: one is to add a filter circuit; the other is to reduce noise through algorithms from the perspective of digital signal processing. If a filter circuit is added to the periphery, the cost will increase and affect the portability of the instrument. In addition, due to the uncertainty of interference, the filtering effect will not be very good. Although software filtering will occupy certain system resources, it has the advantages of low cost, high reliability, good stability, and flexibility, convenience, and strong functions under the condition that the processing speed allows. This article mainly uses digital filtering methods for processing, among which the most important algorithm is the matched filter algorithm.

  The so-called matched filter is the best linear filter that maximizes the output signal-to-noise ratio of the filter at a specific moment and is derived from this. Matched filtering principle: Let the transfer function of the best linear filter with the largest output signal-to-noise ratio be H (ω), and the composite wave of the filter input signal and noise be:

  

  In formula (1), s(t) is the input digital signal, its spectrum function is S(ω), and n(t) is Gaussian noise. [page]

  Since the filter is a linear filter and satisfies the linear superposition principle, the filter output also consists of two parts: output signal and output noise, namely:

  

  In formula (2), the spectrum function of the output signal is S0(ω), and its corresponding time domain signal is:

  

  The average power of the filter output noise is:

  

  Therefore, at the sampling time t0, the ratio of the instantaneous power of the linear filter output signal to the average power of the noise is:

  

  It can be seen from equation (3) that when the input signal is given, the output signal ratio r0 is only related to the filter transfer function H (ω). According to Schwarz inequality:

  According to Parseval's theorem:

  

  In formula (5), E is the energy of the input signal, so the relationship is:

  

  According to the condition X(ω)=kY*(ω) in Schwart's inequality, where k is an arbitrary constant, the condition X(ω)=kY*(ω) in Schwart's inequality is:

  

  In formula (7), K is a constant, which can usually be selected as k=1.

  S*(ω) is the complex conjugate of the input signal spectrum S(ω). The filter can achieve the maximum output signal-to-noise ratio of 2E/n0 at a given time t0.

  The transfer function H(ω) of this filter, except for the multiplication factor Ke-jωt0, is consistent with the complex conjugate of the signal spectrum, so the filter is called a matched filter.

  It is easy to get the impulse response of the matched filter:

  

  The digital matched filtering process of the arterial pulsation optical pulse signal obtained by the infrared receiving probe is realized by convolving the input signal sequence s(n) with the impulse response sequence h(n) of the matched filter.

  Since the matched filter only matches the corresponding input signal, once the input signal changes, the original matched filter is no longer called a matched filter. The pulse wave is very complex, and even the pulse of the same person is not the same in every cycle, so it is necessary to design a matched filter based on the characteristics of the pulse signal. According to the formation mechanism of the pulse wave and the characteristic points of the pulse, four pulse wave differential waveforms are designed as templates for the matched filter, as shown in Figure 3. The template length is 100, which is exactly the width of the main pulse peak of the differential waveform.

  

  When working, the output value of the filter to be used is determined by comparing the output results of the four templates.

  This design uses the built-in ADC of uPSD3234 to sample the preprocessed pulse signal at a sampling frequency of 500Hz.

  The following is a brief introduction to the entire data processing process:

  1) The signal waveform obtained by sampling ADC channel 0 and channel 1 is shown in Figure 4.

  

  2) Perform low-pass filtering on the sampled AC signal data. Since the design only realizes the function of heart rate detection, the low-pass filter cutoff frequency is designed to be 8.5Hz. Part of the waveform is shown in Figure 5. [page]

  

  3) Taking advantage of the steep rising edge of the pulse wave, it is highlighted through differential calculation, and part of the waveform is shown in Figure 6.

  

  4) A matched filter is required to detect the negative pulse signal in the differential waveform above. In addition, since the output value of the matched filter will vary greatly due to factors such as the user and placement of the heart rate monitor, it is also necessary to be able to automatically adjust the threshold in the design. If the signal is greater than the threshold, it is considered that a heartbeat signal is detected. The effect of the matched filter and the detection output is shown in Figure 7.

  

  The heartbeat detection signal obtained by the above signal processing is a signal that reflects the instantaneous heartbeat of the human body. Based on this, a median algorithm can be used to accurately calculate the heart rate of the measured object. This median algorithm is: if the interval between the two pulses of the heartbeat detection signal is within the normal interval of the human heartbeat, the interval time is recorded, otherwise it is skipped. After recording enough heartbeat intervals, the median of these intervals can be calculated. The upper and lower boundaries of these intervals can be specified according to the median. The values ​​between the upper and lower boundaries are regarded as valid interval values. When the number of valid interval values ​​exceeds the set number, the average interval value can be calculated. Since the sampling frequency is 500Hz, each interval is 2us. A more accurate heart rate can be obtained.

  3 Software Design

  The system software design process is shown in Figure 8. It mainly includes display driver, key processing program, signal processing program, heart rate detection program, USB communication service program, etc.

  

  Figure 8 Software Flowchart

  4 Conclusion

  The reflective infrared heart rate detector designed in this scheme mainly uses the single-chip microcomputer uPSD3234 as the core component of the system, and uses digital signal processing methods such as matched filtering to obtain heart rate data, closely combining microelectronics technology with biomedical engineering technology to meet the requirements of the scheme design. In addition, this scheme has been successfully applied to fitness products treadmills, with certain innovation and practical application value, and has good market promotion value.

Keywords:uPSD3234 Reference address:Design of reflective infrared heart rate detector based on uPSD3234

Previous article:Design of car radio frequency identification anti-theft system based on ARM
Next article:Reliability Design of Single Chip Microcomputer Application System

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号