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.
Audioguru - when you say

do you mean a 10K resistor from the LM358 output to ground? I don't have one of those in my circuit - would this not reduce my gain from the circuit considerably?
The datasheet for the LM358 says that its output low is typically 0.005V or a max of 0.02V when it has a 10k load resistor from the output to ground. A load resistor does not affect the gain unless it is a low value which is like a short circuit. The feedback resistors determine the gain.

Roff - the 0.63V limit is with the 10K resistor (limit with the 100K is 0.09V)
Your feedback resistor is pulling the output up. Then a 10k load resistor to ground will not make much difference.

Try it with a negative supply that is 1V or more.
 
Last edited:
hi damo,
When I posted that earlier circuit I had not moved the Hall input to the non inverting input of the OPA, a careless oversight.!

This circuit assumes that the Hall Effect device has a range of 0.5V thru 2V, adjust the offset and gain to suit the HE device.
 

Attachments

  • AAesp02.gif
    AAesp02.gif
    37.5 KB · Views: 269
  • LM358 Zero Ouput Test2.asc
    1.9 KB · Views: 276
Eric - thanks - that circuit makes a lot more sense to me. Is there a specific reason / advantage to using the voltage follower for setting the reference voltage. I have seen that approach in a number of circuits using the LM358 dual package.

Audioguru - thanks for the explanation on the 10K to ground.

Looks like I have a number of things to try with the 10K pull down being the simplest followed by Eric's the Mr Al's.

Will try these out tonight and report back.

DamoRC
 
If the feedback resistor is 10k and it pulls the output up, then a 10k resistor to ground on the output will simply make a voltage divider and instead of a minimum output voltage of 0.63V you will have 0.32V.

The output is 0.005V to 0.02V only if nothing pulls the output up and there is a 10k load resistor to ground.
 
Eric - thanks - that circuit makes a lot more sense to me. Is there a specific reason / advantage to using the voltage follower for setting the reference voltage. I have seen that approach in a number of circuits using the LM358 dual package.
hi,
The Vref OPA provides a low impedance path for the second stage OPA input resistor.
If you took the Vref from a resistive divider, every time you adjusted the OPA gain you would have to adjust the Vref pot
 
Last edited:
As always - lots to think about from you guys.



Mr Al - It looks like the only difference between your circuit and the original is the Vs injection through R6. You said that, having picked R5 at 14K we then make R6 14K. With R3 at 10K, this is a "no amplification" setup? If I wanted 10X amplification by setting R5 at 140K, would I also need to set R6 and 140K. Or would I be better off getting the 10X amplification by switching R3 from 10K to 1K and leaving R5 and R6 at 14K?

Mosaic - Pot model (found it on the Yahoo LTSpice group) attached:




Hello again,


No the circuit has a gain of 1.4, which is the max allowed by the constraint of both your required input range of 0 to 2.5 volts and the limited output of the 358 which is 3.5 volts when using a 5v power supply.

You can improve a little by using a rail to rail output op amp, but only up to 5 volts.

If on the other hand you were to use a smaller input range like say 2.0 volts to 2.5 volts then you can use a gain of 3.5/0.5=7 and get a 0 to 3.5v output with that limited input range. That would require R5 be set to 70k and R6 also.
But you cant have both, you cant have both a wide input range and a high gain like 10 because the output of the op amp will saturate long before you get to use that entire range of 0 to 2.5 volts.

The smaller input range of 2.0 to 2.5 volts will give you higher resolution but smaller range. The larger input range of 0.0 to 2.5 volts requires a gain of 1.4 maximum unless you raise the power supply voltage.

If this still isnt clear i can post some graph plots of input vs output.
 
Last edited:
Mr Al. Sorry, I over generalized the requirements. I know that the signal will move from 2.5 volts towards zero volts. However, in different situations that signal drop may be the full 2.5 (so the 14K R5 and R6 will work) or it could be 0.25 volts (meaning I would need 140K at both R5 and R6). However, you have answered my question in that R5 and R6 should be the same and the gain is still a function of R5/R3.

Eric - thanks for the explanation on the dual OPA setup.

DamoRC
 
Last edited:
DamoRC, what is the total load on your power supply? If you don't know, what are the circuits that it has to power? I have an idea, but it depends on your answer.
 
