# Comparator output problem for zero cross detection

.

Could anyone give me advice on this zero cross detection circuit I'm working on to allow for phase angle detection?

Just to add I'm only a student so I'm very much still learning. My background is electrical by nature, electronics is relatively new.

I've built the circuit and have included pictures of the output waveforms, yellow is voltage, current is blue. The AC ground 0 V and DC ground 0 V are separated in the physical build, that's why the ground references are different in the schematic.

When the circuit is connected as per the circuit diagram, the output square waves are as the output 1 picture. The voltage wave form is as expected but the current waveform is constant regardless of the current transformer output. It always has that pulse near the falling edge of the voltage waveform regardless of the load sensed through the current transformer/sensor.

When I invert the current transformer inputs to the comparator, the waveform is as the output 2 picture. It seems to work right, but I think that I might have just inverted the waveform by 180° by putting the larger input into the inverting pin of the comparator.

The only difference in the circuit diagram and the physical circuit is the current transformer in the physical circuit isn't grounded to a specific 0 V like it shows in the circuit diagram. I'm not sure what to do with that, if it should be connected to the same 0 V as the voltage transformer or not.

• Have you ever studied what the input current waveform is for a load connected via a bridge rectifier and smoothing capacitor? Nov 2, 2022 at 12:19
• You're powering the comparators from GREF2, but their negative inputs are ground. There is an AC voltage difference between these two. If you've already accounted for this, mentioning it and adding a 'scope showing ground minus GREF2 could be helpful for future readers. Nov 2, 2022 at 12:30
• AC ground is outside of your comparators' input common-mode voltage range. U7A is going to get killed if you ever physically build that circuit. Nov 2, 2022 at 18:42
• Ant.F; You may also want to review this EESE answer as it may be useful to consider it.
– jonk
Nov 2, 2022 at 19:33
• Sorry the late reply. I have checked the input waveform andy, the sine wave is as it was before the rectifier was added. Im aware of the common mode input range johnathon, the max the 393 can handle is -300mV and the input is max -140mV. I know the datasheet says 0V for normal conditions but this is what i had to work with, the voltage waveform is working normally. I will review that jomk, thanks. Thanks everyone for the replies Nov 2, 2022 at 21:54