Using LM358 instead of LMV321 op amp

OR raise the rail voltage for the op amp. Max Headroom!
OK - I get it. This is supposed to be a regulated 2.5 volt low impedance virtual ground to bias the transformer outputs to 1/2 the 5V Arduino supply. OK, first off, make C1 10 or more mfd, Make R3 & 4 100k, and add 10 ohm R in series with a 10mfd with + side of cap toward pin 4 of the op amp and the other end to Arduino ground, i.e. a snubber RC at the output of the op amp. That should shut everything up. Also the 358 and other generics should work fine as the only thing it sees is quiet 2.5 v DC reference voltage bypassed to ground. And use low leakage split bobbin xfmers to isolate the windings from line noise. It appears the inputs of the Arduino should only see 60 hz and the first few harmonics of the whatever system this is monitoring judging from what I see here. Good luck. Quiet is always good.
 

JLambert

Joined Apr 17, 2020
4
Raising the positive power rail .. will fix one problem (signals too close to the positive power rail).. but not address the negative power rail (ground). Coming up with a -2v (or more) in addition to a higher voltage for the positive power rail is likely harder to provide. I do get your point. However, there are many rail to rail op amps that could replace the originally spec'd part.. and are available. I agree, quiet is good.
If I was to address the need for a 2.5v low impedance virtual ground . .. I would simply use a single linear 2.5v power regulator with appropriate output capacitors. There are many available. But this type of solution strays from the original question being posed.
 

MrAl

Joined Jun 17, 2014
13,728
Points are starting to repeat. To summarize:
He is measuring current and the LM358 is making a low impedance reference at 2.5 volts
An alternate means of applying the 2.5 volt reference proposed by @Ian0 is in post #7, making the LM358 redundant.
Per @dendad in post #12 It is a good idea to provide overload protection to the input of the A-to-D

Such a protection circuit is shown below. It might also be sufficient (Given that this is an AVR) to merely use a 10k resistor in series with the input and let the input clamp diodes take the clamping current.

Edit: Replaced circuit. For an analog input I would use a resistor of 10k.
View attachment 266580






Hello,

I think that circuit needs a little more modification.
A second resistor between the two diodes junction and pin 9. The internal protection diodes are most likely lower forward voltage diodes.
Also, changing 1N916 to a Schottky type is better as they will have lower forward voltage too.
 

JLambert

Joined Apr 17, 2020
4
You don't need an op-amp - this circuit will centre the output on half supply.
One thing you DO need is a protection resistor between the output of the CT and the A/D input. Otherwise, whenever the is a surge (inrush current) on the mains the output of the CT will blow up your Arduino. The two 10k resistors will achieve that at the same time as biassing the input to half supply.View attachment 266459
 

JLambert

Joined Apr 17, 2020
4
If the input impedance of the analog input is high enough and only one sensor is being used .. Yes , two 10K resistors can replace the original op amp.
The ardunio's analog DYNAMIC input impedance isn't very high. The source impedance for ardunio's could be as high as 100meg for signals that are nearly dc. However this can be misleading. Typically a large capacitor across the DC source signal will lower the dynamic nature of the ADC's impedance enough to work. While monitoring AC signals -even as low as 60 hz- this option (cap) isn't viable. Better to provide a much lower source impedance (less than 500 ohms) for any moving (above 2hz) analog voltage. The analog input impedance requirements of ardunio's (indeed- many microcontrollers) has been a source of confusion for many people over the years. In this case, best to think of it as a switched capacitive load with the switching occurring over a large freq range - dependent upon the software. Simpler solution is to keep the impedance low from the signal source or put a buffer on the input of the ADC.

As others have noted... the original circuitry references the 2.5v reference and this is to be fed to undefined number of sensor inputs... meaning the actual impedance requirements for the 2.5v reference is unknown. I would not assume this reference is only going to be used for one sensor or what the impedance of the OTHER analog inputs being monitored are. So, using two 10k resistors to divide a 5v power rail to provide a 2.5v reference will likely cause problems. Besides . there are 2.5v linear voltage regulators (in SOT-23 packages) nearly as cheap as two resistors! However if the 2.5v reference was to be used for only one sensor .. yes, two resistors (I would lower still their resistance) should work in creating the 2.5v reference.

However the title of this discussion was "using the LM358 instead of LMV321 op amp", so providing alternative (better) circuitry to perform the required function is going a off topic. The man needed to be aware of the significant differences between these two op amps. rephrased: the question posed by the title was about op amps .. not how to monitor AC current. I have many better circuits to make it possible for an arduino to monitor AC power, currents. etc.. But that wasn't the question, that was his circumstances. Not that helping him out with "improvements" isn't a bad idea, and following discussions can hopefully provide additional educational insights. .. all good.
 

Ian0

Joined Aug 7, 2020
13,163
The LM358 is NOT an acceptable substitute for the LMV321 in this circuit.
Primary reason: the LMV321 can perform "rail to rail" .. the LM358 can not (it requires a minimum of 1.5v of head room from positive and negative power rails). if any signals (in or out)) is below 1.5v or above 3.5v - assuming room temp (using 5v power rail).. the LM358 will not perform as intended. Over the extended temperature range things only get worse.
The issues and alternative solutions mentioned by others are valid, but the simplest, most direct solution .. use a different op amp.

another issue: most DVMs are not suited for trouble shooting this circuit.
The LM358 just has to output 2.5V. It can manage that, as it can swing to 1.5V below he positive rail.
 

MrAl

Joined Jun 17, 2014
13,728
Mandatory reading for all the people thinking an LM358 can do everything: "TI Application Design Guidelines for LM324/LM358 Devices SLOA277". Covers many subtleties.
Hi,

You mean like biasing the output to reduce crossover distortion for example?
I found that out many many years ago but tat the time i did not know why it worked. I was playing around with making an headphone amplifier for someone and i noticed that when i changed the circuit slightly the 'subtle' buzz fuzz went away. I like that idea, but didnt know the theory behind it at the time. It sounded much better like that so i used it like that.
Now i know it is because output biasing can keep the lower transistor 'off' so there is no longer a crossover point just the upper transistor works into the output pull down resistor. Sounds a lot lot better like that. It's like wasting an internal transistor but who cares it's a 50 cent IC piece.

We also used them in thousands of dollars synthesized sine wave converters with 1 percent THD and 90 percent efficiency and this was way back in the 1980's. We sold to various military and universities and Sandia Labs for experimental use on solar energy conversion. All or most had at least one LM358.

So anyone who says they cant be used for anything simply does not know every application under the sun. They have their niche that's for dang sure.
 
Top