+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: Pulse Oximetry Sensor Interface

  1. #1

    Default Pulse Oximetry Sensor Interface

    This first post of this project thread will contain a summary of the project so far.

    The most recent version of software generated by this project will be attached to this first post. There isn't any software posted yet for this project.

    The following three posts will contain additional information about the completed project.
    Chronological posts about progress on this project will begin with post #5.

    Partial Index of Thread

    Post #5 Beginning of chronological entries.
    Post #10 Pulse oximetry and photodiode links.
    Last edited by Duane Degn; 07-14-2012 at 07:10 PM.

  2. #2

    Default Re: Pulse Oximetry Sensor Interface

    2 of 5 reserved

  3. #3

    Default Re: Pulse Oximetry Sensor Interface

    3 of 5 reserved

  4. #4

    Default Re: Pulse Oximetry Sensor Interface

    4 of 5 reserved

  5. #5

    Default Re: Pulse Oximetry Sensor Interface

    In this thread, Ken asked for help in interfacing with some (SpO2) pulse oximetry sensors.

    Click image for larger version

Name:	SPO2%20Sensors.jpg
Views:	159
Size:	102.0 KB
ID:	94163

    To add to the fun, the sensors don't have datasheets (at least that I've been able to find).

    After probing the pins with my voltmeter (and cutting the wires on one sensor), it became clear that the units had bidirectional LEDs. The anode to the red LED was the cathode of the IR LED and vise versa.

    Here's the pinout for the sensor.



    The multimeter gives 1.64V as the red LED's forward voltage and 1.12V as the IR LED's forward voltage. These reading are of course lower than the actual forward voltages since the multimeter uses very low currents to test the diodes' forward voltages.

    After careful study I was able to deduce which side of the earclip held the LEDs.



    The red LED looks kind of white in this photo. It's a deeper red in real life.

    Click image for larger version

Name:	SpO2EarLedRed120713a.jpg
Views:	115
Size:	117.4 KB
ID:	94168

    The IR LED didn't shine as brightly for the camera as the red LED had. I had to shield the room light in order to pick up the IR light.

    Click image for larger version

Name:	SpO2EarLedIr120713a.jpg
Views:	98
Size:	189.9 KB
ID:	94167

    I'm still in the process of learning about photodiodes. If I understand them correctly, there is a positive voltage produced on the photodiode's anode in the presence of light.

    Click image for larger version

