Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LM358 as a comparator (Pulse-oximeter)

Status
Not open for further replies.

dhananjaya

Newbie level 2
Joined
May 22, 2009
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,308
lm358 comparator

I designed a pulse oximeter and it's working fine with LM 358 as the aplifier. But the output I get is only 3.68v. I tied this to an LED through a resistor so I can visually see the heart beats.

But I can't read this output from PIC 16f877. So I used another LM 358 as a basic comparator and tried to get a 5V pulse. But still the output I get is 3.6V.

What can be the reason? Can someone help?

These are my circuit pins.

LM 358
V+ (Pin 8 )= 5v
GND(Pin 4)= GnD
VA+ (Pin 3) = Input (3.6v)
VA-(Pin 2) = V reference 1.5V
Vout (Pin 1)
 

lm358 as comparator

The LM358 is not a rail to rail opamp. What this means is that it cannot swing its output pin to the power supply rail. Basically the upper transistor can not be saturated, so it always has some voltage drop.

The options are either switch to an opamp that does have rail to rail output, or try adding a pullup resistor to the Vout pin of the comparator. Place and 10K resistor from pin 1 to +5V. When the comparator is driving high, this should increase the max output voltage. When the comparator is supposed to drive low, the opamp can easily sink the extra current provided by the pullup resistor.

If the pullup resistor does not work for you, look for a rail to rail opamp in the same pin configuration and package. When reading the spec sheets, look at the maximum voltage swing parameter to determine how close to the rails you can swing.
 

lm358

The PIC can read both HIGH and LOW so why not make things simple and use a 2N3904 or similar and modify the software ?
 

pulse oximeter circuit diagram

Hi guys, I managed to solve the problem. Thanks for the advices and help.
 
lm358 voltage comparator

can you give me the circuit diagram you are using ?
 

comparator lm358

a 877 will have sufficient current capabilities to drive most leds. and if that doesn't work (for example you have a super duper HB led), you can use a small transistor (2n55551/5401) to buffer it. no reason to resource to something like an opamp.

edit: on 2nd read, you are trying to read the output, digitally?, via the pic. 3.6v should be enough to trigger a logic 1 for a pic.
 

Hey,
I am trying to design a pulse oximeter for a project i am working on, i saw one of your posts, and i think you could maybe help me..

you mind helping me out?

Thanks
 

Where can I get the FULL schematic to the pulse-oximeter?


-toby7
 
  • Like
Reactions: kuscu

    kuscu

    Points: 2
    Helpful Answer Positive Rating
Re: lm358 comparator

dhananjaya said:
I designed a pulse oximeter and it's working fine with LM 358 as the aplifier. But the output I get is only 3.68v. I tied this to an LED through a resistor so I can visually see the heart beats.

But I can't read this output from PIC 16f877. So I used another LM 358 as a basic comparator and tried to get a 5V pulse. But still the output I get is 3.6V.

What can be the reason? Can someone help?

These are my circuit pins.

LM 358
V+ (Pin 8 )= 5v
GND(Pin 4)= GnD
VA+ (Pin 3) = Input (3.6v)
VA-(Pin 2) = V reference 1.5V
Vout (Pin 1)

Hi dhananjaya, My name is ANDY. I’m very interested in the extraction of SPO2. Now, I am trying to make a Pulse Oximeter circuit. But you know it is very difficult for a newbie! Could you give me some advices?
Any help is appreciated.
Thanks a lot!
yours sincerely,
Andy
 

Re: lm358 comparator

Did anyone get a reply on the final circuit or at least could you tell us how you solved this issue? I was going to go the with the lm358 but found an AD design which I might start with instead. I would also like to consider using a microcontroller since I would like to do alarms and displays in a small package.

Thanks for your help!
jason
 

Re: lm358 as comparator

The LM358 is not a rail to rail opamp. What this means is that it cannot swing its output pin to the power supply rail. Basically the upper transistor can not be saturated, so it always has some voltage drop.

The options are either switch to an opamp that does have rail to rail output, or try adding a pullup resistor to the Vout pin of the comparator. Place and 10K resistor from pin 1 to +5V. When the comparator is driving high, this should increase the max output voltage. When the comparator is supposed to drive low, the opamp can easily sink the extra current provided by the pullup resistor.

If the pullup resistor does not work for you, look for a rail to rail opamp in the same pin configuration and package. When reading the spec sheets, look at the maximum voltage swing parameter to determine how close to the rails you can swing.



what is the meaning of upper transistor? and why isn't it getting saturated?
from where do we get the voltage drop? please explain,i'm totally new to using lm-358.:???:
 

The datasheet for the LM358 is easily found via Google.

Referring to the National Semiconductor datasheet dated October 2005 located at Cornell U (it's the 4th one down in a google search for LM358 datasheet).

If you look at page 3 thereof, you will find the manufacturer's specification for the range of Vout.

For a supply voltage of 30V, the closest Vo is guaranteed to get is 26V.

Typically (which you should not rely on for design purposes), the maximum is 28V.

On page 20, you find a representative circuit diagram of one amplifier.

The output uses a darlington pair as the upper half of the output circuit, which has a minimum Vsat of about 1.5V or so.

This, then, explains why the output will not reach the positive supply rail.

Using an external pullup resistor may assist in increasing the value of Vout.

HTH.

I trust this is not regarded as a "Useless Post".
 

The datasheet for the LM358 is easily found via Google.

Referring to the National Semiconductor datasheet dated October 2005 located at Cornell U (it's the 4th one down in a google search for LM358 datasheet).

If you look at page 3 thereof, you will find the manufacturer's specification for the range of Vout.

For a supply voltage of 30V, the closest Vo is guaranteed to get is 26V.

Typically (which you should not rely on for design purposes), the maximum is 28V.

On page 20, you find a representative circuit diagram of one amplifier.

The output uses a darlington pair as the upper half of the output circuit, which has a minimum Vsat of about 1.5V or so.

This, then, explains why the output will not reach the positive supply rail.

Using an external pullup resistor may assist in increasing the value of Vout.

HTH.

I trust this is not regarded as a "Useless Post".

thanks a lot for your answer. But i still have a couple of problems:
1>can we use a pair of silicon diodes as bias voltage to raise the output voltage level?
2>can we use a 1M resistor as the feedback resistor? Is this value too large? Will it cause any sort of loading effect?
 

thanks a lot for your answer. But i still have a couple of problems:
1>can we use a pair of silicon diodes as bias voltage to raise the output voltage level?
2>can we use a 1M resistor as the feedback resistor? Is this value too large? Will it cause any sort of loading effect?

1) Don't understand what you mean by using a pair of silcon diodes.

Standing the negative rail on a pair of diodes won't get the output voltage any closer to the positive rail.

2) A 1M feedback resistor is ok. I've used 10M and 20M in the past. It may well increase the offset voltage though, due to the input bias current.
 
  • Like
Reactions: digi

    digi

    Points: 2
    Helpful Answer Positive Rating
1) Don't understand what you mean by using a pair of silcon diodes.

Standing the negative rail on a pair of diodes won't get the output voltage any closer to the positive rail.

2) A 1M feedback resistor is ok. I've used 10M and 20M in the past. It may well increase the offset voltage though, due to the input bias current.

you got what i meant. I thought of getting two diodes connected to the negative rail. Since generally diodes have a barrier potential of 0.7volt at the p-n junction, then two diodes will make it 1.4 volts. Please explain why it wont work, i am really new to these type of circuit design and am having a lot of problems.

---------- Post added at 20:01 ---------- Previous post was at 19:30 ----------

what will happen if the offset voltage increases?
 
Last edited:

you got what i meant. I thought of getting two diodes connected to the negative rail. Since generally diodes have a barrier potential of 0.7volt at the p-n junction, then two diodes will make it 1.4 volts. Please explain why it wont work, i am really new to these type of circuit design and am having a lot of problems.

---------- Post added at 20:01 ---------- Previous post was at 19:30 ----------

what will happen if the offset voltage increases?

It won't work because the amplifier output voltage still won't get closer than 2V or so to the positive rail.

All the two diodes will do is reduce the output voltage swing so that it no longer includes the negative rail.


The offset voltage just causes an offset on the output voltage caused by the bias current that makes the input bipolar transistors work.

This bias current is quite low at about 100nA maximum, but with a 10M feedback resistor, it's enough to give you some offset on the output.

It's generally a good rule of thumb to make the resistances on the + and - inputs roughly the same to minimise the offset on the output caused by the input bias currents.

Most of the time it doesn't matter a lot unless you are striving for accuracy, whereupon the question arises of why you selected a LM358 in the first place (coz it's cheap & cheerful).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top