lm339

Discussion in 'General Electronics Chat' started by Dritech, Apr 3, 2012.

  1. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi all,

    Is the LM339 output a digital output (schmitt trigger) ?? and is it good to compare small voltages such as 0.3V ?

    Thanks in advance
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Yes and Yes.
    The LM339 is open collector output.

    is not the right question.

    Comparators work by comparing one input with another.
    You can set a reference voltage to whatever voltage you wish as long as you satisfy the input operating range.
     
    Dritech likes this.
  3. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Thanks for the reply. Another question; is there a similar IC but with a single or double comparator which is not SMT?
     
  4. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    Yes. A LM393. It is a 8 pin dual.

    SMT packges are optional, refer to the data sheet. You can get a LM339 from Radio Shack as a 14 pin DIP.
     
    Dritech likes this.
  5. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi again,

    I bought the LM393 but its not outputting 5V when Vin exceeds Vref. I connected the circuit as shown in the attachment.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Many comparators, including the LM393 are open-collector, which means the output is uncommitted. Put a pull-up resistor from the output to +5V. Any value from 1K to 10K ohm should work.
     
  7. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi,

    What does open-collector mean? and is there a similar IC with a Schmitt Trigger?
     
  8. kingdano

    Member

    Apr 14, 2010
    377
    19
  9. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Ok, thanks for the link.
     
  10. crutschow

    Expert

    Mar 14, 2008
    13,052
    3,244
    "Open-collector" means the output consists of a single transistor (NPN here) with the collector open and the emitter to ground. Thus you need to add a resistor from the collector to V+ to see the output change state.

    It you look at the data sheet (heaven forbid) you will see this.:rolleyes:

    This output transistor turns off (output goes high) when the plus input voltage is greater than the minus input voltage.

    I don't know of any comparator ICs with a build-in Schmitt trigger but you can add hysteresis (which acts as a Schmitt trigger) to any comparator by adding a small amount of feedback from the output to the plus input using a pair of resistors.
     
    Dritech likes this.
  11. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Thanks. If i add a pull up resistor, it should work as a schmitt trigger, right?
     
  12. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    No. A Schmitt Trigger is a specific type of circuit.

    You can make a Schmitt Trigger with a comparator or op amp, or even a 555 (which does it totally different).

    A comparator only outputs a one or a zero, a op amp outputs a linear voltage.

    Positive feedback

    555 Schmitt Trigger
     
  13. crutschow

    Expert

    Mar 14, 2008
    13,052
    3,244
    No.

    Perhaps you are confusing a comparator function with a Schmitt Trigger function.

    A comparator changes output state from high and back to low at nearly the same input voltage (as determined by the open loop gain of the comparator amplifier).

    A Schmitt trigger is a type of comparator that has hysteresis, which means it changes to output state high at one level of input voltage and changes back to output state low at a different level of input (a lower voltage for positive voltages) to minimize oscillations from noise or stray feedback.

    Standard comparators do not have this hysteresis built-in and it must be added by a small amount of positive feedback from the output to the plus input, as I stated in my previous post.
     
  14. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
  15. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
  16. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Yeah, that's what I was thinking. I don't think those comparators are for beginners, so I hesitated to mention them, but anal, compulsive geek that I am, I did it anyhoo. So there.:p
     
  17. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    The key thing about Schmitt Triggers is their hysteresis. They switch at two different voltages.

    http://en.wikipedia.org/wiki/Schmitt_trigger

    The vast majority of comparitors (so there Ron!) compare the two input voltages, and have a one or a zero depending on which voltage is greater. A common nick name for a comparitor is a single bit A/D converter. They can also be used to make full scale A/D convertors.

    http://en.wikipedia.org/wiki/Comparitor

    An op amp and a comparitor are related, but a comparitor is designed to only output a digital value, whereas a op amp is a linear circuit.

    You can make a true Schmitt Trigger with either a op amp or a comparitor and two resistors, but since comparitors are truely digital they are much faster.

    Open collector is also a common digital technique in the I.C. world.

    http://en.wikipedia.org/wiki/Open_collector
     
Loading...