# How to offset a sinusoidal voltage centered at 0 V for power grid measurements

I am trying to take voltage and current measurements from the power grid (120V 60Hz) and process them with a 3.3V based digital signal processing board (TI F280049C launchpad)

I am using LV25-P and LA55-P sensors which gives outputs of between +3V and -3V centered around 0. Eg: a line voltage of 120 V gives an output of 2 V, and a line voltage of -120 V gives an output of -2V.

I need a way to reliably shift the sensor outputs so that I only have positive voltages between 0 V and 3 V (technically between 0 and 3.3V, but I want a safety margin).

I have seen a few threads talking about similar problems for audio signals (4,5,6), but I think my issue is slightly different since I am dealing with a much lower frequency (which would make some of the cap-based solutions unfeasible) and because I need to process the input signal and would like to know the exact offset voltage.

So, my question is, if there is a simple circuit that can shift the voltage of my measurements and allows me to measure the offset value, or is this usually done digitally? And, if the offset is usually determined digitally, does the circuit below seem like a good away to implement an offset?

I am a 1st year PhD student and have a Bachelor's degree in electrical engineering, but most of my circuit design experience is from my classes, so I really appreciate any corrections if I am making any obvious mistakes.

My current circuit and the formula I use to calculate the output: (In this case the input measurements are +- 10V and at 1kHz, but the principle is the same)

Thank you very much for your time

• 60Hz is in the audio range. Capacitative coupling can work fine. Commented Jun 16 at 1:09
• May as well add datasheet links: LV25P and LA55P. Commented Jun 16 at 2:06
• Thanks for the feedback @periblepsis. I have updated the original post to include links datasheets. Commented Jun 16 at 18:33
• @Larcron Just looking quickly at the LV 25-P, it appears it requires +/- voltage rails so that it can null the flux. Do you have such supply rails? Or am I just misreading the datasheet? Commented Jun 16 at 20:41

Regarding the shift of the signal, why the low frequency is a problem? I think that you can use just a voltage divider to reduce the amplitude, a capacitor and then add the bias. Something like this:

• That's a great solution! I thought I had to use prohibitively large capacitor values to implement something like this but I guess I forgot that you can just use a large resistor value instead. Thanks! Commented Jun 17 at 1:21
• Another possible simple solution would be to get rid of the negative half of the wave with a schottky diode to clamp it to GND, if you can get away with just the positive half. Or rectify the signal. And eventually amplify it a bit with the opamp.
– Gos
Commented Jun 17 at 5:51
• What type of capacitor would you recommend? I have a circuit like this with a ceramic in a product and it's variation is enormous. (I only need frequency) Commented Jun 17 at 8:30
• Well, I'm not an expert, maybe others can help. I would say SMD ceramic caps should be ok. But the reactance varies with the frequency, what is your frequency range?
– Gos
Commented Jun 17 at 11:18

You can use an differential amplifier.
For example, I've used this circuit for this exact purpose several times:
(filtering components removed)

The bias of 2.5V (or 1.65V for 3.3V system) can also be generated by an opamp buffer.

The DSP behind it is simple:

1. Run it through a high pass filter.
Practically this means to subtract the signal from the output of two cascaded exponential moving average filters.
2. Scale the waveform with the calibration factor that includes the attenuator and reference.
3. Buffer enough samples, execute a window function and calculate the RMS over this.

This yields an accurate RMS value several cycles after power on.
Both the low-pass filters and RMS via the window function have a settling time.

The exact electrical value of the offset voltage is irrelevant. I often do measure this 1/2-Vdd signal for validation. You could also derive this from the low pass filter output or unused channels.

However, this circuit may struggle with DC+AC signals.

• Thanks, I solved the circuit and it seems like the true offset is only equal to V_ref if R9=R8 and R10=R4 exactly, and any mismatch would cause a deviation between the measured and true offset. Is there any topology that will allow me to measure the true offset voltage directly or is that just a pipe dream? Commented Jun 16 at 19:39
• @Larcron You can measure the offset by low-pass filtering the signal agressively. You'd need this anyway, if you subtract this low-pass filter output from the original signal you've created the required high-pass filter for further processing. The exact electrical offset voltage should not be that important in your design if you want it work in quantity and wide temperature range. Commented Jun 17 at 8:01

You can use a precision rectifier (aka "absolute value" circuit), together with a polarity indicator (aka zero-crossing detector). This avoids the need to provide a precision offset to the input signal - ie: zero input gives zero output. A good estimate of the DC offset of the input AC signal may be obtained by integrating the raw AC input signal.

All of these circuits have been around for decades. The links below show some circuits for a precision rectifier:
Seeking circuit of precision rectifier (or absolute-value) with "high bandwidth"