Problem with Op-Amp Differential Amplifier - Page 1
Forum section: electronics / projects

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 09:27:50 am
content: I want to log a voltage (DC with peaks that I want to visualize) that ranges from 1..25mV.My logger is a NI USB-6001 (10V, 14bit)So I intended to build a preamplifier with gain=100.I took a LM258 and wired it as shown inhttp://en.wikipedia.org/wiki/File:Op-Amp_Differential_Amplifier.svgwith Rf = Rg = 1 MOhm and R1 = R2 = 10 kOhm.Vsupp is 12VWhen V1 and V2 are not connected, Vout shows about 6mVWhen V1 and V2 are shortcut, Vout shows about 118mVThen I matched resistors. This didn't change anything.In principle, I would like to have 0V at Vout when shortcutting inputs.118mV is way to much.Where is the problem?Thanx for supporting!-Didix (beginner ..)

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 09:37:05 am
content: Offset!You choose the "poorer then poor man's opamp."It has a offset off typical 2 mv (datasheet). Yours obviously has 1.18 mv. That gets amplified a 100 times, and that results in a output off 118mV. Not bad at all actually, for this deviceLook for a better opamp, look at Dave's design for the micro current ..

author: janaf
author_rank: Frequent Contributor
timestamp: February 14, 2015, 09:49:36 am
content: A perfect opamp would give 0 on the output with inputs shorted. Real Opamps are not perfect. One characteristic, Voltage Offset or Input offset = the voltage needed to get exactly 0 on the output or the output voltage you get if you short the inputs. Often called Vos in datasheets.The LM258 has an input offset (Vos) specified to max 5mV, see the datasheet.So if you short inputs and multiply the output signal by 100X, you could in worst case get 5mV x 100 = 500mV out.There are opamps with much better offset rating, search for "precicion opamp". They will probably cost a lot more than the cheapo LM258.There are also some opamps that have two extra pins where you can trim the offset to zero.Tell us what kind of frequencies you expect for the signal, slow or fast changes, and what voltage you use for the supply and we may be able to help you. In the mean time, you can look up the datasheet for the LF411. It's an opamp with trim pins and it has moderate bandwidth so it should be easy to implement.

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 11:03:30 am
content: ok, I now see a bit clearer - thanx!I took what I still had in my boxMy logger is a NI USB-6001 (10V, 14bit) and has a max sampling rate of 20kS/sSo I guess that everything from DC to 10KHz would be fine.I already was also thinking about something as a INA122 (Single Supply, MicroPower INSTRUMENTATION AMPLIFIER).Well, this part costs 10x as the LF411.But this would be ok, if it really would beat out the other solutions.But back to the 'normal' OpAmps:You mentioned, that there are ones with two pins to trim out the offset.I guess these are the two addtl balance pins on the LF411?The LF411 unfortunately needs a symmetric Voltage supply.I would prefer Single Supply.Do you by chance know some types, so I could check whether my supplier stocks them?-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 11:56:20 am
content: When it comes to selection a opamp, the choices are endless. Searching atdigikey for op ampgives me 35926 results. From there you have to narrow it down to the device you need or want.

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 12:09:46 pm
content: Quote from: JohnnyBerg on February 14, 2015, 11:56:20 amYepp!You perfectly name it.For somebody new to that, it's like searching for a needle in a haystack.I was just hoping that somebody experienced could give me a hint on that.-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 12:32:07 pm
content: Quote from: Didix on February 14, 2015, 12:09:46 pmI am always very careful about giving "advise" over such a thing. Before you known it your in a war because I like TI devices, and the Lineair fanboys do not agree.That being said, I use the OP07 in some of my designs. It has a low offset by nature, that can be trimmed. It is cheap, and widely available. It is not rail to rail, and needs dual supply.I also used the TLC2652, a chopper opamp. It does not need to be trimmed, can be single rail. Of course better opamp = more money.

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 12:32:29 pm
content: I have 5pcs LM258 on my bench.Now I have measured all of them - both OpAmps per package.Interestingly, all of them have almost no offset on the pins 5/6/7 (~6mV - with gain=100)On pin 1/2/3 only one has the same low offset.The others range up to 140mV (140, 118, 65, 15, 6)Of cours, for my application I picked first the one with 118 ... Murphy's lawHowever, I am still hoping for feedback-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 12:37:31 pm
content: Quote from: Didix on February 14, 2015, 12:32:29 pmBear in mind that the offset voltage is temperature dependent. Nulling your instrument at 20C does not mean it is null at 30.

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 12:43:10 pm
content: Quote from: JohnnyBerg on February 14, 2015, 12:32:07 pmThanx JohnnyBerg!Well, I do not care about TI or Linear as long as my supplier stocks it and the price is fair.The OP07 is available and cheap.However, it needs a dual supply. I still have some hope on thatAs much as I remember there is a trick to simulate dual supply with a single one. I will investigate on that.What do you think about the idea with the INA122 (Single Supply, MicroPower INSTRUMENTATION AMPLIFIER)?-Didix

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 12:45:27 pm
content: Quote from: JohnnyBerg on February 14, 2015, 12:37:31 pmThanx for that !I will definitely use a better one as soon as I get it!Up to then I will experiment with the one I have now.-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 12:51:32 pm
content: Quote from: Didix on February 14, 2015, 12:43:10 pmAccording to thedatasheetit has a typical offset of 0.1 mv. 100x amplified gives a typical output of 10mV. Max offset is 0.25mV (100x = 25mV)Can you live with that?

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 02:34:44 pm
content: Quote from: JohnnyBerg on February 14, 2015, 12:51:32 pmOk, so due to offset the OP07 is better than INA122.I'll get some of these!Anyhow, just out of curiosity:When googling on my problem I hit a couple websites that recommended such instrumentation amplifiers.Why would somebody buy INA122 that costs 30x a OP07?What would be its advantage?-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 02:45:32 pm
content: Quote from: Didix on February 14, 2015, 02:34:44 pmFor single supply I use a ICL7660 to go with the OP07.QuoteI guess every device has its place. Besides the non technical issues like brand or series, there are also some technical. The INA122 is single supply, the OP07 not. The INA122 is Rail to Rail, the OP07 not. Quiessent current of the INA122 is only 60 microA, the OP07 only specifies power consumption. I have not looked at the other parameters, like bandwidth, input impedance, drift etc,

