Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to Zero Output from LM358 Differential Amplifier?

Status
Not open for further replies.
Hi again guys,


My apologies, i thought someone already made it clear to the OP that there would be the need for some kind of output resistor to ground and so this would be an automatic assumption. I think i would opt for a 1k resistor myself.

As far as the 5v power supply is concerned, i would tend to want to use a 5v *regulated* supply. However, because of the ratiometric operation of the HED and of course the two 20k divider resistors are automatically ratiometric this circuit could very well work with an unregulated supply too, as long as it doesnt dip too much lower that say 4.5 volts. I want to take another look at that HED data sheet first through. Yeah ok, it works only down to 4.5v so using a 5v unregulated supply is cutting it close. If the line dips down to low line the DC could very well dip as low as 4.25v which would not really be good enough. I would suggest a regulated wall wart or a wall wart with more DC output like 9v and a good 5v regulator at least as good as the LM317L or better.

As i said *several* times in this thread however, we dont need a negative supply so dont worry about that anymore.
I'm not entirely comfortable with your "we dont need a negative supply" decree. Perhaps you could explain why this is. I could understand it if the LM331 is going to be feeding a micro. You could just remove the frequency offset in software.

EDIT: I think you can remove offset at the other comparator input to the LM331.

With a 1k pulldown, you might get down to 200mV with 250uA flowing through the feedback resistor.
I already explained that the HED offset AND gain (volts per gauss) are ratiometric. This means that, while the offset at the op amp output will be constant, the signal level will change if vcc changes, even if the magnetic field strength doesn't. That would be OK if the LM331 were ratiometric, but it isn't. Hence the need for a regulated supply.
 
Last edited:
Hello again Roff,

Yes, i dont feel comfortable with a non regulated supply either. It does depend on how 'unregulated' it is though i guess and what kind of stability the OP is after, but lets assume he needs a regulated supply. That means a different wall wart with higher voltage or already regulated.

Zero Output for Zero Input:
When you think about it, there is nothing difficult about getting zero volts. A resistor sitting in a parts bin has zero volts across it right? (Well almost) Zero volts is cheaper than plus some voltage or minus some voltage too, because it doesnt require any energy to 'produce' (note we dont even really produce anything to get zero).

So with that in mind, here is one such solution for a zero-output-for-zero-input op amp circuit. Does it get any simpler than that?
Note that i changed the 14k resistors to 140k, but 14k will also work with a slightly higher output zero.
Also note that i used a regular silicon diode, but a Schottky would mean less loss of upper range (upper range loss is equal to the diode voltage drop, thus we would loose 0.5v roughly bringing the upper output range limit to around 3v for a 5v power supply).
In some cases a resistor of the right value can replace the diode which helps to maintain the upper output range limit.
 

Attachments

  • ZeroOutOpAmp-01.gif
    ZeroOutOpAmp-01.gif
    7.5 KB · Views: 252
Last edited:
hi Al,
That circuit may give zero out for zero inp, but thats all it does.???

Its dosn't reproduce the input from the HE.???

Am I missing something.?:confused:

EDIT:
1K removed, reposted. [Roff]
 

Attachments

  • AAesp03.gif
    AAesp03.gif
    33.5 KB · Views: 210
Last edited:
That's a good idea, MrAl.
If he uses a 9V unregulated supply, he could power the op amp with it, and use a 5V regulator for the HED, the op amp reference voltages, and the LM331. Then the output could swing from ≈0V to 3V, which is the upper limit of the common mode range of the LM331. Of course, the output could go all the way up to around 6.5V. You could use an emitter follower instead of a diode to relieve the op amp of most of the load.
 
Last edited:
hi Al,
That circuit may give zero out for zero inp, but thats all it does.???

Its dosn't reproduce the input from the HE.???

Am I missing something.?:confused:

EDIT:
1K removed, reposted. [Roff]


Hi Eric and Roff,

Moral of the story: Creating a voltage supply is not so easy to do, but creating a voltage drop is always simple :)


Eric:
Oh ok i missed your original post, but i guess it looks ok now? The OP's original input was intended to run from 0 to 2.5v, so you may want to try that input range next. I've seen the output go as low as 5mv so far.

Roff:
I seriously considered an NPN emitter follower and it does provide more current output. The only drawback is that there seems to be no away around the 0.7v BE drop whereas with the Schottkey we can get down pretty low like 0.4v which leaves another 0.3v on the top range limit. Maybe a germanium transistor? The advantage is we can use a lower output resistor like 100 ohms and get the output as close to zero as 0.002v or something like that.
This is a pretty common problem that comes up now and then. I ran into it again for the first time in something like 5 years back around 2003 when i was helping someone with a very high current Li-ion charger for big multiple cells. The current measurement we were doing used an LM358 and yup same problem...we couldnt get to a very low output. We had lots of upper range though with that project so a 1N4148 was no problem.
I still havent gotten to price those germanium transistors talked about in another thread. Maybe i should do that now before something else comes up :)
 
