2013-2015 Microchip Technology Inc. DS00001525B-page 1 AN1525 INTRODUCTION Pulse oximeter is a non-invasive medical device that monitors the oxygen saturation of a patient’s blood and heart rate. This application note demonstrates the implementation of a high-accuracy pulse oximeter using Microchip’s analog devices and dsPIC ® Digital Signal Controllers (DSCs). FIGURE 1: FUNCTION BLOCK DIAGRAM Author: Zhang Feng Microchip Technology Inc. DC Offset ADC1 Microcontroller Photodiode IR Red DAC Computer, WiFi® or Bluetooth® I 2 C™ I/O UART PWM1 Transimpedance Amplifier Gain Stage Amplifier ADC0 Analog Signal Conditioning LED Current Control Analog Switch LED On/Off LED Driver PWM2 Highpass Filter LCD Pulse Oximeter Design Using Microchip’s Analog Devices and dsPIC ® Digital Signal Controllers (DSCs)
12
Embed
Pulse Oximeter Design Using Microchip’s Analog Devices and ...Pulse oximeter is a non-invasive medical device that monitors the oxygen saturation of a patient’s blood and heart
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
AN1525Pulse Oximeter Design Using Microchip’s Analog Devices
and dsPIC® Digital Signal Controllers (DSCs)
INTRODUCTIONPulse oximeter is a non-invasive medical device thatmonitors the oxygen saturation of a patient’s blood andheart rate. This application note demonstrates theimplementation of a high-accuracy pulse oximeterusing Microchip’s analog devices and dsPIC® DigitalSignal Controllers (DSCs).
FIGURE 1: FUNCTION BLOCK DIAGRAM
Author: Zhang FengMicrochip Technology Inc.
DC Offset
ADC1
Microcontroller
Photodiode
IR Red
DAC
Computer, WiFi® or
Bluetooth®
I2C™
I/O
UART
PWM1
Transimpedance Amplifier
Gain Stage Amplifier
ADC0
Analog Signal Conditioning
LED Current Control
Analog Switch
LED On/Off
LED Driver
PWM2
Highpass Filter
LCD
2013-2015 Microchip Technology Inc. DS00001525B-page 1
AN1525
THEORY OF OPERATIONA pulse oximeter monitors the oxygen saturation(SpO2) of a human’s blood based on the red light (600-750 nm wavelength) and infrared light (850-1000 nmwavelength) absorption characteristics of oxygenatedhemoglobin (HbO2) and deoxygenated hemoglobin(Hb). The pulse oximeter flashes the red and infraredlights alternately through a finger to a photodiode.HbO2 absorbs more infrared light and allows more red
light to pass through. On the other hand, Hb absorbsmore red light and allows more infrared light to passthrough.
The photodiode receives the non-absorbed light fromeach LED. This signal is inverted using inverting Op-Amp and therefore the result, as shown in Figure 2,represents the light that has been absorbed by thefinger.
FIGURE 2: REAL-TIME RED AND INFRARED (IR) PULSATION SIGNALS CAPTURED BY THE OSCILLOSCOPE
The pulse amplitudes (Vpp) of the red and infraredsignals are measured and converted to Vrms toproduce a Ratio value as given by Equation 1. TheSpO2 can be determined using the Ratio value and alook-up table that is made up of empirical formulas. Thepulse rate is calculated based on the Analog-to-Digitalconverter (ADC) sample number and sampling rate.
EQUATION 1:
The look-up table is an important part of the system.Look-up tables are specific to a particular oximeterdesign and are usually based on calibration curvesderived from many measurements of a healthy subjectat various SpO2 levels. Figure 3 shows a samplecalibration curve.
Red Pulsation Signal
IR Pulsation Signal
Ratio Red_AC_Vrms / Red_DCIR_AC_Vrms / IR_DC---------------------------------------------------------------=
DS00001525B-page 2 2013-2015 Microchip Technology Inc.
AN1525
FIGURE 3: SAMPLE CALIBRATION CURVE
CIRCUIT DESCRIPTIONThe SpO2 probe used in this example is an off-the-shelfNellcor® compatible finger clip type of probe whichintegrates one red LED and one IR LED and a photodi-ode. The LEDs are controlled by the LED driver circuit.The red light and IR light passing through the finger aredetected by the signal conditioning circuit and are thenfed to a 12-bit ADC module of the microcontrollerwhere %SpO2 can be calculated.
LED Driver circuitA DUAL SPDT analog switch driven by two PWMsignals from the microcontrollers turns the red andinfrared LEDs on and off alternately. In order to acquirethe proper number of ADC samples and have enoughtime to process the data before the next LED turns on,the LEDs are switched on/off according to the timingdiagram in Figure 4:
FIGURE 4: TIMING DIAGRAM
The LED current/intensity is controlled by a 12-bitDigital-to-Analog Converter (DAC) which is driven bythe microcontroller.
0
20
40
60
80
100
0.4 1 2 3.5
SpO
2 (%
)
Ratio
Sample Calibration Curve
g
IR_off 1780uS
RED_on 220uS
RED_off 1780uS
320uS
Read ADC
Read ADC
Read ADC
Processing data
IR_on 220uS
2013-2015 Microchip Technology Inc. DS00001525B-page 3
AN1525
Analog Signal Conditioning CircuitThere are two stages in the signal conditioning circuit.The first stage is the transimpedance amplifier and thesecond stage is the gain amplifier. A Highpass filter isplaced between the two stages.
TRANSIMPEDANCE AMPLIFIERThe transimpedance amplifier converts a few microamps of current generated by the photodiode to a fewmillivolts.
HIGHPASS FILTERThe signal received from the first stage amplifierpasses through a Highpass filter which is designed toreduce the background light interference.
GAIN AMPLIFIERThe output of the Highpass filter is sent to a secondstage amplifier with a gain of 22 and a DC offset of220 mV. The values for the amplifier’s gain and DCoffset are set to properly place the output signal level ofthe gain amplifier into the microcontroller’s ADC range.
DIGITAL FILTER DESIGNThe output of the analog signal conditioning circuit isconnected to the ADC module of the dsPIC DSCs. OneADC sample is taken during each LED’s on-timeperiod, and one ADC sample is taken during bothLED’s off-time period.
Taking advantage of the powerful Digital SignalProcessing (DSP) engine integrated in dsPIC DSCs, adigital FIR Bandpass Filter is implemented to filter theADC data. The filtered data is used to calculate thepulse amplitude. Digital filter code is generated usingMicrochip’s Digital Filter Design Tool.
CONNECTIVITYThe SpO2 and pulse rate data can be sent to acomputer through a UART port with the PICkit™ SerialAnalyzer. The serial port setting is 115200-8-N-1-N.The pulse signal can be plotted out using an applicationsuch as Microchip’s Generic Serial Data Display GUIas shown in Figure 5.
The data can also be sent to a Wi-Fi® or Bluetooth®
module via UART port.
FIGURE 5: THE WAVEFORM DISPLAYING THE PULSE SIGNAL
FIR Bandpass Filter SpecificationsSampling Frequency (Hz): 500Passband Frequency (Hz): 1 and 5Stopband Frequency (Hz): 0.05 and 25FIR Window: KaiserPassband Ripple (-dB): 0.1Stopband Ripple (-dB): 50Filter Length: 513
500
550
600
650
700
750
800
850
900
950
1000
1 43 85 127
169
211
253
295
337
379
421
463
505
547
589
631
673
715
757
799
841
883
925
967
1009
1051
1093
1135
1177
1219
1261
1303
1345
1387
1429
1471
1513
1555
1597
1639
1681
1723
1765
1807
1849
1891
1933
1975
2017
2059
2101
2143
2185
2227
2269
2311
2353
2395
2437
IR
RED
DS00001525B-page 4 2013-2015 Microchip Technology Inc.
AN1525
FIGURE 6: PROGRAM FLOWCHART
Initialization
Turn On/Off RED IR LEDs
Alternately
Is the signal received from the probe valid?
Go to Sleep No
Are Red IR ADC Data Ready?
Adjust DAC to Calibrate IR LED
Yes
No
Yes
Adjust DAC to Calibrate Red LED
FIR Bandpass Digital Filtering
Find MaxMin of IR RED Filtered AC Signals
Calculate SPO2 Pulse Rate
Main Loop
Display Result
Start
Timer 3 Interrupt Occurred Read RED DC AC Signal
Timer 2 Interrupt Occurred Read IR DC AC Signal
Read DC Baseline Signal after Timer3 Interrupt
before Timer2 Interrupt
From Interrupts
Is Red ADC Data Ready?
Yes
Is IR ADC Data Ready?
Yes
2013-2015 Microchip Technology Inc. DS00001525B-page 5
AN1525
NOTES:
DS00001525B-page 6 2013-2015 Microchip Technology Inc.
AN1525
APPENDIX A: SCHEMATICS This appendix shows the Microchip Pulse Oximeterschematics.
DS00001525B-page 8 2013-2015 Microchip Technology Inc.
AN1525
APPENDIX B: MEDICAL DEMO WARNINGS, RESTRICTIONS AND DISCLAIMER
This demo is intended solely for evaluation anddevelopment purposes. It is not intended for medicaldiagnostic use.
APPENDIX C: REFERENCESAN1494, “Using MCP6491 Op Amps for Photodet-ection Applications”, Microchip Technology Inc.,DS01494, 2013.
2013-2015 Microchip Technology Inc. DS00001525B-page 9
AN1525
NOTES:
DS00001525B-page 10 2013-2015 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip devices:• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyer’s risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights.
2013-2015 Microchip Technology Inc.
QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV
== ISO/TS 16949 ==
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, flexPWR, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, MediaLB, MOST, MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC32 logo, RightTouch, SpyNIC, SST, SST Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
The Embedded Control Solutions Company and mTouch are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, ECAN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, KleerNet, KleerNet logo, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, RightTouch logo, REAL ICE, SQI, Serial Quad I/O, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
Microchip received ISO/TS-16949:2009 certification for its worldwide
DS00001525B-page 11
headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
DS00001525B-page 12 2013-2015 Microchip Technology Inc.
AMERICASCorporate Office2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7200 Fax: 480-792-7277Technical Support: http://www.microchip.com/supportWeb Address: www.microchip.comAtlantaDuluth, GA Tel: 678-957-9614 Fax: 678-957-1455Austin, TXTel: 512-257-3370 BostonWestborough, MA Tel: 774-760-0087 Fax: 774-760-0088ChicagoItasca, IL Tel: 630-285-0071 Fax: 630-285-0075ClevelandIndependence, OH Tel: 216-447-0464 Fax: 216-447-0643DallasAddison, TX Tel: 972-818-7423 Fax: 972-818-2924DetroitNovi, MI Tel: 248-848-4000Houston, TX Tel: 281-894-5983IndianapolisNoblesville, IN Tel: 317-773-8323Fax: 317-773-5453Los AngelesMission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608New York, NY Tel: 631-435-6000San Jose, CA Tel: 408-735-9110Canada - TorontoTel: 905-673-0699 Fax: 905-673-6509