Electrical – AC voltage sensing circuit

acsensing

In a project I'm working on, I am designing a Totem pole PFC, and for the controller (using a digital controller) I need to sens the input voltage, which is an ACvoltage and feed it to the ADC of the digital controller and do the necessary calculations.

My question is regarding a circuit that senses and scales down the input voltage so I can feed it to the controller.

I tried this circuit:
AC voltage ensing circuit

Idealy the results will be as follows:
enter image description here

And the output voltages are:

V1 = VN * R2/(R1+R2)

V2 = VL * R2/(R1+R2)

The problem is that I don't know the voltage of the phase VL and of the neutral VN in regard to the ground GND, so I don't know how to choose the right resistors R1 and R2
and secondly the input of the op amp IN+ can't have less than (-V)-0.1V = -0.1V, so I think it will burn out if V1 or V2 goes under -0.1V.

Should I be worried about these problems and how can I find solutions for them, and is there any circuit with similar behaviour that I can use.

Thank you.

Best Answer

You may ignore current flowing from the mains to the ground (if it is not earth, at least), but you better think about currents flowing between line and neutral. As shown in the picture (I assumed all resistors are of the same value), when current flows in one direction you will always have one opamp with positive input below ground potential (v1 in this case) and during second half-cycle you will have other opamp input below ground.

enter image description here

One option to make this circuit work is to use dual supply op amp (however interfacing it to MCU might be tricky). If you want to use single supply opamp you may want to consider your V1 and V2 points as AC sources and add some DC bias (typically half of the op amps supply voltage) to them as described here. Remember: after you connect your sensing circuitry to the mains entire your circuit becomes unsafe, you should not touch it with your hands and burn your microcontroller firmware only with optically isolated programming tool.