Name:	SpO2EarPd120713a.jpg
Views:	78
Size:	98.5 KB
ID:	94169

    I measure about 230mV across the photodiode with the room's light shining on the sensor.

    To aid in figuring out which pin did what, I cut the connector off the sensor (don't tell Ken). Here's my makeshift replacement connector.

    Click image for larger version

Name:	SpO2EarHackConn120713a.jpg
Views:	98
Size:	116.7 KB
ID:	94165

    What's kind of odd is there are two wires (yellow and blue) that don't appear to be connected to anything. They aren't connected to any of the pins on the original connector.

    I found a pinout diagram for a different SpO2 sensor which included a "sensor ID" pin. I think pin #4 is one of these sensor ID pins which uses a 2K resistor (I believe inside the connector body) to identify this particular sensor to the host machine.

    After seeing an Arduino pulse oximeter project that displayed pulse blips to a terminal window, I knew this project needed some sort of graphic pulse readout in real time.

    I was very pleased to find Andy Lindsay's PST oscilloscope method as I was learning how to use the PropBOE's ADC and DAC.

    As you can see from the video, I'm using a modified version of Andy Lindsay's object to display voltage reading from the PropBOE's ADC.



    I wasn't able to pickup any meaningful fluctuations in the voltage levels with the sensor clipped to my ear. I don't know if I just have things wired incorrectly or if I'll need a better amplifier circuit for the photodiode's signal.

    I'll also describe the opamp circuit in more detail later.

    I'm pretty sure I'll need help with this project. Along with describing my attempts so far to read meaningful information from the photodiodes signal, I'll also try to ask an intellegent question about amplifying the signal tomorrow.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	SpO2EarLed120713a.jpg‎
Views:	2753
Size:	37.2 KB
ID:	94166   Click image for larger version

Name:	SpO2EarConn120713c.jpg‎
Views:	3168
Size:	242.2 KB
ID:	94170  
    Last edited by Duane Degn; 07-14-2012 at 06:35 AM.

  6. #6

    Default Re: Pulse Oximetry Sensor Interface

    Photodiodes are usually operated in reverse-bias, rather than photovoltaic mode.
    Leon Heller
    G1HSM

  7. #7

    Default Re: Pulse Oximetry Sensor Interface

    Did you see this http://www.ti.com/general/docs/lit/g...b&fileType=pdf ? Describes well how the hardware works.

  8. #8

    Default Re: Pulse Oximetry Sensor Interface

    Duane,
    Ck out Analog Devices for samples of the necessary op amps.
    Jim

  9. #9

    Default Re: Pulse Oximetry Sensor Interface

    Quote Originally Posted by Leon View Post
    Photodiodes are usually operated in reverse-bias, rather than photovoltaic mode.
    Leon, yes, I read this several places on the internet. I don't know how much voltage to use and how much current would be safe with this sensor. I believe even when reverse-biased, the sensor output will require amplification.

    Quote Originally Posted by OppaErich View Post
    Did you see this http://www.ti.com/general/docs/lit/g...b&fileType=pdf ? Describes well how the hardware works.
    OppaErich, no, I hadn't seen that document. I've seen similar appnotes. The one you list has a lot of good information. Thank you.

    Edit: I see this document is listed from the TI page I have listed in post #10 of this thread (the TI page is the first link of the list).

    Quote Originally Posted by RS_Jim View Post
    Duane,
    Ck out Analog Devices for samples of the necessary op amps.
    Jim
    Jim, I think my problem is figuring out which op-amp to use and how to use it.

    This project is part of the preparation Parallax is making to co-sponsor a medical equipment / medical training contest with the Army (I think). Ken and Invent-O-Doc gave a presentation about it at the last UPEW(Parallax Expo).

    I hoping to use parts Parallax currently sells to read from these sensors. The dual op-amp LM358 is used in the Understanding Signals 1.0 book. I think this same op-amp is used in other Parallax kits. If possible, I'd like to use this op-amp to amplify the signal from the photodiode.

    I'd really like to avoid exotic or expensive parts.

    I'm also hoping to make use of the PropBOE's peripherals in this project. I think the PropBOE's ADC is fast enough to read multiple times within a single pulse but I don't know if it's precise enough to allow blood oxygen levels to be computed. I think the PropBOE's ADC should be precise enough to detect a pulse from a properly conditioned photodiode signal.

  10. #10

  11. #11

    Default Re: Pulse Oximetry Sensor Interface

    Here are a couple of relavent circuits.

    This first circuit comes from the TI paper OppaErich suggested.



    This second circuit is from the "What you need to know . . ." document I linked to above.



    This second circuit is much simplier than the first. I'd like to try starting out with a simple circuit but the circuit uses a -15V supply. I'd like to limit the voltages to 5V, 3.3V and ground for my circuit. I'm not opposed to using a voltage divider to access intermediate voltages but I'd prefer not to use additional voltage regulators.

    I'm going to try to design a circuit that places the photodiode in reverse-bias (as Leon suggested) which is then applified by a LM358 op-amp. I'll post a schematic here prior to testing it so you all can warn me if I'm likely to fry some component.

    Thanks for all the help so far. I know I'll need a lot more.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	SpO2TiCircuit120714a.jpg‎
Views:	3843
Size:	45.8 KB
ID:	94184   Click image for larger version

Name:	SpO2PdCiruit120714a.PNG‎
Views:	3162
Size:	23.7 KB
ID:	94185  

  12. #12

    Default Re: Pulse Oximetry Sensor Interface

    Biasing a photo-diode at zero volts is just fine. The tradeoff is more photo-diode capacitance in exchange for minimum leakage current. Perfectly acceptable in this case. A simple way to think of a photo-diode is as a light dependent current source in parallel with a switching diode.

    Lawson
    micro-power experiments with the propeller.
    Drivers for TAOS TSL3301 line sensor Forum thread, and OBEX
    Lumen Electronic Jewelery Website
    My AWD motorcycle Website and action video
    What I'm paid to work on. UW Lidar Group.
    FME, a Spin-only floating point library with trig, exponential, and logarithm functions. OBEX and Forum.

  13. #13

    Default Re: Pulse Oximetry Sensor Interface

    Duane
    As shown in your circuit above you are measuring the change in current in the photo diode as a function
    of the light intensity on it. You need a current to voltage converter circuit. Just applying a reverse voltage and
    feeding the voltage into an op amp will not work.
    I found a doc that talks about it
    Tom
    Attached Files Attached Files

  14. #14

    Default Re: Pulse Oximetry Sensor Interface

    Thanks Lawson and Tom for the help.

    The "PhotodiodeAmplifiers.pdf" has a lot of useful information.

    I thought the "Conclusions:" section interesting. Here's the first four points:

    - Photodiode amplifiers are tricky.
    - The design should be tailored for the application, DC, Data, etc.
    - The design requires a lot of trial and error.
    - Be prepared to do a lot of study.
    I'm beginning to think there isn't a easy solution to for extracting the very small pulse/oxygen fluctuations from the overal signal.

    I think this would be much easier (reading pulse and possibly oxygen levels) if I were to use a TAOS light to freqency sensor.

    I tried using a TSL230R chip last night with a high power LED and was able to get very good resolution. I don't know if I can detect my pulse with this sensor, but I think it's likely to be much easier to make a DIY pulse oximeter with one of the TOAS sensors than trying to isolate and amplify the AC portion from the photodiode.

    Parallax no long sells the TSL230R chips, but they do sell a three pin light to frequency sensor that might produce similar results.

    I'm going to spend a bit of time seeing how well these light to frequency chips work for this application.

  15. #15

    Default Re: Pulse Oximetry Sensor Interface

    Hi Duane,

    Good luck with this project! I looked at your video, but I'm not sure what circuit you were using on that breadboard.

    Could you do a simple little experiment? If you have a sensitive µA range on your multimeter, hook it up to the photodiode black and white leads to measure its intrinsic output current at different light levels. Then with the sensor on the ear/finger, and the red or IR led driven with something like 20mA, and measure the current output by the photodiode. I'm just trying to get a ballpark idea of the offset current you will need to deal with. If the meter is not sensitive enough, it may take a simple transconductance amplifier to get that number.

    The signal will be a small current riding on the offset current. The offset current has to be subtracted. In analog approaches, that is usually done by integrating the output and feeding it back, servo style, to subtract from the input signal. Or, if the ADC is high res (like 24 bits) the subtraction can be done in firmware. The picture is complicated by the fact that the LEDs will be pulsed, alternating red and IR, and the pulses may be narrow, and may be driven at a current far above the allowed continuous DC current. That has to repeat many times within one heartbeat, and then the ratio of red signal/IR signal has to be compared with the calibration table. You've already realized that it can get fun pretty fast!

    With regard to the 2k resistor and the cable shield, purposed as a device ID is reasonable. Another possibility would have to do with the fact that photodiodes out on the end of cables have special problems, especially when more bandwidth is needed for response to pulses, without adding noise. Active drive of the cable shield can help with that.

  16. #16

    Default Re: Pulse Oximetry Sensor Interface

    Quote Originally Posted by Tracy Allen View Post
    I looked at your video, but I'm not sure what circuit you were using on that breadboard.
    Tracy, thanks for your help.
    I think the circuit in the video used both of the op-amps in the LM358. I used one op-amp as a buffer. I used this circuit from page 102 of Understanding Signals V1.0.



    I used the second op-amp pins 7, 6 & 5 of the chip instead of 1, 2 & 3 as labelled in the above circuit. The cathode of the photodiode was connected to ground and the anode was connected to pin 5 (+ of second op-amp).

    The output at from pin 7 (labelled 1) was then connected to pin 3 of the LM358 chip. The first op-amp was used as a "non-inverting voltage amplifier" as found on page 104 of Understanding Signals. Here's the amplifier circuit.


    As I said, I used the output of the buffer circuit as the "signal" of this circuit.

    I think I used a 1K resistor for Ri and a 10K pot (as a variable resistor) for Rf. The output from this circuit (pin 1) was connected to the PropBOE's ADC. I turned the pot up until the output was around 3.2V.

    The information from the amplifier plus buffer circuit didn't look any more meaning full than the information from the amplifier circuit alone.

    Edit: In the above schematics, I used 5V for Vcc and ground for Vss and Vee.

    Quote Originally Posted by Tracy Allen View Post
    Could you do a simple little experiment? If you have a sensitive µA range on your multimeter, hook it up to the photodiode black and white leads to measure its intrinsic output current at different light levels. Then with the sensor on the ear/finger, and the red or IR led driven with something like 20mA, and measure the current output by the photodiode. I'm just trying to get a ballpark idea of the offset current you will need to deal with.
    My meter displays current down to 0.01uA precision.

    I'm powering the red LED at 21.5mA.

    With the ear clip closed on itself the current measures 133.8uA and continues to slowly fall.
    With the sensor clipped to my ear, I get 18uA. It flucuates about 0.2uA up and down slowly and (based on the period of oscillations) about 0.06uA of the fluctuation could possibly be caused by my pulse.

    The IR LED (using the same 66.7 ohm resistor) is powered by 29.2mA. (I'll likely go back to a 100ohm resistor for the IR LED to keep the current at a safer level.)
    With the ear clip closed on itself the current measures 184.74uA +- 0.04ua. This value stays pretty constant while I'm watching it.
    Clipped to my ear the current drops to about 21uA and slowly climbs. It flucutates relatively quickly by about 0.3uA.
    It'sm now up to 24.4 uA.

    I get about 400mV across the photodiode with the ear clip closed on itself (red LED). Clipped to my ear the voltage is about 300mV. My multimeter is acting up (it says the battery is low but I just replaced its battery). I'll needd to conduct additional tests later.

    From a test I did yesterday, I think the AC component of the voltage is about 0.4mV (very rough guess).

    Quote Originally Posted by Tracy Allen View Post
    The signal will be a small current riding on the offset current. The offset current has to be subtracted. In analog approaches, that is usually done by integrating the output and feeding it back, servo style, to subtract from the input signal. Or, if the ADC is high res (like 24 bits) the subtraction can be done in firmware. The picture is complicated by the fact that the LEDs will be pulsed, alternating red and IR, and the pulses may be narrow, and may be driven at a current far above the allowed continuous DC current. That has to repeat many times within one heartbeat, and then the ratio of red signal/IR signal has to be compared with the calibration table. You've already realized that it can get fun pretty fast!
    This is a bit over my head but it's stuff I'd like to learn about. I do agree it's fun.

    I have a 16-bit ADC chip that I thought might be useful if I could use it near its lower voltage limit (2.7V). One problem with this 16-bit ADC is it can only sample at 8Hz at the full 16-bit resolution.

    I also have a couple of different op-amps besides the LM358. I have four LCM6041 op-amps and one LCM6001 ultra low input current op-amp.

    The LCM6041 chips aren't too expensive but the LCM6001 is about $12 a chip. I purchased these op-amps for a pH meter project I never really started. I wouldn't mind using these chips in this project, but I'm pretty sure Ken doesn't want a solution that reads from these sensors to cost very much.

    While I don't mind figuring out how to do all this with analog circuits (at least I wont admit to minding) I think I ought to check with Ken to see how complicated this circuit can be and still be acceptable.

    My initial tests with a light to freqency sensor were very promising. I think I'll pursue these tests as I try to figure out what combination of circuits I'll need to read useful information from the photodiode.

    Quote Originally Posted by Tracy Allen View Post
    With regard to the 2k resistor and the cable shield, purposed as a device ID is reasonable. Another possibility would have to do with the fact that photodiodes out on the end of cables have special problems, especially when more bandwidth is needed for response to pulses, without adding noise. Active drive of the cable shield can help with that.
    Apparently my ignorance includes active drives of cable shielding. I thought the shielding was generally connected to ground.

    What was the fourth conclusion from the National photodiode sheet? Oh yes,
    - Be prepared to do a lot of study.
    Thank you very much Tracy for all your help.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	SpO2PdOpAmpCiruit120715a.PNG‎
Views:	3049
Size:	15.7 KB
ID:	94207   Click image for larger version

Name:	SpO2PdOpAmpCiruit120714a.PNG‎
Views:	4058
Size:	18.1 KB
ID:	94206  
    Last edited by Duane Degn; 07-16-2012 at 06:23 AM.

  17. #17

    Default Re: Pulse Oximetry Sensor Interface

    This is 2 kewl for a fool. I was just gonna hack the pulse ox that I bought at Walgreens. It's digital so I just decided to use the output, with the Prop Controller, to build the patients vitals output file. Never thought of building one. Nice work D.

  18. #18

    Default Re: Pulse Oximetry Sensor Interface

    Duane, thanks for the measurements. So, the offset current will be on the order of 18 µA and the signal will be something most likely less than 1µA. Here is a first pass circuit, but not one that you would use in practice. Conceptually it is better to take it one step at a time.

    Click image for larger version

Name:	x-cond-oxi2.png
Views:	3672
Size:	16.0 KB
ID:	94230

    The photodiode is placed in a transconductance circuit that has a 1MΩ feedback resistor, so that a 1µA change in current at the input causes an 1V change in voltage at the output. The photodiode as shown sinks current, so brighter light on the photodiode makes the output voltage increase at pin 1 of the op-amp. The voltage at pin 2 stays at 1.25 V, held there by the feedback, so that it matches the constant 1.25V on pin 3. Forget about R4 and the hookup to the 10k pot for a moment. If you just had the 18 µA baseline current of the photodiode clipped to your ear, that would imply an output of over 18 volts at the output, so the amplifier would simply saturate, as close as it could get to its 5V supply rail. Now add R4 and the potentiometer. R4 also supplies current to the summing junction at pin 2. If the potentiometer is adjusted to give 3.05V with respect to Vss, then the voltage across the 100kΩ resistor is (3.05V - 1.25V) = 1.8V. The current through the resistor will be 1.8V/100k = 18µA. That exactly balances the baseline current sinking to ground through the photodiode, so the the output from the op-amp will be 1.25V. With that adjusted, now small fluctuations in the photodiode current on the order of 1µA cause fluctuations of 1V at the output. You can look for small changes due to arterial pulsations. If the baseline current is too far from 18µA, well, you have to adjust the potentiometer until the output of the op-amp is again within range of 1 or 2 volts. To much this way, it pegs toward +5, too much the other way, it pegs as Vss.

    Again, this is just a conceptual circuit, and while it should work, Ken won't want to ship you along with each package to make a fine adjustment on the potentiometer. The next step circuit after this replaces the manual adjustment with an error amplifier/integrator. An integrator watches the output, and if it differs from 1.25V, it adds current at the input to bring it back into balance. The integrator can be set up to have a time constant much longer than the pulsation period, so that it automatically adjusts for slower changes like position on the ear. The time constant has to be adaptive, so the larger the error, the faster the response.

    It is also possible to set this up with the photodiode interfaced directly to the sigma-delta circuit on the Prop, and the integrator feedback too all digital. I don't know if you want to get into that. It takes special care with layout of smt parts on a Prop dedicated to that purpose, and I don't know if it could achieve the necessary signal/noise performance.

    Interface to the digital output of a cheap digital output meter might be the easier way to go!
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	x-cond-oxi.png‎
Views:	65
Size:	16.1 KB
ID:	94228  
    Last edited by Tracy Allen; 07-16-2012 at 07:54 PM. Reason: R1 in schemtic is 10k not 20k

  19. #19

    Default Re: Pulse Oximetry Sensor Interface

    Tracy, Thanks for the detailed reply. I can't believe I hadn't seen you post until know. I thought I clicked "What's New?" frequently enough not to miss anything.

    I was about to post a progress report here and I was very surprised to find two posts I hadn't seen before.

    Quote Originally Posted by Tracy Allen View Post
    It is also possible to set this up with the photodiode interfaced directly to the sigma-delta circuit on the Prop, and the integrator feedback too all digital. I don't know if you want to get into that. It takes special care with layout of smt parts on a Prop dedicated to that purpose, and I don't know if it could achieve the necessary signal/noise performance.
    From the datasheets I've read, I'm under the impression that care needs to be taken when designing low current amplifiers in general.

    Would the op-amp circuit you describe work on a breadboard, or would I need to create a PCB for the circuit?

    I've wondered about soldering some components to a QuickStart board to for a sigma-delta circuit but I don't presently have any idea of what values I should use for the components.

    Quote Originally Posted by Tracy Allen View Post
    Interface to the digital output of a cheap digital output meter might be the easier way to go!
    This is the approach I've been working on. I've been using a TAOS TSL230R as the light sensor. The output from these sensor can vary dramatically so I needed to update the PST o'scope software to automatically scale the graphs. I just finished uploading a video showing the data from the TSL230R being graphed.

    I just wanted to apologize for not acknowledging your last post, before I starting my update post. Thank you very much for your help.

  20. #20

    Default Re: Pulse Oximetry Sensor Interface

    Quote Originally Posted by smithdavidp View Post
    I was just gonna hack the pulse ox that I bought at Walgreens. It's digital so I just decided to use the output, with the Prop Controller, to build the patients vitals output file. Never thought of building one. Nice work D.
    Thanks Dave.

    Just to be clear, I'm far from having built a pulse oximeter. I've wondered if hacking a pre-built device might be the easiest way of getting this data. I've seen some units that cost arount $30 which is inexpensive enough (to me) to qualify as a possible alternative to building one from scratch. I don't know how accurate the inexpensive unitis are though.

+ Reply to Thread

Similar Threads

  1. Code request for developers: SpO2 Sensors - pulse oximetry
    By Ken Gracey in forum General Discussion
    Replies: 7
    Last Post: 07-14-2012, 03:07 PM
  2. Pulse sensor
    By Harley in forum Propeller 1 Multicore Microcontroller
    Replies: 6
    Last Post: 08-22-2010, 09:12 PM
  3. RPM sensor pulse converter
    By electricsmith in forum Propeller 1 Multicore Microcontroller
    Replies: 6
    Last Post: 12-23-2009, 05:08 AM
  4. Pulse sensor question
    By Harley in forum Propeller 1 Multicore Microcontroller
    Replies: 5
    Last Post: 08-19-2009, 02:17 AM
  5. Replies: 1
    Last Post: 11-29-2008, 10:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts