Op amp outputting high

I am running an lm358 op amp with 12v. Im using a section of wire in my circuit to measure current and using the op amp to boost the voltage. I'm using a none inverting setup ie:
Pin 1 output
Pin 2 10k ohm to pin 3
Pin 2 56 ohm to ground
Pin 3 input
Pin 4 ground
Pin 5 12v

I get differing output voltage that are close to what they should be but are anywhere from .4 to .7v high. More high towards 2v. Any ideas why?

Your diagram does not make sense.
Where does the current sense wire connect to.
pin 5 is the -input for the second opamp.
What about pin 8.
We need to see a circuit diagram.
Is it similar to this one.
Leo..

The circuit on page 11. Also I meant pin 8. I don't think it's resistor error as my differences are too large for that. My 10k is a 1 percent resistor and the 56 is a 5. I suppose my voltmeter could be off ?

I understand that you have made a low-side current sensor with an LM358.
You current readings are ok, but you have some output offset with no current flowing through your sensing resistor.
Is this correct?
Leo..

Yes.

I guess there are two issues. 1 is that the voltage outputted is higher than expected. 2 the voltage goes negative with a low input voltage. My limited knowledge of op amps tells me problem 2 could be because I'm approaching my ground rail voltage of 0v.

I can get exact values later if need be.

cbrunnem:
I am running an lm358 op amp with 12v. Im using a section of wire in my circuit to measure current and using the op amp to boost the voltage. I'm using a none inverting setup ie:
Pin 1 output
Pin 2 10k ohm to pin 3
Pin 2 56 ohm to ground
Pin 3 input
Pin 4 ground
Pin 5 12v

I get differing output voltage that are close to what they should be but are anywhere from .4 to .7v high. More high towards 2v. Any ideas why?

Do you mean the 10k is between pins 1 and 2? Otherwise you've not got feedback.

10k : 56 ohm ratio is about 200, which is rather large for a single stage opamp, and will
multiply the worst-case input offset error from 7mV (input) to 1.25V

If you are trying to accurately measure small voltages, you need a precision opamp, not
a cheap one.

MarkT:
Do you mean the 10k is between pins 1 and 2? Otherwise you've not got feedback.

10k : 56 ohm ratio is about 200, which is rather large for a single stage opamp, and will
multiply the worst-case input offset error from 7mV (input) to 1.25V

If you are trying to accurately measure small voltages, you need a precision opamp, not
a cheap one.

Yes I completely failed at portraying the circuit. I copied the circuit on page 11 of the data sheet I posted above.

So you are saying the 358 isn't accurate enough? What would you recommend? I can do multiple op amps with low gains?

You can use this Instrumentation Amplifier AD623

http://www.vwlowen.co.uk/arduino/current/current.htm

With this op amp I have how close to 0v on the output can I get to?

As low as the 5K pot will get you.

cbrunnem:
So you are saying the 358 isn't accurate enough? What would you recommend? I can do multiple op amps with low gains?

No, you are saying that - I don't know how accurate you want! Multiple opamps won't
help, you need a precision opamp with low input offset if you want precision

I bought a pack of 358s for relatively cheap off amazon. I tried all of them and only one out of 20 outputs what it should the rest read consistently high. I think I must have bought cheap or fake op amps...

Hi

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?
In particular how you shunt resistor is in the circuit and connected to the opamp circuit.

Tom...... :slight_smile:

cbrunnem:
I bought a pack of 358s for relatively cheap off amazon. I tried all of them and only one out of 20 outputs what it should the rest read consistently high. I think I must have bought cheap or fake op amps...

These opamps have a relatively high input offset, up to 9mV.
If you amplify that 200x, you will have a large output offset.
You could add a small and opposite offset to one input, to null the output.
We need an exact schematic diagram, with measured voltages, to give you the right advice.
Leo..

About the first thing you need to check when designing DC circuits with opamps is allowable
range of input offset voltage you can tolerate to give you the precision you require - you then
confine your choice to devices with a lower input offset voltage than that.

Sometimes (especially if using high impedances) you do the same check for input
currents and offset currents.

For measuring a small voltage across a shunt resistor you should immediate think of
using chips designed for that one purpose - you need low input offset, possibly high CMRR,
possibly high bandwidth.

If the bandwidth is unimportant an instrumentation amp is basically what you want, precision
with high CMRR, so that high gain configurations (such as x200) are plausible.

You will need proper decoupling, not a 0.1uF cap as for logic circuits, but more like 47uF
or more electrolytic to prevent unintended feedback via the supply. Opamps are glacially
slow compared to logic chips, the decoupling requirements are in the 100kHz sort of range,
not 100MHz.

And lastly if you power the opamp at 12V you'll have to do something with the output to
prevent it damaging the Arduino analog pin will cannot tolerate voltages greater than
its supply (5V)

Hi,
cbrunnem, you need to google, instrumentation amplifier

These are designed for the specific application you have.

In fact page 23 here.

Tom..... :slight_smile:

sorry i havent replied sooner but i have been moving over the weekend. over the weekend i got a power resistor of .1 ohm so that i dont have to have as high of a gain. right now my gain is 19 and the accuracy is where it should be. the output from the op amp is quite good with a multimeter but once i feed it into my 328 it is all over the place anywhere from 200 to 700 when the input voltage should be 368(1.8v).

i can supply a diagram of my complete circuit but this op amp is integrated into a larger system so it would be quite cluttered.

any ideas before i draw up a diagram?

I think you said the opamp’s supply is 12volt.
Did you use a 4k7-10k protection resistor between opamp output and A/D input.

The opamp might be oscillating.
Is there a cap across the feedback resistor, as in the link in post#1
Leo…

Wawa:
I think you said the opamp's supply is 12volt.
Did you use a 4k7-10k protection resistor between opamp output and A/D input.

The opamp might be oscillating.
Is there a cap across the feedback resistor, as in the link in post#1
Leo..

putting a .1uf cap between 0v and output didnt help. putting a 10k resistor in series with the analog pin didnt help. both at the same time didnt help

A 4k7 (10K) resistor from opamp out to input pin is needed.
It protects the input pin when the opamp outputs more than 5volts.

Not sure why you have a fluctuating reading.
Leo..