Ideal OpAmps...

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
This turned into a really long post... My question is at the end if you want to skip most of it... A lot of this post is some real world results that I decided to include, just in case it might help someone else in my situation...

I've got some questions about OpAmps. By trade I'm a computer programmer, so the digital electronics world makes sense to me... I've done a lot of home brew PICChip and a couple of Arduino projects and I've dabbled with analog circuitry (mostly for real world input and output, in support of the PICChip and Arduino projects). I know the basic analog theories and how to apply them. But I am having trouble understanding how OpAmp spec sheet data relates to the OpAmp real (or virtual) world behavior. I've been through most of the documentation for OpAmps I could find online and on this site... But I must be missing something...

I'm attempting to construct a circuit to read the output from an O2 sensor using the A2D inputs of a PICChip (actually, I think I have succeeded, but I don't like the method I ended up using to get to the solution). The O2 sensor generates between 8mv to 12.5mv. I am attempting to obtain an accuracy of around 0.1%. So I would like to be able to get about 1000 unique readings over the 8mv to 12.5mv range. To do this, I am trying to amplify the 8mv to 12.5mv signal to around 0v to 5v.

I was able to do this fairly easily using CircuitMaker Student's IDEAL OpAmp5. But when attempting to find an IDEAL OpAmp5 to purchase, I've come to the conclusion that this is a just a virtually perfect device and probably doesn't really exist.

Most of the docs I have read, make this project seem fairly simple to do with just about any OpAmp.

With almost all the other CircuitMaker Student OpAmp models and with my real world tests with OpAmps on the bench, it doesn't seem to work...

Posts I've found on this board seemed to imply that it should work with a LM741, using 1k and 1m resistors. My experiences didn't come close to the expected results using an LM741.

I made up a simple non-inverting OpAmp virtual circuit in the CircuitMaker Student version, to test OpAmp outputs using a 0 to 200mv signal generator and R1 = 1k and R2 = 2k. I'm using Gnd and a simple LM7805 to supply +5v to the power inputs of the OpAmp (I suspect this could be part of my problem, but the spec sheets seem to imply that most of the OpAmps can operate on most any input voltages...).

Here are my original assumptions and a list of the OpAmp models that came closest to the results I was expecting.

Voltage Output = Voltage Input x (1 + (R2/R1))

R1 = 1k
R2 = 2k
Voltage Input, Sine Wave from 0mv to 200mv

Voltage Input = 0mv
Voltage Output = 0mv x ( 1 + ( 2000 Ohms / 1000 Ohms ) )
Voltage Output = 0 x ( 1 + ( 2 ) )
Voltage Output = 0mv x 3 = 0mv

Voltage Input = 200mv
Voltage Output = 200mv x ( 1 + ( 2000 Ohms / 1000 Ohms ) )
Voltage Output = 200mv x ( 1 + ( 2 ) )
Voltage Output = 200mv x 3 = 600mv

Thus the expected result, Voltage Output should be a Sine Wave from 0mv to 600mv

The actual results:

IDEAL OPAMP5 - Looks perfect...

LM2902 - Curve looks fairly close at the top, but the signal appears to bottom out around 325mv (The curve at the bottom is very wide, as if there is some sort of bottom end clipping)

LM324 - Comes close, clean curve, but top output voltage swing isn't as wide as expected (about 50mv to 575mv)

LM358 - Same as LM324

LT1006 - Looks almost perfect, but the bottom of the curve is a little high - but probably can be compensated for...

LT1013 - Looks almost perfect, but the bottom of the curve is a little high - but probably can be compensated for...

LT1014 - Looks almost perfect, but the bottom of the curve is a little high - but probably can be compensated for...

LT1077 - Looks perfect

LT1078 - Looks perfect

LT1079 - Looks perfect

LT1178 - Looks perfect

LT1179 - Looks perfect

LT1217 - Curve and Coverage look good, but is offset by 425mv

LT1223 - Curve and Coverage look good, but is offset by 1.1v

LT1229 - Curve looks almost perfect, but it not quite as wide a range as expected (can probably be compensated for) and the base is offset by 925mv

LT1230 - Curve looks almost perfect, but it not quite as wide a range as expected (can probably be compensated for) and the base is offset by 925mv

