Offset voltage of LM358 - Page 1
Forum section: electronics / beginners

author: npelov
author_rank: Frequent Contributor
timestamp: June 07, 2013, 07:16:15 pm
content: Hi!I watched Dave's opamp input voltage offset / input bias current videos. I decided to try to measure the offset voltage of an LM358. It should be quite high (not the most precise opamp out there). So I connected basic non-inverting setup of one of the opamps. It is powered by battery + LM2577 step up to 5V (measured 5.060V), filtered to about 5-10 mV p-p. Then I connected (+) input to ground. As a gain resistors I used 10 turn 5k trimmer. I measured it 4855 Ohms. So Rg ~48 Ohms would give me gain about 100. Then the input offset voltage (typ 2mV) would be multiplied by 100 -> 0.2V. Yes, I know that it could be worse or bettern than 2 mV.Well I measured 3 mV on the output. there is a slight chance that (if the earth, moon and the sun line up correctly) that the offset is really 20uV. Miracles happen. But if I set the gain to 10 then I shouldn't be able to measure anything with my multimeter. I measure again 3 mV. So no matter what gain I set I get 2-3mV.I tested the gain with 1:10 divider so I got 50mV from the power supply on the (+) pin. Win the 10 gain I succesfull ymeasured 0.503V.Any ideas why the offset of the output is not affected by the gain. I checked the schematic few times. It looks correct, but I've been wrong before.Here is the circuit:http://www.circuits.io/circuits/3939Any idea why I can't measure the offset voltage? What I'm doing wrong?

author: kfitch42
author_rank: Frequent Contributor
timestamp: June 07, 2013, 07:32:02 pm
content: disclaimer: I am a newb.It looks like you are running it from a 'single sided supply' (i.e. 0v and 5v) and then trying to set the input to 0V . In the video Dave used a dual supply -2.5V and +2.5V and then set his input to the middle of the range, 0V.In the data sheet for the LM358 it has a parameter Vol (low level output voltage), spec'ed at 5mV typ. 20mV max. I suspect this is what you are running into.

author: npelov
author_rank: Frequent Contributor
timestamp: June 07, 2013, 08:26:28 pm
content: newbs are welcome too.LM358 is meant to work with single supply as well as split supply. I'm not sure how this affects input offset voltage, but I'm pretty sure it doesn't zero it. It shouldn't magically match the input transistors.Vol is something that I didn't think of. I don't know what Vol and Voh are, but my guess is that it's deviation from 0V (ground) and positive rail(V+). I'm not sure if these applies for 0 < Vout < Vcc-1.5V. So for non-inverting setup with Vin+ = 0V if I have those 3mV and they are the Vol value then input offset voltage = 0.000V ... which of course is not very likely the case. So I made a mistake somewhere.But thanks for the Vol tip.

author: npelov
author_rank: Frequent Contributor
timestamp: June 07, 2013, 08:59:40 pm
content: ok. I've made virtual ground - 2.5V using a divider and the other opamp. I connected V+ to the virtual ground and I measured Vout relative to the virtual ground. Guess what - 1.2V exactly. Currently the gain is 100, so the offset voltage is 12 mV. Higher than the 5 mV by specification but (last video) Bias current, offset current ... etc. it's not pAmps, but nAmps...I discovered OpAmps not long ago ... I'm a programmer who's very interested in electronics too, but I don't have that much experiense with electronics.So would someone that knows opamps better tell me if input offset voltage only applies to split supply? Maybe the question is wrong.Does the input offset voltage affect single supply non-inverting setup?

author: IanB
author_rank: Super Contributor
timestamp: June 07, 2013, 09:17:57 pm
content: It's not a question of single supply or split supply. It is a question of the input voltage range and rail-to-rail input ranges.Any op amp in your circuit has power supply rails, call them V- and V+. It doesn't really matter whether you call these 0 V and 5 V or -2.5 V and +2.5 V, the op amp is still going to see a 5 V supply.Now the op amp has operating limitations. One of the limitations is the allowable range of input voltages. For example the op amp may specify an input voltage range of (V-) + 1.0 at minimum and (V+) - 1.0 at maximum. If this is the case and you set the inputs equal to V- you cannot expect the op amp to work correctly.Some op amps specify operation right down to the V- rail, or up to the V+ rail, or both. However, even with a rail-to-rail op amp you may expect degraded performance if you go right up to the rails. For best results it is usually better to stay in the middle of the range.

