# How to offset AC voltage with varying input?

I want to offset an input sine wave, while being able to adjust the input voltage.

For example a sine wave of +-3 V should be offset by 1.5 V such that the sine wave never goes below 0 V. However I want the same circuit to be able to offset correctly +-2 V by 2 V, such that the lowest point of the negative cycle (-2 V) would remain exactly at 0 V once the offset is introduced. The same goes for +-1 V with an offset of 1 V etc.. I am looking to be able to offset 0 - 3 Vpp input range.

I have thought of connecting a variable resistor as a voltage divider across a well regulated voltage, and buffer the output by using a follower amplifier, however I do not wish to stay doing this manually.

What would be a good approach to go about implementing the above? Any ideas would be appreciated.

• How precise does it need to be? en.wikipedia.org/wiki/Clamper_(electronics) shows some simple circuits that may work. – vofa Jan 15 '18 at 17:50
• @vofa, with a little more detail, that would be an answer rather than a comment. – The Photon Jan 15 '18 at 17:54
• If you want the RMS value you might be going about this the wrong way. This sounds like an XY problem to me. – Andy aka Jan 15 '18 at 18:03
• Still sounds like an XY problem to me. Are you aware that a diode clamp will still generate a small negative voltage circa -0.5 volts. If you are trying to calculate RMS then it's better to take the AC through a fixed dc offseting circuit. Then you know the DC offset and the peak is what your MCU measures minus the offset. I am trying to guide you to make the best choice. – Andy aka Jan 15 '18 at 18:10
• @Andyaka, I appreciate your helpful comments. That is surely simpler and may even provide a better solution. I will implement and test both. Regarding the original question (forgetting the RMS part), before asking this question I searched rather extensively for a solution to the above question and the answer below is what I was looking for. – rrz0 Jan 15 '18 at 18:27