LT1253 - Curve looks almost perfect, but it not quite as wide a range as expected (can probably be compensated for) and the base is offset by 675mv

LT1254 - Curve looks almost perfect, but it not quite as wide a range as expected (can probably be compensated for) and the base is offset by 675mv

LT1259 - Curve looks fairly close (hard to tell), but the range might be too wide (can probably be compensated for) and the base is offset by 220mv

LT1260 - Curve looks fairly close (hard to tell), but the range might be too wide (can probably be compensated for) and the base is offset by 220mv

LTC1047- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC1049- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC1050- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC1051- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC1052- Curve looks fairly close (even a little wide at the bottom than

LTC1047-LTC1051), but it not quite as wide a range as expected and the base is offset by 80mv

LTC1053- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC1150- Curve looks fairly close (A little wide at the bottom), but it not quite as wide a range as expected and the base is offset by 70mv

LTC7652- Curve looks fairly close (even a little wide at the bottom than LTC102), but it not quite as wide a range as expected and the base is offset by 80+mv


By doing this trial and error method, I was able to determine that the LT1077-LT1079 and LT1178-LT1179 OpAmps should work for what I want to do... In my final virtual circuit, I ended up using a LT1078. It uses both OpAmp circuits in the chip. I made a voltage divider to generate a 8mv reference voltage and a voltage follower to isolate it from the negative input of the second OpAmp in the LT1078. I use the second OpAmp in the LT1078 as the amplifier.

Using this trial and error method to figure this out seems amazingly wrong to me... In the past I've always been able to look at the spec sheets and figure out what components will work best. But these OpAmps are making me feel like an idiot.

Here is my question...

What am I missing in the Spec Sheets that accounts for the differences I am seeing?

I'm not looking for a detailed description, just a little help, in letting me know what data in the spec sheets I need to apply to the non-inverting formula VO = VI x ( 1 + ( R2 / R1 ) ), to maybe account for the radical differences I am seeing...

Thanks for any insight...
 

Wendy

Joined Mar 24, 2008
23,415
As you have figured out, op amps are a different world. Things like slew rate, frequency response, and other specs are not minor. The old LM324, for example, is among the oldest op amps out there, with a low slew rate and low frequency response.

High Speed Op Amp Query
 

Ron H

Joined Apr 14, 2005
7,063
There are NO op amps whose outputs truly swing rail-to-rail, or even all the way to ONE rail. The LT1078 comes pretty dang close to the negative rail (Ground, in your case). Look at "output voltage swing".
On the input side, there are op amps that can handle rail-to-rail signals, or even higher (or lower). Look at "input voltage range" or "input common mode range".
 

Wendy

Joined Mar 24, 2008
23,415
The LM358 can sense pretty close to rail, along with a few others. I don't know how close the output can go to rail though. Op amps are not digital in nature.

Comparators are truly digital, but I don't think you'd care about those.
 

MrChips

Joined Oct 2, 2009
30,706
Perhaps you are tackling this in the wrong way.
Your O2 sensor puts out 8mV to 12.5mV, a range of only 4.5mV.
You need to subtract the 8mV offset and amplify the signal with a gain of about 1000.
For a resolution of 0.1% you will need an ADC of 10-bits minimum.
Select a 12-bit ADC and adjust your offset and gain to give you some spare room both at the low and high end.
 

crutschow

Joined Mar 14, 2008
34,280
When amplifying such a small signal you need to also look at the offset, offset drift, and noise level of the op amp. You need an op amp where these are all low for your application. A good example is the LT1677.
 

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
Perhaps you are tackling this in the wrong way.
Your O2 sensor puts out 8mV to 12.5mV, a range of only 4.5mV.
You need to subtract the 8mV offset and amplify the signal with a gain of about 1000.
For a resolution of 0.1% you will need an ADC of 10-bits minimum.
Select a 12-bit ADC and adjust your offset and gain to give you some spare room both at the low and high end.
The 12-bit ADC was my first plan. The PIC16F1783s and PIC18LF26K80s, that I ordered, arrived a couple of weeks ago (both with 12-bit ADCs).

When I read about Non-Inverting OpAmp circuits only amplifying the difference between the negative and positive signals and treating whatever voltage was applied to the negative terminal as ground. It seemed like a way to use the entire 0-4.5mv range across the entire 10-bit ADC range (the PIC12s and PIC16s that I usually use, have 10-bit ADCs). That would give me 1024 bits across the entire 4.5mv range. Which is right in line with my requirement of 1000 steps to get 0.1% accuracy.