author: npelov
author_rank: Frequent Contributor
timestamp: June 07, 2013, 10:17:18 pm
content: LM358 specifies input voltage range 0 - (V+ -1.5), so the input can go to V-. I actually heard that also in a video (not sure if it was Dave or someone else). And yes, it can't go to 0 volts, but it goes pretty close to 0 -> 5mV. But these 5mV are offset in the output (thanks kfitch42 for reading the datasheet better than me). That's confirmed when I change gain - it stays the same. Lack of input offset voltage in single supply mode is what can't understand.One correction about my split supply schematic. I forgot to move Rg to the virtual ground. I did it now and the schematic looks like this:http://www.circuits.io/circuits/3941Measuring the voltage with V+ connected to virtual ground gives about 10-11 mV with gain=10 and -0.112V with gain=100 ... which means -1mV offset. Now it looks as described in datasheet although I'm not sure why is the - sign. But why there is no significant voltage offset when it's referenced to V- instead of the virtual ground?

author: daveatol
author_rank: Regular Contributor
timestamp: June 07, 2013, 10:41:54 pm
content: The offset does not have to be positive. If you're using a single rail and connecting the +ve to GND (and negative feedback circuit referenced to GND), if the input offset (ref -ve input) is -positive, you'll get an output voltage greater than the minimum. If the the offset is negative, then the output will be the minimum (which is clamped to GND).

author: mikec
author_rank: Contributor
timestamp: June 07, 2013, 10:55:52 pm
content: Hi,Just to clarify the Rf is the trimmer set at 4.8k and the Rg is a 48ohm not 48kohm as in the schematic?Actually I had done the same test on a LM358 using the circuit shown in the pdf here:http://www.analog.com/static/imported-files/tutorials/MT-037.pdfFor the input resistors I only had 27ohm resistors and I used 10k resistors for the rest.Now it gets interesting because I seem to have LM358 from different suppliers and these are the results I getLM358N CKTR0217 MEASURED OUTPUT = 44mV therefore a Vos=118uV (not sure who the manufacturer is on this one)LM358AN JC79RB MEASURED OUTPUT = 394.5mV therefore a Vos=1.059mV (appears to be a national semi part)LM358AN JC79RB MEASURED OUTPUT = 332.1mV therefore a Vos=.895mV (again from national semi)So it is possible that you have a "non-standard" lm358 part, maybe you need to check for a different datasheet? When I did the test first with the first lm358n listed above I was very surprised and to be honest wasn't sure if I was getting the right figures becuase I was reading the same typical Vos mentioned in the datasheet of 2mV. Now that I have tested the other 2 parts is it unreasonable to assume that another manufacturer just happens to make a better LM358? I have literally in the last hour just realised after reading your post and redoing the test, so I must do a bit of digging around on the N and AN 358 parts to better understand what is going on here.I would be interested to see what you get and if you see any difference using the circuit in the link?mike