Mr Al. Sorry, I over generalized the requirements. I know that the signal will move from 2.5 volts towards zero volts. However, in different situations that signal drop may be the full 2.5 (so the 14K R5 and R6 will work) or it could be 0.25 volts (meaning I would need 140K at both R5 and R6). However, you have answered my question in that R5 and R6 should be the same and the gain is still a function of R5/R3.

Eric - thanks for the explanation on the dual OPA setup.

DamoRC


Hi again,

Yes, if you only have a 0.25v input change then 140k would work ok. The maximum gain is equal to the max output voltage divided by the input change, so with 3.5v output and 0.25v input change you can have up to 3.5/0.25 which is equal to a gain of 14 instead of just 1.4, so yes a 140k resistor would do that. Very good thinking on your part :)
 
Roff - not 100% sure what the total load will be.

Final circuit will be
LM358, max supply current 1.2 ma
LM331, max supply current 6.0 ma
Hall sensor, max supply current 11 ma

A few voltage dividers 10 ma?

There are still a couple of bits and pieces I need to work out, there maybe a PNP switched LED at the back end - 30 ma

Walwart is 5v, rated for 750 ma.

Is this the info you need?

DamoRC
 
Roff - not 100% sure what the total load will be.

Final circuit will be
LM358, max supply current 1.2 ma
LM331, max supply current 6.0 ma
Hall sensor, max supply current 11 ma

A few voltage dividers 10 ma?

There are still a couple of bits and pieces I need to work out, there maybe a PNP switched LED at the back end - 30 ma

Walwart is 5v, rated for 750 ma.

Is this the info you need?

DamoRC
That's what I needed, but I didn't realize you were using a 5V wall wart. Never mind.
Have you considered a CMOS op amp? Microchip and others have some inexpensive units with fairly good specs. You can get a dual op amp with rail-to-rail inputs and outputs for about 50 cents, if you can use a surface mount part. You might have to pay more for a through hole part. This is just an example. There are other manufacturers and vendors. The beauty of a rail-to-rail output op amp is that the part will typically go to within 10millivolts of the rails with light loading.
The disadvantage is that you will need a regulated supply, because many of these CMOS op amps can only handle 5.5 or 6V max supply voltage.
 
Roff - thanks for the info. I can only use through hole parts and, although a few cents extra for a through hole version wouldn't kill me, I got a bunch of the LM358s specifically for this project. If the non-zero voltage output becomes a real pain, I can revisit this.

Eric and Mr Al, had a quick look at both of your suggested circuits this morning (spent last night playing with the LM331 output side). Unfortunately, neither of the suggested approaches helped the situation - still cannot get the output to zero when there is no input from the hall sensor. In the interests of full disclosure, to perform a quick test of these this morning, I (a) did not use the voltage follower reference op amp in Eric's circuit (just used the voltage divider that I had been using and (b) did not use the 14K resistors (used 10Ks for R5 and R6) in Mr Al's circuit. However, I don't think that this would have made a significant difference to the outcome.

Although when I started this thread, the inability to get a zero output V did not bother me that much (I can live with it), it is now niggling at me as to why I can't fix this. Going to look up some simple charge pump type things to see if I can easily get a small magnitude negative rail into the project.

As always thanks for the help.

DamoRC
 
Hi again,

What is the lowest output voltage you are seeing now? It should be fairly low in the range 0 to 0.1 volts.

If you need a negative rail and you can put up with an output of 0 to 3v instead, there is a trick you can use to simulate a negative rail without going through the trouble of generating one. I'll try to post a schematic for you today.
 
hi,
Al beat me too it, how low.?
It should go almost to 20mV with a 10K load to 0V, also where are you measuring, before or after the 100K and is that 100K connected to an external device.??

You may have posted it somewhere, do you have the HE datasheet you could post.?
 
Last edited:
Eric and Mr Al,

Neither approach improved the situation. Still getting 0.6V when no amplification is selected (Rf = Rin from hall sensor) and 0.09V when 10X amplification is selected (Rf = 10X Rin from hall sensor).

The output is being measured at the op amp output (no 100K resistor, not connected to the LM331).

I want to make sure that I understand the "10K" load issue as Audioguru has also mentioned this. I don't have a 10K load on the circuit (i.e. I don't have the output connected to ground through a 10K resistor). Should I have?

