Op-Amp Comparator Question LM339 - Page 1
Forum section: electronics / beginners

author: Falcon69
author_rank: Super Contributor
timestamp: September 19, 2014, 11:58:36 pm
content: I have a fairly simple question on my quest to understand basic electronics.From my understanding, all logic gates (and other components) you want the inputs tied to something, either ground or supply at any one time.I have a question about this...Does the output matter? Meaning, for example, if I had a SRFlipFlop for example, can I only connect Q and leave ~Q unconnected?The other question I have, pertains to the LM339, particularly in the design in the included picture. If the output of the LM339 comparator was connected to one of the logic gates input pins, and nothing else connected to that logic gate pin, if Q8 (look at the simplified component equivalent of the LM339 circuit) was to switch off, meaning that Q8 receives a logic "0" to turn off Q8, then technically, wouldn't that leave the logic gate the comparator is connected to floating? If that is the case, I would need to put in a pull down resistor, correct?Also, I want to ask, some of the Logic gates I've seen say 32mA output. I should be able to safely use an LED and resistor on those with no problems, correct? I just don't want to blow up any gates, if the output would be better served connected to a BJT or mosFET instead. But, would like to save board space if I can.

author: Falcon69
author_rank: Super Contributor
timestamp: September 20, 2014, 12:00:07 am
content: oops, so sorry, posted in wrong area.

author: dannyf
author_rank: Super Contributor
timestamp: September 20, 2014, 12:10:31 am
content: a pull-up is needed in this case.Not all comparators have OC output, however.

author: dannyf
author_rank: Super Contributor
timestamp: September 20, 2014, 12:11:54 am
content: there are circuits that require pull-down, or both pull-up and pull-down.There are others that require a load resistor to the ground/negative voltage - emitter output circuits for example.

author: David_AVD
author_rank: Super Contributor
timestamp: September 20, 2014, 12:15:06 am
content: No issue with leaving outputs not connected.You can use an LED with series resistor on the output of a logic gate.

author: Falcon69
author_rank: Super Contributor
timestamp: September 20, 2014, 01:33:55 am
content: DannyfIs this what you mean?(ignore the fact there is no power or ground connected directly to the OpAmp, or bypass caps, those will be there in the original design)This should keep the output of the gate "0" if the supply for the OpAmp or the supply from the + of the OpAmp are accidentally removed or cut. Am I correct in thinking this?With 5v input to the + of the OpAmp, the output should be close to 5v, thus setting the XOR Gate's output to 1With 0v input to the + of the OpAmp, the output should be close to -5v, thus setting the XOR Gate's output to 0I need to make sure there is no noise and the XOR gate will switch fully 1 or fully 0 on it's output, no matter the input to the OpAmp +Is the 100k resistor needed between the OpAmp's output and the XOR's Input? I guess it would be if the OpAmp were to lose it's supply voltage?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 20, 2014, 01:57:51 am
content: Unused sections of LM339 I believe are recommended to short all three pins to ground. But since the output is sinking only, it's not like it matters if you ground it or not.Tim

author: eetech00
author_rank: Regular Contributor
timestamp: September 20, 2014, 04:17:09 am
content: Quote from: Falcon69 on September 19, 2014, 11:58:36 pmAny UNUSED input should be connected to VCC or ground.QuoteYou can leave the unused output unconnected.QuoteSome devices have the output collector internally connected to the supply voltage. In those devices, the output is committed to providing an output voltage referenced to the devices' internal supply. The LM339 has an "Open Collector" output. This provides flexibility in that the output can be referenced to a different supply voltage than that of the device. However, if the output is connected to a logic input, it should have a pull-up resistor so that when the output is off (transistor is off), the output is "pulled up" to VCC (or whatever logic voltage level is required by the succeeding input). When the output is on (transistor is on), the output is switched to ground by the output transistor.eT

author: Zero999
author_rank: Super Contributor
timestamp: September 20, 2014, 12:24:07 pm
content: Yes, the output should be connected to +V via a pull-up resistor, in order to interface with logic.Another thing to note is that if you're using it to light an LED, as well as drive a logic input, you may need to connect a high value resistor in parallel with the LED, to ensure the output is fully high when the LED is turned off. If this isn't done, it's possible the output will read one LED voltage drop below the supply voltage, although, if it's CMOS logic, the input current may be low enough to make the voltage drop insignificant. It may also be necessary to add a pull-up with an LED on the output, if a feedback resistor is used to ensure the LED turns off fully and make the hysteresis more stable.