lmv321 equivilant

Hi all,

After successfully building an arduino based energy monitor following the guide on this site i decided to upgrade and try the 'Buffered Voltage Bias circuit'. I couldn't source an Lmv321 in a package i could use easily so having limited knowledge of op amps i asked on the arduino forum for advice on a like for like  equivalent. I was advised to try an LM358P, but am getting readings of over 400V from the circuit. Does anyone know if the op amp i have can be used with an altered circuit (in which case, what do i need to change?) or have i been wrongly advised that this op-amp can be used as a replacement? Any guidance would be greatly appreciated. 

Robert Wall's picture

Re: lmv321 equivilant

Have you used the correct pin numbers for the LM358? The LM358 is a dual package, the LMV321/LM321 have different pin numbers as they are a single package. Download the data sheet to check.

What dc voltage do you have on the output pin? Is it unstable and oscillating? Try a small capacitor from the output to GND.

Ad84's picture

Re: lmv321 equivilant

Thanks for the quick reply,

I made the circuit up on my breadboard replicating the one described in this site. (i used a 1uf capacitor and 20k resistors for R3 and R4). I am running the circuit on 5V.   I adjusted the pin numbers for the different op-amp using only one channel. The output is stable, and reading over 400v ( i've tried the circuit twice in very short runs  from fear of damaging something, one first attempt and then a re-try when id checked everything again, i should have recorded the actual figure i think 418.something Volts).  This give any further clues as to whats going wrong?

.....By output pin you mean of the op-amp? If you think  the circuit wont break anything ( i guessed it might be near to going below 0v  at the ardiuno input as the voltage reported was so high or am i way off the mark?) i'll try it again and post the result. Thanks again.

Ad84's picture

Re: lmv321 equivilant

.....By output pin you mean of the op-amp? If you think  the circuit wont break anything ( i guessed it might be near to going below 0v  at the ardiuno input as the voltage reported was so high or am i way off the mark?) i'll try it again and post the result. Thanks again.

Robert Wall's picture

Re: lmv321 equivilant

It's not possible for the op-amp output to go outside the input range of the Arduino as they are both fed from the same supply.

Confirm you are using the same sketch - inserting the op-amp to buffer the 2.5 V bias supply should change nothing.

Regarding "i guessed it might be near to going below 0v  at the ardiuno input as the voltage reported was so high" - yes, you are way off the mark. Look at Building Blocks - "Measuring AC Voltage with an AC to AC power adapter" and you'll see that the voltage should swing between 0 V and 5 V on every cycle, and should sit at 2.5 V with the adapter unplugged. That wave is converted to a rms voltage in the software, as you know. If you're reading > 400 V, you cannot have the correct signal on the Arduino input pin. Do you get a silly voltage with the adapter unplugged? (It should be very close to zero.)

Ad84's picture

Re: lmv321 equivilant

The sketch i was using used the standard emonLib.

I tired the circuit again, I got 4.7-4.8v on the output pin, readings > 400V again. After leaving for a few mins it was evident that it wasn't stable either. I checked the continuity of all the points on the (cheap) breadboard and they were okay too   At this point i was ready to give up, then i decided to try the other channel (B), knowing this should make no difference i hadn't tried it before and didn't think it would work either.

However it did! I got 234v reported. My supply was 241V at the time so i calibrated as necessary. Incidentally  the op-amp free circuit required no extra calibration and read the voltage correctly  just with the correct AC/AC adapter  calibration no.

The question is now whether to replace the op-amp as one channel  isnt working correctly? I dont need the other channel but am concerned i have a dodgy chip. 

In the last 6 months since ive started playing with ardiuno and electronics ive been avoiding op-amp operation about time i educated myself i think.

Anyway, thanks very much for helping me troubleshoot my problem and steering me in the right direction.

Robert Wall's picture

Re: lmv321 equivilant

My guess is you did something to the 'A' channel of the op-amp and it is dead. If it is not taking excess current and getting hot, it is probably not worth changing it.

calypso_rae's picture

Re: lmv321 equivilant

As far as I'm aware, I was the originator of the buffered reference idea as described at http://openenergymonitor.org/emon/node/673

The LM358 seems ideal for this application because it only requires a single voltage source and its output can swing very close to the power rails.  I have never tried using any other type of op-amp.  The standard 741 variety is clearly not suitable for this application.

No part of this circuit should ever display a voltage that's beyond the voltage rails.  240 V (AC) should only be present on the primary side of whatever is supplying your AC and AC signals. 

Ad84's picture

Re: lmv321 equivilant

I reckon i did something to it too. It was late. The chip isnt getting hot and is using minimal current so i'll keep it. Thanks for the advice Robert.

I am using a 9V AC-AC transformer (one of the ones described on this site)  to  measure the voltage so 240V AC is definitely only present on the primary side.

The phrases "rail to rail output swing" (as in the lmv321) and "large output voltage swing" (LM358) make sense now.

Thanks again for all the advice.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.