This is the link to the datasheet for the hall sensor.
https://www.electro-tech-online.com/custompdfs/2011/06/1301.pdf

Edit - the actual unit I have is the A1302KUA-T

Edit. Just put a 10K from the op amp output to ground and the op amp output voltage dropped to 0 (this using Mr Al's positive injection version of the circuit). However, the circuit is now non-responsive to the hall sensor. Also, in case it may help, I connected a pot from the Op Amp output to ground and adjusted it until the output voltage became 0.02 V (basically just above zero). The op amp was still non-responsive to the hall sensor. When i removed the pot and checked for the resistance that was being applied, it was 47 ohms. Not sure that this tells us anything.
 
Last edited:
hi,
What voltage do you measure on the actual HE output, ie on the non invert pin of the OPA.?

Try to connect a 10K from the output of the OPA to 0V.
Have downloaded the pdf, will look thru it.

EDIT:
Looking at the HE d/s, I see that the output swing is about the Vs/2 level, so for no field the output is +2.5V.

The Gain at the non invert is 1+ [Rf/Ri] ie: 2 with 10K's

So the Vout would want to drive to 5V, to offset this would require +5V from the Vref OPA, which it cannot do as at 5Vs , the max is +3.5V.!

One way would be use a resistive divider on the HE input, say div by 2, so that Vout would be +2.5V with no field.
Apply an offset voltage Vref of +2.5V to bring the Vout to ~0V.

The LM358, IMO , at 5Vs is not suitable for the project, either a rail2rail or a higher Vs or a -Vs dual supply.
 
Last edited:
Hello again,

I have worked with similar HED's like the 1305, 1307, and 1315, which im not sure if they make anymore so these parts may be outdated a bit. But anyway, from what i remember they output a 2.5v nominal, and with activation from one magnetic polarity they go up toward 5v and with the opposite pole they go down toward 0v. There are a couple issues with these guys though like temperature offset, but you'll have to check the data sheet to see if that affects your particular device appreciably.

I beat Eric to one question about the circuit, but he beat me to another question: What is the output of the hall effect device when it is NOT connected to the circuit? Can you get it to range from at least 2v to 3v? This is an important question.
 
Last edited:
Eric, Mr Al,

Thanks for your continued patience (although I sense that Eric's is wearing thin :)).

The HE output with no field is 2.5 volts (with a Vs of 5). I can get this to swing to either 0.1v or 4.9v depending on the polarity of the magnetic field (using a magnet to test). In the actual application I am not 100% sure yet what my max signal in from the HE is going to be (thus the 1X and 10X amplification options in the original circuit).

Eric - If I understand you correctly, a non-inverting amplifier will not work with my current Vs, Op Amp choice and the fact that a "0" signal level is 2.5V. That's okay, I will just revert to the inverting amplifier I started with. I can either live with the inability to zero the output fully or I might try adding a 555 based charge pump to "get me some" negative voltage.

DamoRC
 
Hello again,

As i said earlier, there are some tricks you can use to get the equivalent of a negative supply rail without going through the trouble of adding a separate supply or circuit to generate a negative voltage. We'll get to that later if you are still interested but we have to get along a little just to find out if you really need that anyway. If you are getting 0.6v output then something is definitely wrong, and it's more than just requiring a negative rail. As Eric pointed out, you should get much closer to zero when the circuit, as is, is working properly.

Ok so you are getting the full range output of the HED, that's great. What about AFTER it is connected to the circuit, do you still get the full range out of the HED itself still?

You can not connect a resistance so low to the output of the op amp to ground because that will not allow it to work correctly. You should try to limit total output current to around 10ma or less.

Once we get the circuit working you should be able to adjust R5 to 14k or 140k like we talked about, but right now there is something else very wrong. It could be something simple. To find out what it is, we might have to do a few tests. For one, you can disconnect the feedback resistor and see if you can get the output to flip from positive say 3v or more to near 0v when you change the mag field from high strength north to high strength south pole (as you did for the basic HED test). With no feedback the op amp output should abruptly switch from near 0 to 3.5 or more volts.
 
Understood. Just so we are on the same page, we are talking about my original inverting differential amplifier with the voltage injection component that you had added - correct?

I will record the various voltages you suggested, with and without the voltage injection and with and without the feedback resistor. Probably be tonight before I get this completed.

DamoRC
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top