Last edited:
Like I said, MrAl, a 9V wall wart and a 5V regulator will make the diode vs transistor issue a nonissue.
 
Hi Roff,

Yes, i was talking about that in a more general way.
 
Moral of the story: Creating a voltage supply is not so easy to do, but creating a voltage drop is always simple :)

hi Al,
I would suggest the moral of this story and others is:- choose the correct OPA and voltage supplies to do the job.:D

The length of this thread demonstrates the problems a 'builder' can get into by using the incorrect type of OPA/psu and the component juggling that has to be done to make the shoe fit.:confused:

Eric.
 
Hi there Eric,

Yes, good point there. Buying the right parts for the job makes things much easier.

What happened to us with the Li-ion battery current measurement was we had to measure down pretty low and the guy i was working with didnt want to go through another round of buying parts which would mean another bout of high shipping costs, which was completely understandable. The 2 cent diode was on hand so it had gotten used :)
 
Last edited:
Sorry folks, was away for the weekend and I am only catching up tonight.

I can report some progress. Although previously I had tried Mr Al's idea of voltage injection at the in- and reported that it did not help.
This was using all 10K resistors (HE to in-, Rf to in- and Voltage injection to in-).

Based on the latest circuit proposed by Mr Al (the one including the diode), I replaced the 10Ks with 100Ks and now, I can get down to 0.1v, with the circuit still responsive to the HE signal.

10K to ground does not work. It just drives the output to 3.5 and the circuit becomes unresponsive to the HE signal.

I have not tried adding the diode because the 100K voltage injection version has just gained me 0.5V of range with a reasonable lowest value. I don't need to lose 0.5v of range at the top end.

I will continue to play with this a bit as I would like to understand further the relationship between the resistor values and the circuit behavior.

But for now, I am in a better place.

Thanks Mr Al and everyone else for your thoughts and comments.

DamoRC
 
Hi again,

10k to ground where?

I am starting to think that maybe you should try to simulate your circuit first in a circuit simulator so you can get an idea how it is supposed to work. Then you can compare that to your real world circuit and see if there are any differences. Usually a circuit this simple takes about an hour to build and test so i think that would help you understand this thing a lot better.
 
The 10K to ground I refer to is R7 in your posted circuit (post output, pre diode).

I will try to model some stuff in LTSpice and compare to real world. I was not certain the lm358 model that I have was truly representative of the real IC.

Thanks again for your help.

DamoRC
 
Hi again,

Oh ok great. I am sure you will find it very informative.

10k on the output to ground? There's almost no way that can cause the output to go to 3.5 volts, by that change alone. That's why i was suggesting that something else more basic must be wrong somewhere...a bad connection to ground, wrong value resistor, something like that because the spice sim looks very good and for DC it's not bad so you should see results very close to the spice sim, which right now you are not seeing.

Let us know how you make out with the spice and spice circuit and what you think about this next.
 
Mr Al et al.,

I need to post a correction. I was tinkering with the circuit yesterday and realized that the 10K to ground was actually connected to the in- of the op amp instead of the out. In the correct position, the 10K to ground had no impact on the circuit. I also determined that the ability to get a "zero" or lowest possible signal out of the op amp for a "quiescent" voltage in from the HE (Vs/2) is primarily driven by the resistances Rf (feedback) and Rs (between HE and in-) and is actually not impacted greatly by the positive voltage injection. In fact, the circuit is now achieving the 0.1v minimum output (with 1X amplification,no connection from output to ground and Rs and Rf = 100K) without the voltage injection on the in-. I think this is consistent with something Roff said earlier in the thread:

I wonder if that 0.63V limit is with the 10k feedback resistor, or the 100k. Keep in mind that, for the output to get to 0V, the output must sink (2.5V/(Rs+Rf). This is either 125uA with the 10k Rf, or 22.7uA with the 100k. In either case, the LM358 is not really equipped to sink much current when the output voltage is low enough to cut off the PNP emitter follower.

So at this point, my circuit looks identical to what I started with at the top of the thread except the 10K Rs and Rf have been replaced with 100Ks.

Going to tinker some more before locking it down.

DamoRC
 
Hi again,

You can do it that way but that means adjusting the R4/R1 pot every time you change the gain. With the bias resistor (from Vs to inverting input) you can get away without readjusting when you change the gain in many cases.
If you dont mind changing the pot setting after a gain change then you might make out ok, but if not then you'll have to use that extra resistor (which would be 100k now).
 
Last edited:
Okay - I will put it back in (Vs to in- through 100K) and see how it helps when the I change the gain.

DamoRC
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top