LM339 Comparator

Discussion in 'The Projects Forum' started by Macabra, Jul 15, 2008.

  1. Macabra

    Thread Starter Active Member

    May 31, 2008
    49
    0
    Hi,

    I have a question in regards to LM339. I know that the output is high whenever the voltage input is lower than the reference (+) voltage. Is there a way in which the opposite can be achieved using the same chip? My input reference would be 1V and if the input voltage through the other input is higher than that then the output would be high.

    Much thanks
     
  2. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    Just swap the inputs. It really is just that easy. :)
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Like Thingmaker3 says, it really is just that easy :)

    It can be confusing at times. Try it out in a simulator beforehand.

    If you're using a resistive divider to set the reference level, be sure to use a cap to ground, somewhere between 10nF and 0.1uF. Otherwise, the comparator will switch unpredictably due to noise.
     
  4. Macabra

    Thread Starter Active Member

    May 31, 2008
    49
    0
    oh my goodness. I tried that too but it didn't seem to be working and alas thank you very much SgtWookie for suggesting capacitors!! Much thanks! Yes, I was using resistor divider for voltage lol.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The reason for the noise is similar to water squirting from the nozzle of a hose.

    You can quiet the noise from the nozzle by dunking it in a bucket.

    That's about the same thing as a resistor limiting current, and a capacitor coupling the noise to ground.

    Those are very rough analogies, and perhaps other members will protest - but bypass caps to ground will silence the noise from the resistors. If you don't use the caps, you will have problems.
     
Loading...