In my sample circuit for my O2 sensor (not the 0-200mv sample circuit I discussed in my original post), using the LT1078s with a 8mv-to 12.5mv Sine Wave generator, and an 8mv reference signal on the negative pin of the amplifying OpAmp, seems to be generating a pretty good 0-5v range of output from the amplifier OpAmp.. And the output Sine Wave curve of the OpAmp seems to be doing a really good job of matching the input Sine Wave curve of the Sine Wave generator. So I think the 10-bit ADC will work for this O2 sensor.

I do think you are probably right about the 12-bit ADCs being the way to go in the end. In the final circuit, so that I can accommodate different O2 sensors with different mV ranges, and base voltages, I will probably end up switching to 12-bit ADCs and to at least one digitally controlled resistor in my 8mv voltage divider reference signal generator (so I can modify the 8mv signal to whatever is base offset is required by a different O2 sensor). And a digitally controlled resistor for one of the resistors that controls the feedback to the negative terminal of the amplifier OpAmp (so I can change the OpAmp voltage range to handle a different O2 sensor).

This entire excursion into the world of OpAmps has been very enlightening. But I don't think I will truly feel comfortable with OpAmps, until I understand how to apply the information in the OpAmp data sheets to generate the output voltages that I am seeing on the bench and in the virtual circuits.

Though based on some of the OpAmp output voltage curves that I saw, from a simple Sine Wave generator. It is quite likely possible, I may have to come to grips with not ever feeling completely comfortable with OpAmps. And maybe just having to use virtual circuit simulators when I need to decide which OpAmp to pick...
 

Ron H

Joined Apr 14, 2005
7,063
Post a schematic of what you intend to do. You can't make a linear amplifier with a reference signal (8mV, in your case) on the -input pin, unless you are using an instrumentation amp.
 

tpny

Joined May 6, 2012
220
I suspect with such small signal the sensor's output is probably 2 wires - v+ and v-. Connect them to an in amp to get a single-ended output 0~12.5mV and amplify it 400 times to get 0~5V. You need like 3 op amps to get such high gain of 400 - something like 8 x 5 x 10 = 400.
 

Ron H

Joined Apr 14, 2005
7,063
I suspect with such small signal the sensor's output is probably 2 wires - v+ and v-. Connect them to an in amp to get a single-ended output 0~12.5mV and amplify it 400 times to get 0~5V. You need like 3 op amps to get such high gain of 400 - something like 8 x 5 x 10 = 400.
If you don't need bandwidth, INA326 looks pretty good. No other op amps are required, but it is in a surface mount package.
 

tpny

Joined May 6, 2012
220
If you don't need bandwidth, INA326 looks pretty good. No other op amps are required, but it is in a surface mount package.
Don't know why but previously I had tried to get 100x gain from my in amp (ad620) using the specified resistor value but it didn't output 100x gain so had to use op amps for the gain stage instead. Would have loved to have had all that done on 1 chip though.
 

MrChips

Joined Oct 2, 2009
30,706
There are a couple of ways to approach this problem.

You can completely subtract out the zero offset and then amplify the signal.
However, you will need to use a dual supply to get good linearity all the way down to zero.

Another method would be to stick with a single supply voltage but leave a bit of room above 0V. You can either go with a 12-bit ADC or if you want to stay with a 10-bit ADC you may be able to adjust the Vref-low voltage to match the low end of the signal. Do the same at the high end.
 

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
Post a schematic of what you intend to do. You can't make a linear amplifier with a reference signal (8mV, in your case) on the -input pin, unless you are using an instrumentation amp.
Here is a PDF of my current circuit. In the simulator, it appears to work. And on the bread board, with the wrong OpAmps, I have a stable 8mv reference line. But I realize that getting a reference voltage as low as 8mv on a bread board isn't the same as getting it on a battery powered device with a PICChip in the mix...

My initial impression of the INA326 Spec Sheet is that it might be designed for what I am trying to do. I downloaded a Spice model for it, and will attempt to import it into the CircuitMaker Student version, tomorrow afternoon.
 

