Design of Pulse Oximeter Based on TI MSP430
[Copy link]
Design of pulse oximeter based on MSP430FG437 microprocessor. The probe is used to contact human tissues such as fingers, ears or nose to measure physiological indicators such as blood oxygen saturation and pulse, and the measured data is displayed on the LCD. The sensor used can also be used to measure heart rate. The probe contains two LEDs, one for visible light (660nm red light) and the other for infrared light (940nm). When the light intensity of these two lights changes after penetrating the human body, the percentage of blood oxygen content can be obtained by calculating the ratio of the two light intensities.
1. Design introduction
Pulse oximeter is a medical device used to detect the patient's blood oxygen content. The pulse oximeter introduced here can send a beeping alarm when the measured blood oxygen content and heart rate are lower than normal levels. This use is very suitable for health monitoring of newborn babies and during surgery. The design scheme uses the ultra-low power MSP430 chip design. The high integration of this chip makes the design scheme do not require too many external components, and it reduces the overall power consumption by reducing the opening time and alternately providing power to the two LED light sources.
2. Working Principle
Blood oxygen saturation (SpO2) is the percentage of oxygenated hemoglobin (HbO2) in the blood that is bound by oxygen to the total hemoglobin (Hb) capacity, that is, the concentration of blood oxygen in the blood. It is an important physiological parameter of respiratory circulation. Functional oxygen saturation (SaO2) is the ratio of HbO2 concentration to HbO2+Hb concentration. Therefore, SaO2 is often used to estimate the SpO2 level in monitoring.
Since blood has different light absorption rates when its oxygen content is different, pulse oximeters use red light and infrared light to illuminate human tissues and calculate the blood oxygen saturation value by measuring the intensity of the transmitted light. SaO2 is defined as the ratio of oxygenated hemoglobin to total hemoglobin. This relationship is shown in formula (1).
Depending on the degree of blood oxygenation, human tissue absorbs different amounts of light, a characteristic that is nonlinear. The two wavelengths of light used in the pulse oximeter are turned on alternately for measurement. Using two wavelengths of light for measurement helps reduce the complexity of mathematical calculations after the measurement.
The specific calculation is shown in formula (2), where λ1 and λ2 represent the wavelengths of the two types of light. Light passing through human tissue is converted into electrical signals, where the DC signal is the result of light being absorbed by human tissue and blood vessels; the AC signal is the result of light being affected by arteries. In practice, the relationship between SaO2 and R1 is not a linear relationship as shown in the formula, so an accurate reading must be obtained by looking up a table.
3. Circuit
Figure 1 describes the structure of the system. The two LEDs are time-multiplexed, and each LED is sampled 500 times per second. The PIN diode is therefore activated alternately by the two LED light sources, and its output signal is amplified by the OA0 and OA1 operational amplifiers. ADC12 samples the output of the two operational amplifiers. The sampling results are accurately sequenced by ADC12, and the MCU software is responsible for separating infrared and red light. The measured SaO2 and heart rate are displayed on the LCD, and the sampling results can also be transmitted to the computer in real time through the RS232 interface. The separate software can display the sampling results with graphical curves. In addition to the MCU and four transistors, this design only requires a small number of passive components (see Figure 9). This uses a Nellcor compatible probe, model 520-1011N, which contains the sensor inside the probe and uses a D-type nine-pin connector.
Figure 1, System structure
1. LED drive circuit
As mentioned above, the solution uses one LED to emit visible red light and one LED to emit infrared light. The probe is compatible with Nellcor (US medical device company) products. The two LEDs inside are connected back to back and driven by an H-Bridge circuit, as shown in Figure 2. The H-Bridge complementary circuit is driven by ports 2.2 and 2.3 of the MSP430. DAC0 controls the current flowing through the LED and controls the brightness of the LED. The whole is a time multiplexed circuit. Through the software in the DAC, the external circuit can connect to the 12-bit DAC0 inside the MSP430FG437 via pins 5 and 10 to manage the register. When these two pins are not used to output the DAC0 signal, they are set to Hi-Z or low level respectively. The base of the transistor is connected to a pull-down resistor to ensure that the transistor is turned off when not in operation.
Figure 2. LED drive circuit
2. Sampling and conditioning PIN diode signals
After receiving light, the photodiode generates current, which is then input into the transimpedance amplifier for amplification. Among the three built-in operational amplifiers, OA0 is used to amplify the above current signal. Since this current is very weak, OA0 is required to have a very small drift current.
The signal output by OA0 contains a DC component of about 1V and a small AC component (about 10mV pk-pk). The DC component signal is formed by human tissue and diffuse light, and this part of the signal is proportional to the intensity of the light emitted by the LED. The small AC signal is formed by two reasons. One is the change in blood oxygen in the arteries, which causes the change in the intensity of the penetrating light and forms an AC signal; the other reason is the noise signal formed by the 50/60Hz ambient light. The AC component is the useful signal that needs to be extracted and amplified.
The level control of the LED needs to keep the output of OA0 within a preset range. The circuit in Figure 3 is used to complete the above task. The red LED and the infrared LED are controlled separately within this preset range. In fact, the output error of the two LEDs is very small.
Figure 3. Input front-end circuit and LED control circuit
In Figure 3, OA1 extracts and amplifies the output AC signal of OA0. The DC tracking filter extracts the DC signal and uses it as the input offset of OA0 (offset input, used to offset the DC component), so that only the AC signal is amplified. This effectively filters the DC component. The offset of OA1 is also amplified and added to the output signal, which will also be filtered out in the subsequent circuit.
The timer A integrated in the MSP430 is used to control the order of driving the LEDs and automatically start the ADC conversion. The timing diagram is shown in Figure 4. The CCR0 interrupt uses another driving order. At this time, the control bit DAC12OPS of DAC12_0 is determined by the driven LED to determine whether it is set or cleared. Port2 of the MSP430 is used to set the corresponding LED to turn on. The value of DAC12_0 is set to the corresponding light intensity; DAC12_1 is set to the DC tracking filter output.
Figure 4. Timing diagram of timer A
OA1 amplifies the difference between the OA0 output and the DAC12_1 output. The intensity of the visible light emitted by the LED is adjusted, and DAC12_1 will be a straight line, because the outputs of the two LEDs at OA0 are the same. The ADC will be triggered automatically, and it will perform two samples, one is the OA0 output used to track the DC signal, and the other is the OA1 output, which are used to calculate the heart rate and blood oxygen concentration. The two samples are performed alternately, and the sampling timer is used by setting the MSC bit in the control register inside the ADC. In order to save power, after an ADC conversion is completed, an interrupt will be generated to tell the MCU to turn off the LED and clear DAC12_0.
3. Adjustment of AC signal
The output of OA1 is sampled by the ADC at 1000 times per second, that is, the red LED and infrared LED outputs are sampled alternately 500 times. The output of OA1 must remove the residual DC component. It is impractical to use a high-pass digital filter here because the cutoff frequency required is very low, so an IIR filter is used to track the DC level. The DC signal is stripped from the output signal to obtain a "real" AC digital signal. The sampled signal is then digitally filtered to remove the 50Hz environmental noise. In this way, a low-pass FIR filter with 6Hz and -50dB attenuation is realized. The output signal is already very close to the beating of the heart. (Figure 5)
Figure 5. AC signal conditioning
The DC tracking filter shown in Figure 6 is an IIR filter that superimposes the difference between the input and output on the output signal. If there is a step change in the input, the output automatically adjusts over a period of time and eventually becomes the same as the input. The rate of change is determined by the coefficient K, which is determined by the laboratory. Therefore, if the input contains DC and AC signals, setting the value of K small enough will form a time constant that is related to the frequency of the AC signal. In this way, the AC signal will be eliminated over a period of time, and the output will only track the input DC signal. In order to ensure sufficient dynamic range, double precision (32 bits) is used in the calculation, and only the most important 16 bits of data are actually used.
Figure 6. Tracking filter structure
4. Calculate oxygen content and heart rate
Because both LEDs are driven by pulse signals, traditional analog signal processing is not suitable, so digital signal processing technology is used instead. The sampled signal is low-pass filtered to remove 50/60Hz noise. For each wavelength of light, the DC signal is removed, leaving the AC part, because the AC signal truly reflects the arterial blood oxygen level. The square average value (i.e., the root mean square value) of the signal is calculated over a certain number of heartbeats to obtain the RMS value.
Figure 7. Relationship between R and SaO2
The measurement of the DC signal is to continuously calculate the average value of the signal under a certain number of heartbeats. The driving strength of each LED is controlled so that the DC level on the PIN diode meets the set target value within a very small error. The same approach is taken on each LED, and the final result is that the DC levels of the two LEDs are very close. Once the DC levels of the LEDs are close, the size of SaO2 can be calculated by formula (2). The measurement of heart rate is obtained by calculating the sampling results every three heartbeats. Since the sampling rate is 500sps, the heartbeats per minute can be calculated by formula (3). Figure 7 shows the relationship between theoretical and actual R and SaO2. When the blood oxygen saturation drops below 80%, it can be assumed that the two are in a linear relationship. Figure 8 shows the heartbeat signal obtained from the serial interface of the circuit board. The data transmission rate is 115kbps, which can be displayed on the LCD screen. Figure 9 is the circuit schematic.
Figure 8, signal reflecting heartbeat
|