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.

DamoRC

Member
I am using a circuit represented by the attached to (1) amplify signals from a hall sensor and (b) send the output to an LM331 to convert the voltage to frequency.

This is working fine for my needs but I am curious as to why I can not get the LM358 to adjust to 0 volts when there is no magnetic field on the hall sensor. The sensor's "quiescent" voltage is Vs/2 (in this case 5V/2) when there is no magnetic field detected. I thought that by adjusting the pot so that the voltage into the non-inverting side matched the inverting side , I would get 0 volts output from the LM358.

The feedback resistor(s) are on a switch so that I can choose 10K (no amplification) or 100K (10X amplification).

The original configuration of this circuit used the first Op Amp circuit in the LM358 dual package to perform the zeroing function (pot connected to non-inverting side, configured as a voltage follower). However, this produced the same results as the circuit presented here, so I stopped using this approach.

I have experimented with the circuit to see what I can learn.

When the feedback resistor is 10K (no amplification), the lowest output I can achieve from the LM358 is 0.63 volts. I have to adjust the pot so that the output climbs slightly higher than this to ensure that the circuit responds to the smallest of changes in the hall sensor output. By adjusting the pot to about 10K, I get an output of 0.7 volts and I can use the circuit.

When the feedback resistor is 100K (10X amplification), the lowest output I can achieve from the LM358 is 0.09 volts. Again, I have to adjust the pot so that the output climbs slightly higher than this to use the circuit. By adjusting the pot to about 18K, I get an output of approx 0.2 volts and I can use the circuit.

As I said, this is not a major problem and I can use the circuit as is to meet my needs. However, given that the effective working range of the LM331 is 0 to Vs-2 (in this case 5V-2), losing 0.6V of "range" is a little annoying. Also, given that this is the first time I have used an Op Amp (but hopefully not the last) I would like to understand this a little better.

As always, thanks in advance for help, thoughts, suggestions.

DamoRC
 

Attachments

  • Hall Diff Op OpAmp.PNG
    Hall Diff Op OpAmp.PNG
    25.9 KB · Views: 4,500
hi,
Its not possible use a positive voltage on the non inverting of an OPA to null to zero when using a single supply.

You need to inject a positive voltage into the inverting input.

I use LTspice, so if you post your asc file I could suggest a modification.
 
Thanks Eric,

So another voltage divider feeding into the inverting input (would this be pre or post the inverting input resistor?).

Attached is the asc file. Note I used this for "drawing" purposes and not for testing the circuit "in silico.

DamoRC
 

Attachments

  • LM358 Zero Ouput Test.asc
    1.3 KB · Views: 566
The output of an LM358 will go close to ground maybe to +0.02V when it has no load. The input of an LM331 pulls it up so its lowest output might be maybe +0.03V.

Add a small negative power supply to the LM358 so it has a dual-polarity supply then its output will go to 0V.
 
Thanks for the input audioguru.

I will need to look into how I could put a negative power supply in the plan but I am trying to keep this a simple as possible (acknowledging that you may consider adding a negative power supply as a "simple" approach whereas I would not know where to start). Right now I am using a simple 5V walwart type supply.

On the LM331, I will look into this further but the voltages I described above where prior to connecting the LM331.

DamoRC
 
Hello,

You do realize that if you bias the output to 0v then your hall device can only go negative right? If it goes positive it will not affect the output.
I assume you want 0v to 5v output for some hall effect voltage between 0v and 2.5v.
 
Mr Al - I'm not 100% sure that I understand what you are saying but I believe the answer to "You do realize...?" is Yes.
The way I have set up the op amp means I can only detect a positive voltage signal from the LM358 if the voltage output by the hall sensor drops from it's "no magnetic field detected" voltage (which is 2.5 volts) to something below 2.5 volts.

I would like a 0 to Max volt output from the LM358 for a hall effect output moving from 2.5 to 0 volts. What I am getting now is 0.63 to Max volt output, which I can live with, but which I would like to fix if it were reasonably simple.

DamoRC
 
You can easily generate a negative voltage with a 555 oscillator and a diode pump. You can buy a 7660 flying capacitor IC that also generates a negative voltage among other things.
 
I am facing a similar problem with trying to measure a few tens of millivolt difference signals with an lm358 or preferably a low noise mc33072 which has a .3V min output.
I don't know what constitutes noise between the 2 opa, is 1mV noise for a lm358, how much less noisy is the mc33072? 1 nV? No idea. I could live with perhaps 5mV noise and do avgd MCU samples to null it out.

Audioguru can I do this with a lm358?

Anyway...seems that I need to get to zero V out for best accuracy with the ADC. Since I have a Fullwave bridge supply off a transformer (giving 1.2V absolute ground lift), I am thinking to make a 'new ground' half bridge of a couple Schottky's and realise a -.8V Vee for the opamp supply...thus allowing them to swing to 0V out?

Does this sound reasonable?

BTW Damoroc could u share the potentiometer spice model with me...? thx.
 
