LM311 Circuit only works when probe is attached

comparatoroscilloscope

I'm trying to put together a circuit that takes a signal from a sensor, cuts out the negative side, compares it to a reference voltage and outputs a digital 1 when above the reference voltage. That signal will get read by a microcontroller that does some timing manipulation (stays high for 5 seconds after last pulse received) and output to a relay. My issue is with the comparator.

I can't figure out why my circuit only works when I have a probe attached. I am putting a 6v peak to peak sine wave on my input jumpers. I'm using a 2 channel oscilloscope, one channel attached between AC1 and AC2 and the other between ground and the output from the comparator (LM311). The circuit works as expected when I have the probe attached to the output from the comparator (the ground disconnected doesn't affect it). But as soon as I detach it the output goes and stays high.

I've tried different values of resistors for the pull up (5k, 10k, 20k). Other forums I've read about circuits only working when a probe is attached talk about the scope adding a little capacitance, so I tried adding a capacitor (0.1uf) between the output and ground which didn't do much. I also tried adding a resistor in series between the rectifier and comparator and still no change. Any help would be greatly appreciated!

Also my input signal is basically a +/- 12ac single cycle burst. Not mains power.

enter image description here

Best Answer

Your scope probe has a mega ohm leakage resistance that is allowing the opamp input bias current flow. It won't flow back into the bridge because the diodes will be reverse biased.

There's a couple of other problems too such as choice of diodes in the bridge and the potential to destroy the opamp if ac inputs are too high. For instance, you say: -

Also my input signal is basically a +/- 12ac single cycle burst.

That's a peak voltage of about 16V onto an input pin of a device that is powered at only 5V. Absolute maximum input voltage is +/- 15V. I expect it might be lower than this on a 5V supply.