author: Zero999
author_rank: Super Contributor
timestamp: February 14, 2015, 02:46:03 pm
content: Quote from: Didix on February 14, 2015, 02:34:44 pmThe advantage of the INA122 is it already contains built-in matched resistors.The OP07 may have a lower offset but unless you use perfectly matched resistors it will be poorer than the INA122 because of the variance in resistor values.If it's within your budget and dual power supply is acceptable how about the INA114?http://www.ti.com/lit/ds/symlink/ina114.pdf

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 03:55:45 pm
content: Quote from: Hero999 on February 14, 2015, 02:46:03 pmIt is for a single application, so budget is just ok.And thank you to bring me back to the right path: I originally was hunting for the INA128. Since my supplier only stocks it in SO-8 and I need DIP-8 I was searching for a DIP-8 Single Supply. When getting to INA122 I have overseen the fact, that the 3rd amplifier is missing.So yes, I am talking about such an Instrumentation Amplifier - sorry for mixing that up (to much new stuff in my brain ..).Anyhow, I do not give up that fast.Two questions remain for the moment:I partly understand the principle of the matching resistors. And in the INA114 these are adjusted. The OP07 on the other hand has these balance pins. From the discussion here I had thought these are meant to balance the input to get the same effect.And again: isn't there a single supply substitute for the INA114?-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 04:11:43 pm
content: QuoteNope. The OP07 uses those pins to trim the offset.The matched resistors are for getting a known gain. Two complete different things.QuoteSure there is

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 04:53:15 pm
content: Quote from: JohnnyBerg on February 14, 2015, 04:11:43 pmI thought that I have read that matching resistors is necessary to get a high CMRR and then I concluded this has an influence on the gain for the offset.Ok, I think I have to go back to theoryOne question for the moment remains:Why does a device as the INA114 that has a cost of 40x OP07 no balance pins to trim the offset?-Didix

author: paulie
author_rank: Frequent Contributor
timestamp: February 14, 2015, 05:13:18 pm
content: I used OP07 for an ICL7135 input channel expander and PC datalogger project last year and it worked perfectly. Less than 0.003% error with no need for offset pot. At 25 cents each small qty Ebay quite a bargain for precision op amp.

