# Ripple on operational amplifier output

I have a circuit made of a sensor whose output is subtracted by a number and then multiplied. I do this with operational amplifiers:

U2.2 subtracts 3.3/2 volts from the sensor output. This is then multiplied by 2 by U2.1. I have tested voltages at key points (voltage divider R9-R10 and U2.1 output) and they are as I expect. The current consumed by the whole circuit is ~250uA, which is expected as per the OPA2344PA datasheet.
Also, as you can notice, I have not added any filter or decoupling capacitor whatsoever (yet). This applies as well to the sensor, which is not visible in this circuit as I didn't find it as a component in my circuit designer app.

The output Vout is the following:

As you can see, it is not stable. I believe it is not oscillating because, as far as I understand, if it were oscillatinng I would see it either sticking to a rail (0 or 3.3V) or bouncing from rail to rail. However, the output remains around 1V.

My question is, is it oscillating? If not, is it normal that it's not stable, considering that the LMT87 output is constantly (slightly) changing its value (due to the fact that temperature is never fully constant)? How is it that the output changes in such a regular manner (like a deformed sine wave)? Shouldn't it jump randomly?

If this is expected, this can be solved with a capacitor at the sensor's output I think. Or should I put it at U2.1's output? How can I estimate how big the capacitor needs to be?

## EDIT

As the comments request, I have obtained more captures.

The problem doesn't seem to be the power supply (it is an EVENTEK KPS3100D, this is the only reference I have found). The captures are below:

It normally looks like this:

But I also catched it doing this:

The voltage divide seams pretty stable:

That captures the voltage divider node before R2, that is, the junction of R9 and R2.

However, the ripple clearly comes from the U2.2 negative terminal; this is the capture of the junction of R2 and U2.2 pin 2:

I have tried to remove the connection between U2.2 pin 1 and U2.1 pin 5 and the result is the same.

Also, the voltage at lmt87 is:

And the voltage at U2.2 pin 1 is:

• Please edit your post and provide images of these additional oscilloscope traces: (a) your 3.3 VDC power supply voltage (do not use a DMM to measure the power supply); (b) the signal labeled "lmt87"; (c) the voltage at U2.2 pin 1. Commented Jun 17, 2023 at 0:05
• There's no reason to use two op amps for this task. Commented Jun 17, 2023 at 1:06
• The period of the signal is 20 ms, which indicates 50 Hz noise. 100k resistors provide a high impedance and noise sensitivity. You should be able to track it down by scoping the nodes. Commented Jun 17, 2023 at 1:17
• If you switch to a single op amp solution (as others have indicated), and if you continue using the OPA2344PA IC, be sure to properly terminate the unused op amp in the OPA2344PA package. If you're unsure how to do this, perform a web search using keywords like "terminate unused op amps". Analog Devices, Texas Instruments, etc. publish useful information online (e.g., application notes, YouTube videos) that cover this topic. Commented Jun 17, 2023 at 13:15
• Dan, I should have mentioned this before, but it didn't occur to me. When measuring the power supply voltage, measure the voltage directly at the op amp's power input pins--i.e., at pins 4 and 8 on the OPA2344PA op amp. If possible, use a low-noise differential voltage probe rather than a typical 1x or 10x oscilloscope probe. Also, set the oscilloscope's TIME/DIV setting to 10 ms/div and select AC input coupling when measuring the power supply's noise voltage at the op amp's power input pins. Do not use the oscilloscope's "automatic setup" button to measure noise on a DC power signal. Commented Jun 17, 2023 at 13:57

As suggested by users in the comments, this would most likely be due to ripple in the +3.3V power rail. Such ripple could be injected via R9, or via the very signal you are processing, LMT87. The frequency of 50Hz is suspicious, and points an accusing finger right at the power supply.

What you are seeing is what I would expect to see if the +3.3V regulator was dropping out, due to its own input falling below the limit imposed by its drop-out voltage. Check the input voltage to that regulator. The 20ms interval is highly suggestive of ripple from a half-wave rectified, 50Hz, mains transformer output.

That ripple could also affect the maximum output potential of the op-amps, and cause clipping, and the clipping level will also be varying. This can of course be verified by measuring the waveforms of the supply, at the junction of R9 & R10, and at input LMT87.

Assuming that the supply is indeed the problem, any ripple in that supply, even if it's only small (say 10mV) will find its way into the signal via potential divider R9/R10, and so you aren't out of the woods yet.

While you can't do much in this section of circuit to clean up LMT87, you can mitigate noise at the junction of R9 and R10, with a simple capacitor, or by using a voltage reference:

simulate this circuit – Schematic created using CircuitLab

Both those circuits have the Thevenin equivalent shown underneath, which is important, because it affects the behaviour of your circuit. If I redraw the first stage (the differential amplifier part) with this Thevenin equivalent in place of R9 and R10, you can see why:

simulate this circuit

Since the effective source impedance of your derived +1.65V reference is 5kΩ, which appears in series with R2, you must account for this additional resistance, and make $$\R_2 + R_{TH} = 100k\Omega\$$.

By failing to do this, your output is not exactly $$\V_{LMT87} - 1.65V\$$. The same principle applies to any source impedance of your sensor signal.

Finally, the relationship $$\V_{OUT} = 2(V_{LMT87} - 1.65V)\$$ can be achieved with a single op-amp, by giving the differential stage a gain of 2. Simply double the value of R1 and R6:

simulate this circuit

• In the Thevenin equivalent, shouldn't R2 be 100k and so the negative terminal has a total R of 105k? Just in case, I have calculated the expected output of the differential amplifier (using the formula here: electronics-tutorials.ws/opamp/opamp_5.html) this time not assuming all impedances are 100k, but assigning 105k to the one in the negative terminal. As you say, the result is slightly different than expected, but could this be causing the ripple?
– user222967
Commented Jun 17, 2023 at 12:28
• @Dan The resistor values aren't causing the ripple. As I explained, I suspect the input voltage to your 3.3V regulator is falling too low. The gain of your differential amplifier is $\frac{R_1}{R_2+5kΩ}$. All imepdances along that path with R2 in it must add up to exactly 100kΩ, if you want the gain you expected, which requires that you reduce R2, to make the total 100kΩ. Commented Jun 17, 2023 at 13:38

Instead of connecting my power supply directly to the rails, I have connect it to a 3.3V regulator (LM2575), and this regulator otuput's to the +3.3V rail. The ripple has disappeared.

So it clearly seems that it came from the power supply as others mentioned in the answer and the comments, but I don't see how. I measured the +3.3V rail and it seems pretty stable as shown above.

Also, I removed the voltage regulator again and measure both the 3,3V rail and the power pins in my op. amp. (pins 4 and 8) in AC coupling mode, as @Jim Fischer mentioned in the comments. Everything is still quite stable, I don't see anything similar to a ripple.

Finally, as others mentioned as well, there is no need to for using 2 op. amps. to do what I want, I can set just one op. amp. as @Simon Fitch said. Anyway, as explained in my question, I did try removing the second stage and the ripple was still there, originated at the differential amplifier negative input terminal.

## EDIT

I have tried as well to connect my power supply directly to the rails again, but this time I have connected as well a 330 uF capacitor between Vcc and GND. The ripple disappears again. It seems such ripple was indeed present in the power supply; I don't really understand how was it not visible in my oscilloscope. It is a cheap Pico Scope though.