COMPARATOR OUTPUT

Discussion in 'General Electronics Chat' started by dougalere, Aug 20, 2015.

  1. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    HI
    i would like to have two leds indicating the on /off states of a comparator. eg red for on, green for off.
    can it be done, without adding an additional output (transistor) stage?
    thank you
    dougal
     
    Last edited: Aug 20, 2015
  2. crutschow

    Expert

    Mar 14, 2008
    13,009
    3,233
    Rather than try to pull the information from you as to what you are trying to do, I will just answer your question.

    Certainly.
     
    AnalogKid likes this.
  3. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    hi
    my question would seem to be pretty much self-explanatory,cant think of what i could add.

    if i have caused offence, i apologise.

    dougal
     
    Last edited: Aug 20, 2015
  4. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Like crutschow already tried to tell you, good questions bring good answers, and his answer is quite precise for the amount of information that is present in your question.
    Unless you are willing to show the circuit where you want to implement this there is nothing more that can be added.
     
  5. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    You asked if it can be done. crutschow said it can. He answered the only question you asked.
     
  6. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,535
    1,251
    Your question has the words comparator and LED in it. If you combine all possible combinations of available LEDs and comparators, you have well over one million different circuits. That is what is self-evident to us. How do you propose that we narrow down that range of possible circuits to some that meet your actual requirements?

    ak
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,009
    3,233
    You caused no offense.
    It's just that we get so many vague or incomplete questions on these forums where we have to pull the information from the op, piece by piece, to try to determine exactly what he is actually trying to do.

    You didn't state what the purpose of this comparator is, or any of its requirements (speed, voltage, accuracy, etc.) or ask how to design one, so I answered the question you asked.
    If that answer is sufficient for your purposes, then we are all happy. ;)
     
  8. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    hi
    apologies to all,
    members who might have viewed my previous threads will know that i ramble on a bit,
    so on this occassion i thought i would try and be a little more brief and to the point,
    looks like i may have overdid it,
    a fresh start is needed perhaps,
    i have a completed comparator (TS393) stage which has a level detector input comprised of a voltage divider and signal input,
    the output is an LED/resistor sourced from the 9v supplyand sinking through the comparators internal transistor,indicating high input,
    it is working fine,however i would like to add a second LED to indicate low,
    this would be quite easy with an op amp, but i dont really want to abandon the comparator.
    and as i would have to modify my existing circuit the simpler the better.

    as its some time since i built this circuit, i forgot this was a dual comparator and the second half is spare, so that perhaps could be used for the second led
    regards
    dougal
     
    Last edited: Aug 20, 2015
  9. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Could you please post a schematic of what you've got?
     
  10. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    HI
    i tend to go straight from the back of an envelope to board layout.
    this means i dont always have a printable schematic, however spotted this which is pretty close.
     
  11. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    'as its some time since i built this circuit, i forgot this was a dual comparator and the second half is spare, so that perhaps could be used for the second led'

    so i guess i could just extend the inputs to the second half of the comparator reversing the inv/ non inv connections?
     
  12. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    Most comparators have an open collector output, so you'll need external circuitry for pull up as well as pull down.

    If the application isn't high performance - you can often get away with using an op-amp as a comparator. Most op-amps have something resembling a totem pole output.
     
  13. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I have done just that, back when I was using a 393 for a line-following robot. Something very similar to this, except the outputs were connected to PNP transistors, which drove the motors as well as the LEDs.

    upload_2015-8-20_17-2-16.png
     
    absf likes this.
  14. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,535
    1,251
    Or, starting with the circuit in post #10, connect the cathode of LED2 to the cathode of LED1. Connect the anode of LED2 to GND through a small signal diode like a 1N914 or 1N4148. When the comparator output is low, LED1 will light. By itself it has a lower Vf than the LED2-plus-diode combination, so LED2 will be off. When the comparator output is off, LED2 will light. Net change to the original circuit plus the 2nd LED: 1 signal diode.

    ak
     
  15. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    AK beat me to it. But a picture is worth a thousand words and I didn't give it enough thought to avoid the additional resistor.
    led2.jpg
     
    absf and DerStrom8 like this.
  16. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,535
    1,251
    Not quite what I described, but it will work also. In the dl schematic, when the comparator output is low it is sinking two LED's worth of current, although one LED is shunted by the lower Vf diode. In the ak thousand words, only one LED's worth of current is steered between the two LEDs.

    ak
     
  17. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    I had to draw this out because it didn't make sense. Anode and cathode above are swapped.

    YMMV with this circuit. There are some LED currents and color combinations that won't work because the LEDs and diodes will conduct a small amount of current in the proposed configuration. I breadboarded the circuit (and the one I proposed) to prove it to myself and the zero output state would light the one state LED dimly.

    I used a 5V supply and 330 ohm resistors, so the LED was operating at about 9mA. I used the same LED color for both indicators.
    led2a.jpg
     
  18. eetech00

    Active Member

    Jun 8, 2013
    650
    112
    The op has a spare 393 in the package. Why not use it?
     
  19. dougalere

    Thread Starter Member

    Mar 4, 2015
    128
    5
    thanks guys
    thats what i was looking for in my original post,as this is part of a prototype project
    it could simplify things a little to use a mono comparator.in the final.
    however i will be complicating things a little, i will be adding a small piezo buzzer to the red led stage, and using a changeover switch on the inv/noninv inputs.
    i will knock up a test board to see which works the best, mono or dual,
    particularly whether the leds are lit roughly equally etc.
    thanks again
    dougal
     
  20. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    The original post asked:
    Then it was modified to consider using the spare comparator.
    Solutions for both have been provided.
     
Loading...