LM339 problem

Discussion in 'The Projects Forum' started by Ron R, Jun 21, 2010.

  1. Ron R

    Thread Starter New Member

    Nov 21, 2009
    I wonder if anyone has seen this problem before, or can figure out what I am doing wrong: I am using an LM339 quad comparator to find zero crossings of signals from current transformers, at 60 Hz (circuit attached). I am using all four comparators in the chip, with each comparator using the same LM358 circuit schematic. The LM358 amplifying circuit works fine and using any one comparator of the LM339 produces a clean square wave output. The Problem: It seems that the two comparators on the low-number-pins (1 to 7) interract with each other and the two comparators on the high-number-pins (8 to 14) interract with each other.
    For example, if I put a CT input to AC1 and a CT input 180 degrees out of phase into AC3, the LM339 output for AC1 is zero, or a very narrow pulse. Those same two inputs applied into AC1 and AC2 (or AC1 and AC4) look just fine on the LM339's outputs. If the two inputs are in phase, the output is "normal" with maybe some distortion.
    If I connect the output of AC3's LM358 into a different LM339 chip, its output looks clean and normal.
    The circuit doesn't show that I've put .01uf to 10uf caps across the LM339's power and ground pins, with no effect.
    What can be done to prevent this interraction between the comparators on the same chip?
    Thanks for any comments.
    • zc1.PNG
      File size:
      20 KB
  2. SgtWookie


    Jul 17, 2007
    You would likely avoid those crosstalk problems if you went to a dual-rail supply, or biased the threshold at Vcc/2.

    The 0.01uF caps you have on the outputs aren't helping your cause any. When the output of one comparator toggles, you're putting spikes on the negative rail, causing more cross-talk than would otherwise occur.
  3. eblc1388

    Senior Member

    Nov 28, 2008
    Are you feeding input voltage lower than -0.3V into the comparator?

    This is what the manufacturer said in the LM339 datasheet:

  4. Ron R

    Thread Starter New Member

    Nov 21, 2009
    Thanks for the advice. I put a 1N4148 (I have lots of them) at the + input to the LM339: the ringing in the output at the low level is gone now, but the output still is always low if a signal that is 180 out of phase is applied to the other LM339 input "on the same side of the chip" (the original problem). Strange.
  5. retched

    AAC Fanatic!

    Dec 5, 2009
    Are you using a dual supply?
  6. Ron H

    AAC Fanatic!

    Apr 14, 2005
    When you forward bias the input diodes (by applying overvoltage), strange things can happen. A 1n4148 will not clamp the input to -0.3V.
    I would probably try something like this. The 2N3906 is a saturating emitter follower. It gives great logic levels. You can make the output pullup resistor smaller if you need to.
    You might need to add a little hysteresis to the comparator to prevent multiple pulses during zero crossing.
    You may not need so much gain. What is the range of input signal amplitude?

    Also - this is probably not optimum. It was what I first thought of to eliminate the overvoltage condition on your comparators.
  7. Ron R

    Thread Starter New Member

    Nov 21, 2009
    Thanks for the advice. I actually tried the LM393 - which has only two comparators per package. This seems to be the solution, as both comparators seem to operate with no interraction between them - nice clean pulses that don't care what the other comparator is doing. I certainly can't explain it, but I don't think I care as long as I get something working without problems.
    Thanks again for the suggestions.
  8. retched

    AAC Fanatic!

    Dec 5, 2009
    Thats correct, they are stand alone inside one package. You can use them separately.

    You just have to be sure the two in operation dont exceed the PACKAGE tolerances.

    There will be specs for each individual component in the IC then there will also be complete package limits and such.