Author Topic: Unity gain op amp gives static but why incorrect output occured  (Read 3411 times)

Maydori

Unity gain op amp gives static but why incorrect output occured
« on: October 13, 2016, 03:25:38 AM »
Here is the circuit I gonna shown you around :

When I'm using a switching regulator (not the linear 78xx shown) to provide me with 5V to power an Arduino and a little more circuitry that the Arduino is monitoring. The Arduino is measuring (and logging) the voltage at A - ie I'm logging the input power supply voltage (which varies ~12.7 > 14V according to the solar charging the 12V batteries).

Without the op amp (ie measuring the voltage directly from the potential divider [and with resistor values ~1/2 of that shown]) the voltage logged is as expected. I want the unity gain op amp so as I can increase the resistor values to reduce the current drawn.

However with the op amp in place the output (A) is a static ~3.74V. I measured this directly at a time when the voltage to the +ve op amp input was ~3.85V, and I also know from reviewing the logging that the voltage on the output of the op amp was static throughout the previous day*.

I'm probably making some rookie mistakes, I'm new to the idea of an op-amp as a buffer - in this case I'm using an LM358 (datasheet pdf) http://www.kynix.com/Detail/1169685/LM358PWR-JF.html as it's what I have available - I'm very open to suggestions of a more appropriate amplifier. While I could get away without it in this case, I do want to minimise the current drawn here, and I will also be logging the solar voltage (~70V) so will definitely want > 10k resistors in that potential divider and will therefore need a buffer.

*the voltage is logged whenever the scaled measured voltage varies by 0.05V (ie battery voltage goes 13.1 -> 13.15). Without the op amp this logged ~1000 entries in a day. With the op amp it logged half a dozen, and these varied only within ~12.4-12.5V (despite the solar MPPT charger reporting the day max of 14V).

antonis

Re: Unity gain op amp gives static but why incorrect output occured
« Reply #1 on: October 13, 2016, 05:49:05 AM »
What is the Vcc to your op-amp..??

(I suspect that your amp is constantly hitting the possitive supply rail..)
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

joeko

Re: Unity gain op amp gives static but why incorrect output occured
« Reply #2 on: October 13, 2016, 11:18:06 AM »
To expand on antonis's suggestion, you may be violating the CMVR (common-mode voltage range) of the op amp, which will not behave as expected when the inputs are within 1.5 V of Vcc. On the datasheet this is described in "Input Common-Mode."

If you are dealing with 5 V it will be hard to stay within this range (0 to Vcc - 1.5), in which case you might try one of the following:
1) Raise the value of R1
2) Change to a rail-to-rail op amp like the MCP6001

If you are getting a noisy signal, you may also want to put a LPF on the output of the op amp. Btw I'm new here (and by no means an expert) so maybe someone more qualified can confirm or throw out my suggestions :)

slacker

Re: Unity gain op amp gives static but why incorrect output occured
« Reply #3 on: October 15, 2016, 07:59:36 AM »
The opamp won't help you reduce the current draw, the voltage divider in your schematic draws at most 0.5mA, according to the datasheet the typical supply current for the opamp is 0.5mA so you're not gaining any improvement adding the opamp even if you use much bigger resistors for the divider. Unless you're powering down/sleeping the arduino and the regulator between measurements they will draw far more current than the voltage divider in any case.