I'm making an active rectifier, to make it work I need precise information about actual phase of main voltage.
What I need:
1) exact moment when the positive section of sine wave starts and ends. Basically ac sine -> binary.
2) solution should provide galvanic separation
My ideas so far:
1) small transformer, diode and comparator/logic gate,
If there's a diode on lower trafo side I'm losing precision, as there is drop voltage on it, so I will need to compensate it one way or another. Comparator/logic gate's purpose is to convert half-sine wave into binary.
2) diode/transoptor on upper side of trafo
Higher precision, as diode is on higher side of transformer, but not sure if it will be enough.
3) transformer to step down voltage to let's say 2.5/-2.5V, add 2,5V DC to make it 0-5V and do the math magic in uC
Not sure about it, if anything goes wrong I'd applying negative voltage to uC. Not feeling good about it. But still it sounds as the most precise solution.
What's your method? Do you know any chips that'd do the job?