Attachments

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
When amplifying such a small signal you need to also look at the offset, offset drift, and noise level of the op amp. You need an op amp where these are all low for your application. A good example is the LT1677.
I downloaded the Spice model for the LT1677 and imported it into the CircuitMaker Student version. It turns out to be the perfect example of the confusion I have with OpAmp spec sheets... I'm going to have to dig deeper into its spec sheet. But when I substitute it for the LT1078 in my circuit, its output Sine Wave is very similar. Except the bottom edge of the curve is clipped.

I would really like to figure out how to know the bottom edge will be clipped by looking at the spec sheet...
 

crutschow

Joined Mar 14, 2008
34,280
I downloaded the Spice model for the LT1677 and imported it into the CircuitMaker Student version. It turns out to be the perfect example of the confusion I have with OpAmp spec sheets... I'm going to have to dig deeper into its spec sheet. But when I substitute it for the LT1078 in my circuit, its output Sine Wave is very similar. Except the bottom edge of the curve is clipped.
....................
At what output voltage is the clip point?
 

t06afre

Joined May 11, 2009
5,934
Here is a PDF of my current circuit. In the simulator, it appears to work. And on the bread board, with the wrong OpAmps, I have a stable 8mv reference line. But I realize that getting a reference voltage as low as 8mv on a bread board isn't the same as getting it on a battery powered device with a PICChip in the mix...

My initial impression of the INA326 Spec Sheet is that it might be designed for what I am trying to do. I downloaded a Spice model for it, and will attempt to import it into the CircuitMaker Student version, tomorrow afternoon.
Do you have any datasheet for the sensor. I have a feeling you may be using the wrong approach in this case.
 

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
Do you have any datasheet for the sensor. I have a feeling you may be using the wrong approach in this case.
Here is the spec sheet for the sensor.

It is very likely possible I am using the wrong approach... The sensor has plus and minus leads... And my current plan assumes that since the output voltage is between 8mV and 12.5mV, I can tie the minus lead of the sensor to the ground plane of the circuit... That could be wrong... I may need to tie both the + and - leads to the + and - leads of the first OpAmp... I suspect it might even be possible that I may need to isolate the sensor from the amplifier OpAmp by a couple of voltage forwarding OpAmps... (just in case there might be some form of feedback to the sensor, from the voltage divider resistors that control the amplification of the OpAmp)

I have been thinking about changing the first OpAmp into the amplifier OpAmp and the second OpAmp into the voltage differencing OpAmp. So that the reference input voltage would be higher than 8mV. It seems like a higher reference voltage should have more immunity to random PICChip signal leakage.

This would seem to fit in with the idea of connecting the + and - leads of the sensor to the amplifier OpAmp, before going through the voltage differencing OpAmp.
 

Attachments

Thread Starter

TheCatcher

Joined Apr 28, 2012
13
There are a couple of ways to approach this problem.

...

or if you want to stay with a 10-bit ADC you may be able to adjust the Vref-low voltage to match the low end of the signal. Do the same at the high end.
I haven't checked the specs on my PICChips with 12-bit ADCs. But I don't think the PICChips with the 10-bit ADCs, that I currently have, and usually use, have a Vref-low voltage setting for their ADCs. The spec sheet for the 16f690 mentions a "positive voltage reference" and "The negative voltage reference is always connected to the ground reference." The spec sheet for the 12f510 doesn't appear to have any configurable voltage references, "There is no external voltage reference for the ADC. The ADC reference voltage will always be VDD."

A low and high voltage reference for the ADC would definitely make this a lot easier... This afternoon, I will check the specs on my PICChips with the 12-bit ADCs (and maybe on a few others, that I have easy access too)...
 

Ron H

Joined Apr 14, 2005
7,063
Here is a PDF of my current circuit. In the simulator, it appears to work. And on the bread board, with the wrong OpAmps, I have a stable 8mv reference line. But I realize that getting a reference voltage as low as 8mv on a bread board isn't the same as getting it on a battery powered device with a PICChip in the mix...

My initial impression of the INA326 Spec Sheet is that it might be designed for what I am trying to do. I downloaded a Spice model for it, and will attempt to import it into the CircuitMaker Student version, tomorrow afternoon.
OK, that's not what you described.
That circuit will give you 1001*Vsig -1000*Vref.
 
Top