LM393A Comparator Issue

Discussion in 'The Projects Forum' started by dbirky, May 24, 2016.

  1. dbirky

    Thread Starter New Member

    Jan 21, 2011
    3
    0
    upload_2016-5-24_17-36-36.png
    No matter how I wire this I keep getting 0VDC at pin 1. I am needing it to be 5v. This drawing was how I wired it last time. I have pin 4 at ground and pin 8 at +5V. The sketch shows how I was testing it. What I really need is to have pin2 at 0v and have pin 3 connected to a speaker lead from a radio. When there is audio on the pin 3 I need pin 1 to be 5V. Also when I had pin 2 at GND I had a + speaker lead on pin 3. Then I played a tone on pin 3 and was hoping pin 1 would go to 5V. It remained at 0. Any help would be appreciated.
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,044
    3,244
    You made a common omission in using these comparators.
    The output of that comparator is an open collector transistor so you need to add a pull-up resistor from the output to the +5V (or other positive voltage), so the output can go to a plus voltage when the (+) input exceeds the (-) input voltage.
     
  3. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,834
    Just to add onto @crutschow 's post. I attached the schematic of the guts of the LM393 below. Look how the transistor is connected to the output pin. There is no connection to Vcc (positive power). Most comparitors require the user to add this resistor for their application.


    image.jpg
     
  4. dbirky

    Thread Starter New Member

    Jan 21, 2011
    3
    0
    Thanks for the response. Doesn't putting a resistor from Vout to Vcc put 5V to Vout whether or not the + input exceeds the - input?
     
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,834
    No, that is the whole point of a transistor. When no current is flowing through the transistor, both ends of the resistor are at the same voltage (Vcc). When the current flows into he base of the transistor, the Emitter-Collector path becomes conductive and current can flow. The voltage across the resistor becomes Vcc minus about 0.2V (the voltage drop of a staturated transistor (Vce)). So, the output is LOW when the transistor conducts and High when the transistor does not conduct current.
     
  6. dbirky

    Thread Starter New Member

    Jan 21, 2011
    3
    0
    Sorry for being thick. I've set the circuit up on a breadboard but get 5V on Vout anytime the pull-up resistor is connected. Here is the schematic:
    upload_2016-5-26_11-1-26.png

    would this be correct?

    Thanks again!
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,044
    3,244
    Due to the input offset voltage of the comparator you may need a few mV less than 0V to cause zero at the output ( or add a few plus mV to the (-) input .
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,151
    3,058
    Yes, comparator can be unpredictable right at the power rail. It's better to set a specific reference voltage - not at either of the power rails - to give the output switch at the Vin voltage you need.
     
Loading...