I've a zero-cross detect circuit of sorts, which detects at around the 300mV point. It was simulated in LTSpice. Once built it works 50% of the time on start-up and the other 50% of the time the output remains in a high state and sometimes 'self-corrects' after a minute. Here's the circuit (please note there is a 14k 3V pull up not shown on the output).
The comparator is diven by a 5V supply. AC is 1-200Hz of varying voltage. The first diode protects against any reverse flow as the bridge the ground flows through is not rated to the potential voltage of ac2. I chose a silicon instead of a zener mostly to get the crossover point <1v.
And the simulation across a increasing voltage/frequency spectrum.
When it works the scope shows:
Non inverted -
Inverted -
Output
When it's not working the inputs are the same but it's latched high.
Having a bit of an issue, I've blown two LM339's, in each case the comparator from the above circuit out of the four in the I.C. Anything spring to mind?
The AC input voltage of 110V peak is enough to zap any IC. Rectify and reduce the AC input voltage.
The datasheet of the LM339 says the absolute maximum negative input voltage is only -0.3V.
Try removing the rectifier and use two 1N4148 parallel diodes forward/reverse to limit the input voltage.
Add a resistor from there to the comparator input and another from input to +3.3V.
Make both of those and both the reference divider resistors the same value, eg. all 10K.
It should switch at around 0V on the diodes, but with the IC inputs always safely within the common mode range.
If the circuit was built on solderless breadboard then the high amount of stray capacitance will couple the high voltage past the diodes and all over the place.
No it's all smd work, tight prototype. It's working so far with the zener so it looks like it's a reverse spike. The question now is what else is quicker for protecting up to 80v because the other side of the bridge it goes through is rated to 30v and could be damaged by the reverse pull. I wasn't expecting an issue given the AC is so low Hz.
iirc it's a 1N4148 (the one rated to 80v) not a 1N4001.
The output voltage of a bridge can be increased by an additional forward source applied to the output, but the diodes conduct and limit the voltage if the output is reverse biassed.