author: sync
author_rank: Frequent Contributor
timestamp: February 14, 2015, 05:19:27 pm
content: Quote from: Didix on February 14, 2015, 04:53:15 pmYou can't compare them directly. The INA114 is an instrumentation amp and the OP07 is a simple op amp. You can build an instrumentation amp with 2-3 OP07 and resistors. But the resistor(network) probably cost more than an AN114. Also the OP07C is dead cheap.And the offset adjustment pins doesn't matter. Electronics usually doesn't have trim pots anymore. If the offset voltage is to high, just use a better part or do software calibration.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 05:34:17 pm
content: @Didix: perhaps you can show a part of your design, its a bit of guessing what you are trying to achieve?

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 05:44:47 pm
content: Well, my original project I stated in the starting contribution:Quote from: Didix on February 14, 2015, 09:27:50 amActually I want to monitor the power usage of a Panasonic Lumix GM5.It is told to consume 'current peaks'.I need to know that to design an optimal external power supply.It should be the best compromise between low weight and high capacity, sinceI go for very long mountain hikes and want to make long time timelapse.Of course, the circuit should also be able to measure other stuff since I bought now an NI USB-6001 to play aroundWhat do you suggest would now be the best fitting solution? (hopefully with single supply)-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 06:05:34 pm
content: Quote from: Didix on February 14, 2015, 05:44:47 pmHmm .. why not use some 20C Lipo batteries, and charge those with a normal simple charger?A 20C battery can deliver huge peak currents, no need for fancy stuff?

author: dannyf
author_rank: Super Contributor
timestamp: February 14, 2015, 06:05:57 pm
content: QuoteGoogle current sense amplifier. It can be done easily with an opamp. Or to use dedicated IC (many of them have a gain of 100x).

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 06:55:54 pm
content: Quote from: JohnnyBerg on February 14, 2015, 06:05:34 pmThank you for looking at the originating problem. But building the PS isn't the issue of this thread. I got lots of idea for that.I'am a very curious person and from the original problem I got drifted off to other ideas.My actual and primary goal in this discussion is how to build a voltage amplifier to measure the drop over a shunt.Quote from: dannyf on February 14, 2015, 06:05:57 pmThat's exactly what I did.Besides specialized chips (which my supplier unfortunately not stocks or is not DIP-8) I thumbled over a lot of sources that talk ...... guess ...... about difference OpAmps and instrument amps.-Didix

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: February 14, 2015, 07:10:51 pm
content: Quote from: Didix on February 14, 2015, 06:55:54 pmRead about Dave's micro current project:http://www.eevblog.com/projects/ucurrent/It does exactly what you are trying to achieve ..

author: dannyf
author_rank: Super Contributor
timestamp: February 14, 2015, 07:51:46 pm
content: QuoteNot quite.

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 08:03:13 pm
content: Quote from: JohnnyBerg on February 14, 2015, 07:10:51 pmYep, that looks good!Especially for low currents.But If I am reading the figures right, I get 25mV for 1250mA ?Since I want to feed my NI USB-6001 (up to 10V), I still would need a gain of 40 to fill my scale?So my amp design project is still ongoing ... or do I get something wrong?-Didix

author: Didix
author_rank: Regular Contributor
timestamp: February 14, 2015, 08:12:07 pm
content: Quote from: dannyf on February 14, 2015, 06:05:57 pmQuote from: dannyf on February 14, 2015, 07:51:46 pmWell, Google tells us a lotThis looks like something specialized to current sense:http://www.linear.com/product/LT6106And I possibly might get to it. I would have to use an adapter from TSOT-23 to DIP-8This could be a different way - seems to be not very precise:www.dx.com/p/acs712-20a-current-sensor-module-blue-206999I guess by 'dedicated' you meant something like that?-Didix

author: dannyf
author_rank: Super Contributor
timestamp: February 14, 2015, 09:10:33 pm
content: QuoteOr its discrete implementation - which looks quite different from what you proposed earlier.QuoteImprecise, but offers isolation.

author: janaf
author_rank: Frequent Contributor
timestamp: February 14, 2015, 09:41:39 pm
content: Quote from: Didix on February 14, 2015, 09:27:50 amIf your power supply shares ground with your signal, then you need to take into account that many opamp inputs do not work all the way down to zero ie as in 0.00mV. If you have 1mV between your signal and the lower supply (battery) voltage, you you may have problems. You need to look into that. Either get an opamp with rail-rail input really works down to 0.0 mV from lower rail. Or somehow make sure there is some headroom between signal "ground" and negative supply.Old opamp types typically work best near the middle point between supply voltages, may eteriorate when closer to a volt from the rail voltage.

