0
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ I think that your comp should have some hysterisis added and a resister in series with pin 2 would be prudent .Because you are running at mains power frequency you dont need speed.Hence a LM393 would be fine .The 311 is fast and more PCB layout problematical so why use it when you dont need to . \$\endgroup\$ – Autistic Dec 30 '15 at 20:15
  • 1
    \$\begingroup\$ I read your question 3 times and still don't fully understand it. BUT, you may have a ground problem. The GND on the oscilloscope input is connected to EARTH ground inside the oscilloscope. This also means that all oscilloscope probe grounds are connected to each other. This means that you cannot connect different scope probe grounds to different nets on the circuit. Also, depending on the nature of your circuit and test equipment, other nodes may be grounded by other test and measurement equipment. (for example your AC source). \$\endgroup\$ – mkeith Dec 30 '15 at 20:21
  • \$\begingroup\$ Are you by any chance triggering your scope from channel 1? \$\endgroup\$ – WhatRoughBeast Dec 30 '15 at 21:14
5
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.