author: npelov
author_rank: Frequent Contributor
timestamp: June 08, 2013, 08:38:22 am
content: I'm sorry. I didn't know how to draw trimmer on circuits.io. The trimmer is both Rf andRg. Middle point is connected to V-, one end to Vout, the other to ground (either V- or virtual ground depending on the schematic).With different parts it's possible to get different results - even with the same manufacturer. There is no minimum in datasheet of Vos, so if you are lucky you can find a one with quite lower Vos.My case is different. I find literally zero Vos in single supply mode.I will try the schematic from the link. It looks like it discards input bias currents.Also I'll try different chips (I'm using IC socket). I have bought few - it's quite useful even if it's not that precise.

author: npelov
author_rank: Frequent Contributor
timestamp: June 08, 2013, 09:22:08 am
content: Found the problem... I measured 8 chips. Vos is always negative:-1.74mV-2.35mV-0.78mV-2.34mV-0.15mV-0.12mV-0.68mV-0.70mV(Not exactly because I didn't take input currents)So in single supply setup ... well it can't go below 0. That's why I only see Vol. I supplied 5mV to Vin and guess what I found for the one with Vos=2.35mV -> Vout was 0.340V, not 0.500. That's 160mV less. Of course It's not close to 240, but my gain is not exactly precise and there are other factors, so I'll do the schematic that mikec suggested.

author: npelov
author_rank: Frequent Contributor
timestamp: June 08, 2013, 11:18:51 am
content: I did thetest circuit from herebut with 10ohm/1k -> 101 gain. I got slightly different values (not in the same order) (output, which is Vos*100):199mV56mV94mV65mV198mV12mV145mVSo, I got the worst one - with Vos = 1.99 mV and I changed gain to 1000 (10Ohm/10kOhm). result is 1.82V or Vos = 1.82mV.But then I made a divider with 10Ohm/100k and conected it to Virtual ground and Vcc to get about 2.5V / 10,000 = 0.25mV I connected Vin+ through 10||10k to this divider. So an ideal OpAmp should give me 0.25mV * 1000 = 0.25V. I measuredVout=-1.723V(of course relative to virtual ground). with the voltage measured before -1.820V this gives me a value:Vout =0.09which is less than half.So I tried to think where this error comes from (that's my thinking, correct me if I'm wrong). We discard Ibias, so it should be Ios. It's from 5 (typ) to 30nA (max). Let's say that Iin+ = 0 becausethe schematicshould discard input currents, then Iin- differs from Iin+ with 5 to 30nA. The voltage drop on Rf which is 10k -> 5nlA*10k = 5uA*10 = 50uV. So the voltage on Vin- is 50 to 300uV higher (or lower) than Vin+. That's And we are trying to measure 250uV (VGND to V+ /10,000). If everything else was spot on - resistors accuracy, voltages ... (which is not the case) we can calculate Ios. Taking into account Vos = -1.820mV we measure 0.09,which is 90uV * 1000. So Ios should be (+-) 16nA.I'm doing all this to understand opamp parameters and how to compensate the errors. I would be greatful if someone tells me when I'm wrong.What I want to try next is to try to measure all these parameters and discard them all. I could measure 1% resistors and find the best ones, I could use accurate voltage from a Voltage reference. The idea is to have experience with opamp parameters. For the fun I could make a tool that measures all these parameters for specific setup (supply voltage and temperature) and a program to show the value of components required to discard the errors. I think that's a great way to know opamps better and if other unexperienced nerds join we could share results.

author: Rufus
author_rank: Super Contributor
timestamp: June 08, 2013, 11:53:59 am
content: Quote from: npelov on June 08, 2013, 11:18:51 amRemember op-amps do not have infinite gain. The LM358 is specified at 15V/mV minimum with 15v supply and for output between 1v and 11v. That means a 1.5v change in output requires 0.1mV more between the inputs.The large signal gain looks like it reduces by a factor of 50 on a 5v supply.

author: npelov
author_rank: Frequent Contributor
timestamp: June 08, 2013, 12:51:59 pm
content: Thanks for that tip. I'm having dificulties undertanding Large Signal Voltage Gain.If I have 1.5mV and I want to multiply it by 1000 to get 1.5V it'll actually require 1.6mV on the inputs to get 1.5V on the output. So if I reverse that, the 1.5V on the inputs will give 1.4V on the output, right? Is this the reason I'm getting about 150-160 uV less with gain = 1000? If I have to do that would it help if I use 2 OA in series?

author: Rufus
author_rank: Super Contributor
timestamp: June 08, 2013, 01:41:22 pm
content: Quote from: npelov on June 08, 2013, 12:51:59 pmMore like when you try to multiply by 1000 you actually only multiply by 938.For an open loop gain A and ideal closed loop gain B the actual gain will beA/(1 + (A/B))A is very variable. For the LM358 about 1:4 spread between parts, 50:1 change with supply voltage. It drops with output loading and some undefined drop at the extremes of output voltage. A also drops rapidly with frequency, for the LM358 down to 1 at 1MHz.To be accurate you need to keep A/B very large which is why it is not practical to get accurate large gains like 1000 from a single op-amp stage.

author: miceuz
author_rank: Frequent Contributor
timestamp: June 08, 2013, 03:06:07 pm
content: Quote from: npelov on June 08, 2013, 08:38:22 amYou are hitting Vol. Rail to rail output simply is a lie. Usually the lowest and highest opamp output voltages are millivolts from real rails. And I bet it changes with common mode voltage.With your split supply configuration, make a middle (virtual ground) point selectable by a potentiometer and try moving it up and down a bit. I bet you will see offset voltage change. And you will probably be able to see where does the offset gradually "disappear" when moving virtual ground closer to V- (i.e. changing to "single supply" configuration)

author: npelov
author_rank: Frequent Contributor
timestamp: June 08, 2013, 10:35:57 pm
content: @RufusI didn't quite get this formula:A/(1 + (A/B))It would help me if I knew how to calculate possible gain error from datasheet values of Large Signal Voltage Gain.@miceuzwell yes, you are right. It doesn't go exactly to 0V. That's why split supply measure discards near-to-rail problems. Especially in my case when the offset was negative. Even if the opamp was ideal and it could go down to negative rail it still wouldn't go behind it. I'll be more careful when I reach rails next time.

author: npelov
author_rank: Frequent Contributor
timestamp: June 09, 2013, 08:37:01 am
content: Ok. So open loop gain is 15 000 (at least).If we choose gain = 100 (which is still high for this op amp) we'll have:15000/(1+15000/100) = 99.33So 1mV would be amplified to 99.33 mV which is about 1% accuracy if we compensate most of the other errors.Is it worth to try to measure this and compensate it for specific voltage by choosing a bit higher gain? Or just pick better opampFor example MCP606 has 100dB which (if I understood correctly) means 1000 on every 20 dB-> 1000,000,000,000,000. So if we choose gain 1000:10^15/(1+10^15/1000) = 999.999999999000That's quite close

author: npelov
author_rank: Frequent Contributor
timestamp: June 09, 2013, 11:55:54 am
content: Here is my attempt to zero offset of MCP6142:http://www.circuits.io/circuits/3960Gain is 10, Power 5V, using one of the opamps for virtual ground. There is actually series resistans 10ohm||1k on the Vin+, but it doesn't actually matter with the 1pA Ibias.So I zero the output with Vin+connected to Vground. Then I connect Vin+ to a divider 100k/1k which gives 25mV and I get something quite far from 2.5V - like 2.1V (don't remember exactly)

author: mikec
author_rank: Contributor
timestamp: June 09, 2013, 01:38:39 pm
content: HiWhen I finally setup the LM358 with positive (+10) and negative(-10) supply I did get a different offset value. For the LM358N that I was previously getting an offset of around 118uV, now with the positive and negative supply I get -16uV. Although the op-amp seems to warm up over a minute or so and the offset drifts upwards to around +30uV.I am glad you posted this thread here npelov now that I know I missed something important in my first test regarding the supply voltages affecting the result.Anyway thought I would share this article by Texas instruments which explains that Vos is effected by the common-mode input voltage and in fact shows graphs for bi-polar and cmos opamps).. see here (page 14 and 15):http://www.ti.com/lit/an/sloa059/sloa059.pdfCan't find it for the LM358 though.Not to hijack your thread but this leaves me with the question... are the effects that we found with the single supply more related to1. Hitting the Vol (when Vos is negative)?2. Had a large common-input voltage?3. Both and are pretty much the same thing?I was studying your schematic, how are you getting the 2.5V from the first opamp?mike

author: Rufus
author_rank: Super Contributor
timestamp: June 09, 2013, 02:40:16 pm
content: Quote from: npelov on June 09, 2013, 08:37:01 amOpen loop gain will vary with many things so you won't get great accuracy trying to compensate for it just better accuracy. An overall gain calibration which compensates other things including resistor ratio errors is often worth while.20db is a factor of 100, 100dB is 10^10.Quote from: npelov on June 09, 2013, 11:55:54 amI don't see all the component values but it looks like the circuit has problems. The 2 x 2k5 resistors are a pot that you use to trim the output to 0 for 0 input? The effective RG isn't 10 ohms, it is 10 ohms + the 75k and R4 in parallel so the gain isn't 100.You should search the web there is lots of material on op-amp circuits. You could also try simulating some of this stuff. Simulation models often don't model error terms realistically, however, simulating with a perfect op-amp model would at least show you how the circuit is supposed to work without the errors.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: June 09, 2013, 03:05:47 pm
content: QuoteQuoteYour talking power dB when you should be talking amplitude dB.https://en.wikipedia.org/wiki/Decibel#Field_quantities

author: npelov
author_rank: Frequent Contributor
timestamp: June 09, 2013, 10:46:34 pm
content: Quote from: HackedFridgeMagnet on June 09, 2013, 03:05:47 pmI'm not 100% sure. It's written "DC Open-Loop (Large signal)", marked AOL. Is this the power gain or amplitude gain. They give it for different loads, but it coud still be amplitude.Anyway, thanks for correcting me on the dB - learned this a week ago and I would have remember it wrong if you didn't correct me.I showed the values on thecircuit. 2.5+2.5k is 5k trimmer. That's the circuit I found in a datasheet as app. note. I'm really confused about these resistors. I can't really find out how they are connected because some are connected to -V, some to GND. How do you know that Rg is summed with R3||R4? And why is it not summed with down side of the trimmer RPOTb.So maybe I scaled the values in a wrong way. In the schematic R4 was like 100 Ohm, but Rg was quite higher. Maybe that's the reason it didn't affect it. However I wanted low value for Rf in order to have lower effect of Ibias.(btw I found out that you can zoom the circuit with scroll and drag with mouse by left clicking.)

author: npelov
author_rank: Frequent Contributor
timestamp: June 09, 2013, 11:01:12 pm
content: Quote from: mikec on June 07, 2013, 10:55:52 pmI don't think so. I think it's the same from any manufacturer. You just got a better one. If you look at my measurements of 8 chips of the same manufacturer you'll see from 120uV(!?) to 2mV ... and only 3 of them were higher than 1mV. Although there are few slightly different variants on my datasheet LM358 and LM358A - first is 2/7 (typ/max) theother is 2/3. My chips are LM358N - I guess N is for the package type. So it's LM358N and LM358AN - for DIP package.Quote from: mikec on June 07, 2013, 10:55:52 pmVoltages measured in above posts are done in this circuit. Of course as Rufus mentioned 1000 is too much for the poor LM358, so I used ... hmm I don't remember, but it's gain of 100. Maybe 10k/100 ohm or 1k/10Ohm. So the measured values are (I posted the Vout values in above posts):1.99V560uV940uV650uV1.98mV120uV1.45mV

author: Rufus
author_rank: Super Contributor
timestamp: June 09, 2013, 11:36:05 pm
content: Quote from: npelov on June 09, 2013, 10:46:34 pmTwo resistors as a voltage divider can be replaced by an exact equivalent (look up Thevenin's theorem) of a resistor equal to the parallel combination of the two a voltage source of the same value.The pot in its mid position looks like a 1k25 resistor connected to a voltage source. That is in series with the 75k and the pair can be replaced by a 76k25 resistor. Now you have another voltage divider from 76k25 and 120R which can be replaced by a 119.69R resistor. The 120R value you didn't previously show dominates.That 119.69R is in series with the 10R so RG is effectively 129.69R and the amplifier gain is nowhere near what you thought it was.

author: megajocke
author_rank: Regular Contributor
timestamp: June 10, 2013, 04:05:12 am
content: Quote from: npelov on June 09, 2013, 10:46:34 pmIt's voltage gain. Among other things, input impedance of an op-amp isn't well specified so it wouldn't make much sense to specify power gain. Not to mention that the quantity that is useful to know is the voltage gain.So the 100 dB value in the datasheet means you have a voltage gain of 10^5.

author: npelov
author_rank: Frequent Contributor
timestamp: June 10, 2013, 08:17:56 pm
content: @Rufus So I only need to buffer it through one opamp and make sure the range also includes it's voltage offset. Then I'll have a good Vos correction because the output impedance of an opamp is quite low. I guess the other way is to calculate Rg to add the divider value ... or choose divider in a way to exactly match Rg (and short Rg).@megajocke 100 dBis 10^5? But Rufus said that 20db is a factor of 100, 100dB is 10^10, so who's right?Also, looking atLM358 datasheeton page 8, figure 5, there is a graph for AVOLto frequency relation. if you get DC (<1Hz) you'll see that the value is 110 dB, which is ... 10^11? Well at least between 10^10 and 10^12. This means that open loop gain is ~ 100 000 000 000.So can you tell me the difference between the value of AVOLwhich is given in dB and Large Signal Voltage Gain which is given as V/mV (or V/uV) - for LM358 it's 25V/mV at room temp or 15 at full temp. range. I thougt it's the same thing, but looks like it's not.

author: Rufus
author_rank: Super Contributor
timestamp: June 10, 2013, 11:43:54 pm
content: Quote from: npelov on June 10, 2013, 08:17:56 pmYes but you will have Vos and bias drift in the buffer so it is probably better to still have a divider after the buffer. The divider can replace Rg. A 1k and 10R divider for Rg is only 1% different from a straight 10R.Quote from: npelov on June 10, 2013, 08:17:56 pm100db is actually 10^9 - my sloppiness. The graph is showing gain change with supply voltage. If the absolute values are supposed to be realistic they look ridiculously large. The data sheet does not specify any maximum Avol but some typicals at 100V/mV or 10^5 or 60db.dbs are just 10 * log(ratio). The confusion with power is due to power being proportional to V^2 so x10 voltage (+10db) produces x100 power (+20db).

author: npelov
author_rank: Frequent Contributor
timestamp: June 24, 2013, 12:03:43 pm
content: Does input offset voltage vary when gain is changed? I mean input offset voltage, not multiplied offset on output. I ask because I want to have 2 gain resistors - one for "normal usage" - let's say gain = 100 and one for offser zero (to set gain to 1000 or more). So if I zero offset voltage with gain = 1000 to <=0.1uV will the offset voltage stay the same if I set gain to 100:1. using Rgain2. using both Rgain and RfbLet's say that Ibias and Ioffset are corrected.I'm mostly asking about opamps with offset zero inputs like OP07. It's quite hard to measure offset in microvolts.