The output of an LM358 goes down to a max of 0.02V with a 10k to ground load resistor (typically 0.005V) and it is spec'd in its datasheet. I don't know why yours goes only as low as 0.63V.
 
Hi audioguru, do u have any data on the 'noise' from an LM358? If I am doing a diff. amp with 5x Gain (10K feedback) and I expect around say 20mV min difference for a 100mV Vo what type of noise levels can I expect on the Vo?

Attached is my 'dual supply idea' ...seems to deliver about .5V below 'gnd'.
 

Attachments

  • Dual supply.asc
    2.4 KB · Views: 273
I am facing a similar problem with trying to measure a few tens of millivolt difference signals with an lm358 or preferably a low noise mc33072 which has a .3V min output.
I don't know what constitutes noise between the 2 opa, is 1mV noise for a lm358, how much less noisy is the mc33072?
Audioguru can I do this with a lm358?

The datasheets show that an MC33072 is not low noise. It has 7 times more noise than an LM833 audio opamp.
the MC33072 has nearly half the horrible noise of an LM358 opamp.
 
Hmm....voltage range of a Volt above gnd makes it poor for a difference amp.
 
Last edited:
The output of an LM358 goes down to a max of 0.02V with a 10k to ground load resistor (typically 0.005V) and it is spec'd in its datasheet. I don't know why yours goes only as low as 0.63V.
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.
 
hi,
Based on your circuit, this is one option to enable setting the LM358 output close to ~0v.
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    13.5 KB · Views: 1,186
Mr Al - I'm not 100% sure that I understand what you are saying but I believe the answer to "You do realize...?" is Yes.
The way I have set up the op amp means I can only detect a positive voltage signal from the LM358 if the voltage output by the hall sensor drops from it's "no magnetic field detected" voltage (which is 2.5 volts) to something below 2.5 volts.

I would like a 0 to Max volt output from the LM358 for a hall effect output moving from 2.5 to 0 volts. What I am getting now is 0.63 to Max volt output, which I can live with, but which I would like to fix if it were reasonably simple.

DamoRC


Hello again,

Your original circuit was close, you just needed to adjust the gain and add some offset. The attached circuit has those features.
 
Last edited:
Mr Al - I'm not 100% sure that I understand what you are saying but I believe the answer to "You do realize...?" is Yes.
The way I have set up the op amp means I can only detect a positive voltage signal from the LM358 if the voltage output by the hall sensor drops from it's "no magnetic field detected" voltage (which is 2.5 volts) to something below 2.5 volts.

I would like a 0 to Max volt output from the LM358 for a hall effect output moving from 2.5 to 0 volts. What I am getting now is 0.63 to Max volt output, which I can live with, but which I would like to fix if it were reasonably simple.

DamoRC


Hello again,

Your original circuit was close, you just needed to adjust the gain and add some offset. The attached circuit has those features.

Note that for the basic design R4 is the same as R1 so that we get 2.5v at the non inverting terminal. With R3 at 10k that makes R5 equal to 14k because the LM358 can only output up to about 3.5v max with a 5 volt supply. With R5 set at 14k we set R6 at 14k also so that we can zero the output with 2.5v input from the HED.
You can make R1 and R4 just about anything as long as they are the same. If you make R6 a little smaller than 14k you can use a pot in series with it to get fine offset adjustment. For gain adjustment, you can adjust R3 or put a 1k pot in series with that after reducing it a little to like 9.5k or so.
 

Attachments

  • HED-Amp-01.gif
    HED-Amp-01.gif
    9.6 KB · Views: 700
hi,
Based on your circuit, this is one option to enable setting the LM358 output close to ~0v.
Eric, that doesn't work. The op amp will saturate near 0V, but the summing node is not at ground, so there is no feedback. His original scheme is the correct approach (except for the pot value), IF he had a rail-to-rail op amp with good sinking capability when the output is near 0V.
The +input and summing node need to be at 2.5V*Rf/(Rs+Rf). For Rf=100k, this works out to be 2.273V. For Rf=10k, it is 1.250V. These are values for an ideal op amp.
 
hi Ron,
Oh sugar!
Must have had a mental aberration when I drew that up.!:eek:
Thanks for the heads up, apologise to the OP.

Eric
 
As always - lots to think about from you guys.

Audioguru - when you say

The output of an LM358 goes down to a max of 0.02V with a 10k to ground load resistor (typically 0.005V) and it is spec'd in its datasheet. I don't know why yours goes only as low as 0.63V.

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?

Roff - the 0.63V limit is with the 10K resistor (limit with the 100K is 0.09V)

Eric - I am going to have to look at that circuit a little more carefully. I am not sure that I understand why "summing" the output from the voltage divider / voltage follower with the hall input and comparing them to ground in the second op amp will get me to 0V output. EDIT - sorry Eric - was writing this when you posted - ignore please.

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:
 

Attachments

  • Potentiometer.Zip
    658 bytes · Views: 248
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top