Non inverting/inverting LM358

Thread Starter

MBG

Joined Jan 30, 2022
23
Please teach me.

When you setup an LM358 op amp as a voltage amplifier why is it that you use an inverting amp rather than an non inverting amp?

I have one of these ACS712 current sensors and want to amplify it's output 1.5 times so I initially used a non inverting amp but it made the opamp output voltage go lower. (?) Yet, the inverting amp will amplify the voltage accordingly. The knowledge I have on "inverting and non inverting" is limited to in phase or out of phase but not getting what's going on beyond that. -- big thanks
 

Thread Starter

MBG

Joined Jan 30, 2022
23
Measuring DC current -- yes, one of the prebuilt modules. I found that I had to reverse the connection for it to show a positive swing and it is. So at idle it's about 2.6v
 

dl324

Joined Mar 30, 2015
18,328
When you setup an LM358 op amp as a voltage amplifier why is it that you use an inverting amp rather than an non inverting amp?
You can use it for inverting or non-inverting amplification. Post a schematic of your circuit.
 

Papabravo

Joined Feb 24, 2006
22,082
Please teach me.

When you setup an LM358 op amp as a voltage amplifier why is it that you use an inverting amp rather than an non inverting amp?
...
If you use the non-inverting configuration your gain MUST BE ≥ 1.0
With the inverting configuration your gain can be ≤ 1.0 or > 1.0
 

Thread Starter

MBG

Joined Jan 30, 2022
23
Ignore this post. Something is flaky with this circuit being on a breadboard. It's one of those that needs a pcb and everything soldered it feels like. Works and doesn't. Sorry about that.

When I do have the LM358 setup (non inverting) I get 3.5v, so it does amplify the 2.5v idle voltage from the sensor but then weird things are happening when I draw current. It all needs to be soldered.
 

dl324

Joined Mar 30, 2015
18,328
When I do have the LM358 setup (non inverting) I get 3.5v, so it does amplify the 2.5v idle voltage from the sensor but then weird things are happening when I draw current.
Post a schematic so we can understand what you're talking about.

Something is flaky with this circuit being on a breadboard. It's one of those that needs a pcb and everything soldered it feels like.
Post a picture of your breadboard. It's either a cheap breadboard problem or something you're doing wrong.
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,082
My bet is the schematic will reveal the problem. Blaming the breadboard has about a 1% chance of being the explanation IMHO.
 

Papabravo

Joined Feb 24, 2006
22,082
Don't know how to post schematic but will look into that.
At least two methods:
Method A
  1. Make a drawing on a sheet of paper.
  2. Use a scanner to scan the image
  3. Post the image
Method B
  1. Use ANY available drawing program
  2. Make an image
  3. Post the image
 

Papabravo

Joined Feb 24, 2006
22,082
Thanks, that will do. There is clearly something wrong because if you wired it up the way it is drawn you will not see 3.5 Volts on the output.
You also did not indicate the power supply configuration you are using. I guessed you might be using a +9V battery.
The gain in this non inverting configuration is (1 + R1/R2) = 1.681 * 2.5 ≈ 4.2 V
The output voltage Vo will go to whatever voltage will make the '+' and the '-' inputs be equal.
Note for construction on a breadboard you should have some bulk capacitance on the power supply pin along with a small value capacitor to bypass high frequency noise. I can make any changes you want and rerun the simulation.

1643833450605.png
 
Last edited:

Thread Starter

MBG

Joined Jan 30, 2022
23
Using a 5v regulated supply. I just saw an application note on the allegro site that does something completely different. (2) 100k resistors on the + input (1 to gnd, other to Vcc).
A 3.3 K from output to -- input and the input signal to it also. I'm going to try that.

Yeah, I may not have used 6.8k -- all I know is the gain gives me 3.5v but what is weird is that the output voltage actually goes down when I draw current through the sensor.
 

dl324

Joined Mar 30, 2015
18,328
Using a 5v regulated supply.
You need to read the datasheet.

The opamp isn't guaranteed to work with a 5V supply. The guaranteed output voltage is from about 0V to Vcc-3V (when lightly loaded). The input voltage range with a 5V supply is guaranteed to be 0-3V.

1643836200386.png
1643836232218.png
1643836270296.png
 

Papabravo

Joined Feb 24, 2006
22,082
Using a 5v regulated supply. I just saw an application note on the allegro site that does something completely different. (2) 100k resistors on the + input (1 to gnd, other to Vcc).
A 3.3 K from output to -- input and the input signal to it also. I'm going to try that.

Yeah, I may not have used 6.8k -- all I know is the gain gives me 3.5v but what is weird is that the output voltage actually goes down when I draw current through the sensor.
That's the ticket. Throw spaghetti onto a wall and see what sticks. Current through the sensor may make it's output voltage go down which will affect the output of the opamp, Good luck with your experiments.
 

AnalogKid

Joined Aug 1, 2013
12,130
With a single +5 V supply, the 358 output stage is saturated high. Read the datasheet to see the maximum output voltage with a 5 V supply (post #15). You can verify this quickly by powering the 358 with a 9 V battery; the output should increase to something near 4.25 V.

ak
 
Top