Opamp mystery

Each day, I learn something new.

I designed an ammeter circuit which passes the current through a 0.05 ohm resistor, measures the voltage drop across the resistor, and uses an inverting opamp amplifer to amplify the voltage drop. The opamp output voltage is then fed to an ADC and communicating with an Arduin UNO.

The opamp is configured with the positive input biased to 0.24 v. to avoid negative outputs. (This is a single-sided circuit.) When I simulate this circuit with an LM358, the outputs stay within about =/- 10 mv. of theoretical.

The simulator uses SPICE models, which do account for the input offset voltage Vio of the opamps. So here's the mystery: when I substitute a very low Vio opamp (OP07A, Vio = 10uV) for the original LM358 I used, the output errors are more like 1 volt! Any clues as to what's going on here ?

Thanks in advance for any help.

Dont think you can get away with this using an inverting circuit, you need to wire the shunt resistor as a 4-terminal resistor and use a differential opamp circuit referenced to the ADC ground. You cannot assume there is a single universal ground voltage in a high current
circuit (because there isn't).

What's the voltage gain of your circuit? My "gut feeling" is that gains of 1000 or more are "difficult". And DC is more difficult than AC, since with AC it's easy to filter-out offset & drift.

when I substitute a very low Vio opamp (OP07A, Vio = 10uV) for the original LM358 I used, the output errors are more like 1 volt!

In a high gain circuit, that might be "normal". How would you characterize that error? If it's a constant DC offset (bias), you should be able to calibrate it out (in hardware or software).

There are 4 or 5 different types of error in a measurement like this:
1. Offset - This is a constant-voltage or constant-count error. For example when you are measuring volts, you might always read 1 Volt high. It is normally calibrated-out by "zeroing" (adjusting your system so that zero reads zero).

2. Gain - This is percentage-of-reading error. For example, your reading may be a constant 10% high. This is normally calibrated-out by adjusting the gain so that the maximum-range reads correctly (after zeroing).

(Offest and gain adjustments are standard in just about every measurement calibration.)

3. Nonlinearity - Once the zero & maximum are reading correctly, intermediate readings may be high or low. With software, you can make one or more different gain adjustments to different sections along the range. But, this kind of calibration-adjustment is not that common. It's usually not needed and it's only used when high-precision is required. And, it's only useful when noise & drift are lower than the non-linearity. Where I work, we have a digital-to-analog converter that's calibrated at 100 or more points along the slope. (This can get tricky, because there can be discontinuities where the gain suddenly changes.)

4. Noise - Random variations. Sometimes you can reduce the noise pickup/input, sometimes you have to build a lower-noise circuit (if possible).

5. Drift - Slower variations or lower-frequency noise. The system may read high for awhile, and then start reading low. Again, you have to build a better circuit (if possible).

Actually, the circuit works very well with the 358, and all grounds in this circuit are referenced to actual ground, i.e., down current side of the shunt resistor. The raw results, i.e., amps measured vs. opamp output volts, are highly linear as is, and I curve fit it to eliminate almost all constant offset and any slope error. The gain in this circuit is only 20, so it's not likely that it is unstable due to high gain. I can use the circuit as is, but I still don't know why a different opamp should give very different results. After all, when you wire up an opamp in a simple DC textbook circuit, I would think all opamps should behave pretty much the same.

What spice simulator do you use? What model (where it comes from)?
Mind the models are just models.. What current range do you target?
Show us the schematics.

You're not assuming that the OP07 is a rail-to-rail opamp by any chance?

I would think all opamps should behave pretty much the same.

In the real world, some opamps are more prone to oscillation. Need proper bypass capacitors.

Is your output oscillating, and that's what you're measuring?

Ok, I'm embarrassed to admit that I misread the data sheet, and thought OP07 had rail-to-rail outputs. So it gives right answers for my current monitor at low currents (high output values approx. 4 + v.), but it doesn't get down to the lower limit predicted by the inverting amp equations, i.e., about 0.09 v. I'll be more careful how I interpret opamp data sheets in the future.

Thanks, folks, for your interest and tutorial help.

ngoyat:
I want to measure current between my 60v solar panel to 48v battery. I have 50a 7mv shunt.
I want to connect is on low side for current sensing.

What makes you think it's a good idea to hijack another user's thread for your question ?

// Per.

ngoyat:
sir, i am not hijacking,
i just thought why to add a another new topic if one is already there,
if there is a problem then its ok i will post my ques as new topic

It's a bad idea to revive an old thread unless you have anything usefull to add (it's from April!) - and now you have a thread with your question, and a subject line that does not relate to Your question ...

// Per.

Hi, with respect to using 1 opamp to amplify a low level DC voltage.
I would be using an instrumentation amplifier setup.
The way that the group of op amps is connected in an instrument amp, they compensate for thermal drift and offsets, also you can apply an offset and setup gains very easily.

http://www.ecircuitcenter.com/Circuits/instamp1/instamp1.htm

Tom.... :slight_smile:

...I would think all opamps should behave pretty much the same.

Circuits in books are highly simplified "ideal" Op Amps in order to focus you on learning the basics first.

I highly recommend "Op Amps for Everyone". The 2nd Edition is free online, the 3rd and 4th editions are on Amazon. There are -so- many differences between Op Amps....

And there is no such thing as a true rail to rail Op Amp. If you truly want ground referenced inputs, you need at least a small negative supply for the Op Amp. There are even dedicated chips design just specifically to generate about -1.5V for this purpose.

The LM358 has input transistors designed in such a way that they work well down to ground in a single supply circuit, but the outputs don't pull to ground very well, and it won't go above VCC - 1.5V. Some Op Amps are wired to work well up to VCC, but don't do well at ground/VEE.