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.