By my Arduino "oscilloscope" I measured voltage on the + input and the output. Difference should be about 1000 times more than input offset. Common mode voltage was created by 3k3 pot. I wanted to stabilize the voltage by C1 - 100n ceramic cap to "smooth" potential noise from sampling by the Arduino. But with the cap the results were worse than without it. The measured values were more noisy, offset voltage was higher and it was much more sensitive to "touch" - the closer my hand was to the wires (or to USB cable powering Arduino from laptop connected to mains) the lower was offset voltage. When firmly holding the USB cable the offset was about the same as without the cap.
Do you have any idea why adding the cap changes the circuit in this way?
I am using only single (Arduino 5V) supply. So Arduino GND is -Ve and the output of the pot may be considered "virtual ground".
Yes, you connect both inputs to that.
Still I don't understand how "smoothing noise" influences readings
Imagine a voltage that spends most of its time at voltage V and every few mS has a spike of size Vs. Without a capacitor you will measure V, Even when a spike comes along during the measurement it will have little or no affect because the measurement averages the voltage.
However with a capacitor when Vs comes along the capacitor will be charged to a voltage V+Vs This charge will be held by the capacitor and so any measurements will read V+Vs
Voltage spike low enough 14pF S&H cap (hidden behind 100k resistance) in ADC does not notice but large enough to charge 100nF cap? I will try to draw it and make some estimates but it sounds suspicious.
By my Arduino "oscilloscope" I measured voltage on the + input and the output. Difference should be about 1000 times more than input offset. Common mode voltage was created by 3k3 pot. I wanted to stabilize the voltage by C1 - 100n ceramic cap to "smooth" potential noise from sampling by the Arduino. But with the cap the results were worse than without it. The measured values were more noisy, offset voltage was higher and it was much more sensitive to "touch" - the closer my hand was to the wires (or to USB cable powering Arduino from laptop connected to mains) the lower was offset voltage. When firmly holding the USB cable the offset was about the same as without the cap.
Do you have any idea why adding the cap changes the circuit in this way?
The problem may not be the cap, it could be that your circuit is oscillating.
1000x gain with a single opamp stage is ambitious. You need good decoupling on the supply rails to get
away with that, and care with layout and use a ground-plane...
Much much easier is just add a 1nF (or so) cap in parallel with R2 so the gain reduces at high
frequencies. You are only interested in the DC response anyway. Good practice with opamps is
to use multiple stages for high gain sitations both because this reduces likelyhood of oscillation and
has higher bandwidth response (each opamp stage is limited by the gain-bandwidth product).
Any mysterious problem affected by hands near the circuit is likely to be high frequency oscillation due
to stray capacitances/inductances, or as hear by very high gain amplifier. Or with a CMOS input it
could be a floating input.
OK, I will try again when I get home. Since I am interested in DC is higher cap = better result or will too large cap parallel with R2 cause other problems?
I thought I cannot use more than one op amp if I want to measure the offset correctly - because offset of next stages will add with the result. Only now I realized if the measured op amp increases its own offset by more reasonable amount (100 times?) the offset of next stage will be neligible.
allanhurst:
If you need a low offset opamp , buy one. Eg a OPA192 ( 5uV)
The LM2904 is a very old, not very good device by modern standards.
Allan
I don't need low offset op amp so badly. Even if I had one I would like to measure the offset (because I am curious) possibly running into the same problem.
And LM2904 has one huge advantage: I have a few of them and they are so cheap realeasing the magic smoke does little harm. On contrary our local store does not have OPA192 which makes difficult to get it. If I damage such "rare" chip it is ever considerable loss.
allanhurst:
If you want to do this,
...
Allan
How is this different from my "virtual ground" created by the pot? Except with the pot I am simulating conditions closer to "real life" and I can measure offset over whole common mode range, not only one point? (And 4/ which was missing in my original setup ofc.)
Smajdalf:
Voltage spike low enough 14pF S&H cap (hidden behind 100k resistance) in ADC does not notice but large enough to charge 100nF cap? I will try to draw it and make some estimates but it sounds suspicious.
No you are not understanding at all if that is what you think that is what I said.
Grumpy_Mike:
No you are not understanding at all if that is what you think that is what I said.
I still have no clue how the noise looks and where it comes from that a cap may increase it. Explanation that the cap helps the circuit to oscillate at too high frequency (or too low amplitude) for me to notice is more understandable for me. Maybe you meant the same thing?
EDIT:
I added the cap parallel to R2. No difference. Adding one additional cap from + input of op amp to 5V made the problem worse. Then to prevent other op amp in the package from floating I let it buffer the voltage made by the pot. When I measure the the buffered voltage problem is gone. When I measure the output of the pot directly problem returns. My conclusion: sampling output of the pot makes output of the op-amp go crazy. It is probably caused by quick voltage drop (increase?) caused by connecting the S&H cap. Why adding capacitor makes it worse instead of better is still mystery for me.
BTW oscillation I managed somehow to make the circuit oscillate when changing connections when the circuit was powered ;-). But after removing and restoring power oscillations did no reappear. I know it does no rule out oscillation on higher frequency/amplitude but still...
EDIT 2: Sampling via 10k resistor makes the problem much smaller than sampling directly if C1 is present. But no problem with or without 10k resistor when C1 is removed.
EDIT 3: I tried most of different caps I have. From 100pF to 4700uF the behavior was nearly the same. 22pF cap did not cause this - output of op amp was stable as if no cap were present.
The LM2904 is a dual op amp. What are you doing with the other op amp while testing this one? If you leave it disconnected, or simply ground both inputs, it may be going into oscillation or saturation and affect the other op amp section.
polymorph:
The LM2904 is a dual op amp. What are you doing with the other op amp while testing this one?
At first I left it unconnected. Later I used it to buffer voltage from the pot give it "something to do" to avoid such problems. I did not notice any difference.
I think the layout must be inportant here - could you post a photo?
If it's on plugin breadboard, there's so much unpredictable stray capacitance and coupling that all bets are off - perhaps even for a low GBW amp such as a LM2904.
allanhurst:
If it's on plugin breadboard, there's so much unpredictable stray capacitance and coupling that all bets are off - perhaps even for a low GBW amp such as a LM2904.
Yes, it is solderless breadboard.
TomGeorge:
Can you post a complete circuit diagram of your project.
Most of time it is like the original schematics. Op amp isbpowered directly from Arduino Uno GND and 5V pins with own 100n ceramic cap.
TomGeorge:
Try a lower gain, like 100.
I tried explain changes I tried in previous posts. I also tried 1st opamp with gain 100 and second with gain 10 with minimal difference.
TomGeorge:
Gnd the input rather than use a pot.
The problem is probably caused by sampling output of the pot by Arduino but only when a pot 100pF or higher is connected as shown in OP. Removing the pot will remove the problem.
Hi,
Please a picture of your project and can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Showing how you are powering the amp and the Arduino controller.