author: Didix
author_rank: Regular Contributor
timestamp: February 15, 2015, 06:21:23 am
content: Quote from: dannyf on February 14, 2015, 09:10:33 pmRight! I am on a very steep learning curve for this subject. And it's a great satisfaction to make that progress. And I love this forumI do not only want to solve my problem, I also love to learn new things.So I will follow up on different ways in parallel.Well, if I get it right, the LT6106 is the specialized solution for current sensingand the OP07 would be the pure discrete solution?The INA OP07 is somewhere in between?Comparing OP07 and INA114 still baffles me.Looking not at the price, when would I use an OP07 and when a INA114 (for measuring a current over a shunt) ??Quote from: dannyf on February 14, 2015, 09:10:33 pmI think, I will get one and compare it with other solutions.My Fluke76 is precise but slow, it cannot tell me a peek current but it gives me a baseline for steady current where I could 'calibrate' the signal whichhttp://www.dx.com/p/acs712-20a-current-sensor-module-blue-206999delivers on my NI US-6001.This should give me a reasonable guess, when the current peaks up and the Fluke is not fast enough to get it.Is this conclusion correct?-Didix

author: Didix
author_rank: Regular Contributor
timestamp: February 15, 2015, 06:22:48 am
content: Quote from: janaf on February 14, 2015, 09:41:39 pmGood point! I will take that in account!-Didix

author: dannyf
author_rank: Super Contributor
timestamp: February 15, 2015, 01:29:49 pm
content: QuoteIdeally, a current sense amplifier will need to have a wide common voltage range, sometimes even beyond its supply voltage. That means instrumentation amplifiers are preferred.Depending on your design and limitations you are willing to accept, you can compromise that and use certain opamps.

author: Didix
author_rank: Regular Contributor
timestamp: February 21, 2015, 07:51:41 pm
content: I finally could get an OP97F.Two things from the datasheet I am not shure, whether I am reading it the correct way:(http://www.analog.com/media/en/technical-documentation/data-sheets/OP97.pdf)The output current is limited by the fact, that the output resistance may not be lower than 10kOhm? Right?The Differential Input Voltage may not exceed +-1V. This means, that if Vin+ is at 7V (relative to ground), Vin- must be in the range of 6..8V? Right?-Didix

author: Didix
author_rank: Regular Contributor
timestamp: February 27, 2015, 05:33:08 pm
content: Quote from: Didix on February 21, 2015, 07:51:41 pmHi thereI would be happy if somebody could confirm (or correct) my thoughts.-Didix

author: necessaryevil
author_rank: Regular Contributor
timestamp: February 27, 2015, 08:10:08 pm
content: I only have an indirect answer as I'm not an expert on opamps either. Recently I learned a lot from some app notes, I recommend to search those. A good start would be the "Op Amp applications Handbook" from analog devices. It's available for free (pdf).

author: Didix
author_rank: Regular Contributor
timestamp: February 27, 2015, 09:35:58 pm
content: Quote from: necessaryevil on February 27, 2015, 08:10:08 pmYes, I have read the Data sheet and the app notes. However, the matter is to new for me, to understand all of that at once.Thanx for the link to the book. I downloaded it and will look at it.However, it seems to have about 1'000 pages and I still would be happy to proceed on my project before finishing the bookTherefore - my question is still open ..-Didix

author: janaf
author_rank: Frequent Contributor
timestamp: February 28, 2015, 10:13:50 am
content: 10kOhm is an example. Look at figure 14 in the datasheet and you will see that performance starts degrading below 3kOhm load. The "Supply Current" like 400uA, is without output load. Some opamps will survive shorted outputs, some wont. If not explicitly stated in the datasheet, then keep load at a few kOhm or more.Inputs; yes, you are right. But inputs will "automatically" be close to 0 from each other with normal feedback. That's how op-amps are usually used.Quote from: Didix on February 21, 2015, 07:51:41 pm

author: Didix
author_rank: Regular Contributor
timestamp: February 28, 2015, 09:51:54 pm
content: Quote from: janaf on February 28, 2015, 10:13:50 amThanx a lot !-Didix