Measuring +20V - 0 -20V with LM358 dual op amp.

Thread Starter

Peterperkins

Joined Nov 5, 2018
22
I've knocked up the attached LM358 dual op amp schematic to measure a variable +20 - 0V input and a 0V to -20V input with common (0V)

The opamp is supposed to scale the signal to a 0-+2.5V range output and in the case of the negative input invert the output to give a positive output.
It's all powered by a single stable 5v supply.

The problem i have is that when the positive input is fed with a steady battery 7.2v input voltage the output from the opamp has a regular ripple as shown in the attached scope pic? It's throwing off an adc connected to the opamp output measuring the voltage.

Is the basic design flawed? Any other ideas to measure (+20V to 0) and (0 to -20V) with an opamp to scale both the outputs to +0-2.5V for my adc?
The circuit simulates correctly in proteus with the opamp outputs changing in response to input voltage changes.

Grateful for any feedback. Thanks
 

Attachments

danadak

Joined Mar 10, 2018
4,057
Cannot read the time base on scope capture, what is the freq ?

Keep in mind this part will not CM to either rail, input or output.

Input is Vsupply - 2V, in your case 0 - 3V, output depends on load.
So you should compute for your conditions to make sure you are
always in CM range. The min value in is 0 V.


Regards, Dana.
 

dendad

Joined Feb 20, 2016
4,479
Sorry what do you mean?
Adding capacitors across the power supply pins, close to the device, in this case, the LM358 between pins 5 and 8.
I use at least a 100nF ceramic and a 10uF tantalum cap. The first thing you need to do in your circuit design is to have good quality power. That is the foundation to build on. Noisy poor power can cause all sorts of problems.
If the power supply is high impedance, the voltage will change as the current drawn changes. Have a "Google" about power supply bypassing.
 

Thread Starter

Peterperkins

Joined Nov 5, 2018
22
Thanks I have 100nf caps on the pins, standard practise.. The power supply is not high impedance.. We also have 10uf and 4.7uf on the supply output. It's only powering a pic and this op amp.
 

Thread Starter

Peterperkins

Joined Nov 5, 2018
22
Thanks for that but i don't understand why my sim doesn't work...
I'm trying to use two halves of the dual LM358N the + works but not the negative..
Any settings in proteus?
I could not find the symbol you are using for the voltage sources?
OpAmp Simulation 051118.jpg
 

absf

Joined Dec 29, 2010
1,968
I am using older version of proteus.
Did you try with other similar opamps like LM324?

lm358 v2.PNG
Voltage source is in the "Simulator Promitives" Library as VSOURCE.
 

Thread Starter

Peterperkins

Joined Nov 5, 2018
22
Thanks for the ideas but still no luck.

I have breadboarded the various above circuits with an LM358N.

The positive side works as expected, but the negative does not and there is a very strange square wave appearing on the negative side.

Ringing? There is no response to any negative voltage changes..

Further ideas and design suggestions gratefully received.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thanks for the ideas but still no luck.

I have breadboarded the various above circuits with an LM358N.

The positive side works as expected, but the negative does not and there is a very strange square wave appearing on the negative side.

Ringing? There is no response to any negative voltage changes..

Further ideas and design suggestions gratefully received.
Have you tried more than one chip, or just the one? If just one, could you swap which amp is used for negative and positive? I'm just trying to rule out the possibility of a bad op amp channel.
 

Thread Starter

Peterperkins

Joined Nov 5, 2018
22
Thanks for these ideas making some progress now.

I would like to add some low pass filtering of the highly noisy voltages being measured so they don't upset the opamps.

I also want to increase the impedance on the shared ground so the noise doesn't come into the ground side of the circuit. .

Hope that makes sense.. ideas?
 

danadak

Joined Mar 10, 2018
4,057
I also want to increase the impedance on the shared ground so the noise doesn't come into the ground side of the circuit. .
Not sure what you mean by this ? Normally one thinks of building as low a Z path
to ground as possible when bypassing and routing current back to source.

Regards, Dana.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thanks for these ideas making some progress now.

I would like to add some low pass filtering of the highly noisy voltages being measured so they don't upset the opamps.

I also want to increase the impedance on the shared ground so the noise doesn't come into the ground side of the circuit. .

Hope that makes sense.. ideas?
Are you still having the same problem as before, or did you get the negative side working? If it's working now, what fixed it for you? If not, we should probably get to the bottom of that before worrying about filtering.

That said, a low pass filter should be an easy enough addition. As for adding impedance to the ground, I'm with Dana. I can't imagine that will be helpful. If shared ground connections are causing any sort of interference, it's probably because the ground has too much impedance, not the other way around.

If it has low enough impedance, it's just always 0V. Current flows through it, but it flows so freely that any voltage change is so small it can be ignored. However, if you increase impedance, that same current flow results in more voltage fluctuation.
 
Top