I'm trying to measure (with a 3.3 V ADC) a low frequency (about 20 Hz), low voltage (± 160 mV) ripple that is superimposed on a 12 V signal (so 12 V ±160 mV). I need to determine both amplitude and phase of the voltage ripple (and also react to the zero-crossing of the ripple component), so I'm planning to measure the whole signal and process it in the microcontroller. To do that I'd like to remove the 12 V component (replace it with a 1.65 V component) and amplify the low frequency ripple to at least ±1 V (preferably with a 500 Hz-ish low-pass filter as well).

It's complicated slightly by the fact that the 12 V signal is occasionally pulled down to 0 V, although I won't need to measure the ripple during this time.

The circuit has a 12 V power supply and a 3.3 V power supply; no negative rails.

If the frequency of this ripple signal were high (kilohertz rather than hertz), I'd use a DC blocking capacitor to get rid of the 12 V DC and then amplify the signal around 1.65 V to get a decent signal for measuring with the ADC. However, the low ripple frequency makes that impractical so I'm looking for other approaches and that's where I'm struggling.

I've been playing around (in a circuit simulator) with using resistors to reduce the DC voltage but allow me to amplify the AC, but I'm struggling to get something that feels robust (and that I understand - most of this was putting resistor values in that I thought should work and then changing them dramatically when they didn't). If I try to add any LP filtering for noise immunity, the output seems to be garbage so I'm showing my lack of understanding of single-sided supplies and how to handle this sort of situation.

First Attempt

(the bit highlighted in blue is just for the purposes of this post to give an indication of what the signal I'm trying to measure is: 12 V with a 160 mV 20 Hz ripple superimposed and occasionally pulled down to 0 V).

Are there better ways of doing this that will give me a robust 1.65 V ± 1 V at 20 Hz output that can easily be measured with an ADC on a 3.3 V microcontroller?


2 Answers 2


enter image description here


simulate this circuit – Schematic created using CircuitLab

First opamp buffers the signal and the output from RC low pass filter is a mean value. The input and mean value are subtracted by use of indirect current feedback instrumentation amplifier with G=8. Vcc is at least 15V. On the output there is a limit resistor that limits current if the output exceeds 3.3V when connected to the internal ADC clamp diodes.



simulate this circuit

If only 12V is available and source impedance is low enough, then you could use resistor divider to halve the input voltage and increase the gain from 8 to 16.

There are yet 7 devices from AD to suit your demand.

enter image description here


If you're trying to measure voltage across a resistor to get current, a current sense amp like MAX4376 will solve your problem.

I agree that a highpass filter could be a problem: if you want accurate phase on this 20Hz ripple you'll have to use a much lower highpass cutoff frequency, which needs a large cap, which needs to be accurate, and that's neither cheap nor small. On top of that, when your signal drops to zero, you'll have to wait until the highpass settles to measure the ripple.

So, you can definitely remove a DC offset by substracting a DC voltage, but the voltage you substract must track the DC level of the input voltage. If it doesn't track, and the 12V input voltage is 5% too high, and/or the voltage you substract is 5% too low, that's already 1.2V off target, much more than what you're trying to measure. Note by "track" I mean it should come from the same reference, like a regulator, same teperature drift, same inaccuracies, etc.

If the DC level of the 12V input signal is the same as your 12V power supply, then that's easier: you have a reference voltage to substract from the input voltage, and that will track its DC level. Some care will be needed if the 12V supply has ripple though, because that will be added to the measurement.

However if the DC level of the 12V signal is not related to your 12V power supply, or to any other voltage you can access, then you have to think about how much they can vary relative to each other. Also factor in tolerances in your resistor dividers. That will give you a value of DC error at the input, which then sets the maximum gain of your opamp so the ADC stays in allowed range.

I've had a similar problem recently, to measure small voltage variations on top of a larger DC voltage. I ended up using an I2C DAC to compensate the DC offset, and a bunch of opamps to substract that from the voltage to measure and add gain for the ADC. Software adjusts DAC output voltage so that the signal stays within the ADC bounds.

Note 160mV with a 3V3 ADC is about 200 LSB so even without gain you could measure it with reasonable accuracy. It is not always the best choice to use maximum gain, sometimes you don't really need all the bits. If you really need a lot of gain, and your DC offset can change, then you'll probably end up with a DAC. If you don't, maybe you can save yourself the trouble. I can't answer that for you, so you should start with that.

The second opamp is useless in your schematic. Most microcontroller ADCs will work just fine with a 1 kOhm source impedance or even 10k, so there is no need for a follower, that'll save you a BOM item for a 3V3 RRIO opamp. You can put a small cap at the ADC input to make a lowpass filter too.

If you have some 12V available, it will probably be cheaper to use a trusty cheap opamp like LM324. The protection zener is necessary though. Make sure when the opamp's output is clipped to +12V, no excessive current/dissipation occurs in the opamp, diodes, resistors, etc, and that the zener's clipping voltage is what you think it is at the maximum current it will get. With 1k, opamp clipped at +12V, you'll get close to 0.1W in that 1k resistor, that's a lot for a 0805 SMD.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.