# output of comparator

I am using LM139 comparator There are two stages of the circuit:

• First stage is amplifier stage
• Second is comparator stage

I apply input signal of 1.098Vac to noniniverting input of LM139 comparator. Reference voltage for comapartor is 0.5Vac.

Now as 1.098 v is higher than 0.5volt(ac), output of comparator should go high and vice versa.

If input is 0.2volt AC, output should go low driving led, but it is not working.

LED is off in both case.

Is this circuit right?

• You need to (MUST!) tell us what you are trying to do overall - NOT how you think you are going to solve the problem. Until you tell us what the actual problem/task is you will not get the best possible answers. Jun 9, 2019 at 10:31

The LM139 has an "open collector" output stage.
It can pull its output low but cannot pull it high.
As a consequence it cannot drive Q1 base high.
Place a (say) 10k resistor from Q1 base to V+

The LM741 is NOT a single supply opamp. It is not clear where you intend ground to be relaative to Vbat+ and Vbat-. IF the battery was centre tapped (+/- 6V) the opamp would work but not be well suited to the task.
If V12- is connected to ground the opamp will not work.
The LM741 is very very old and there is very little reason to use one nowadays.
instead consider using the only veru old LM324 quad or LM358 dual single supply opamp. (They are effectively a single supply '741 with internal compensation).
Or use some even better modern opamp.

If LED1 is a white LED then it's current will be about
I_LED1 ~= (Vbat-V_LED)/R5
= (9-3)/50 = 120 mA.
Did you intend to have that order of LED current?

If you use an LM324 or LM358 you can use one section in place of the LM139. In many cases it will be just as good and makes the whole design easier and "nicer".

• @Russelll McMahon,Sir thankyou very much for your valuable feedback and guidance.If i use LM324 or LM358 then i need one stage or two stages?As my input signal is weak (0.1V ac rms) or like that.So i need to first amplify and then compare it with refernce signal(0.5V ac)?,Place a (say) 10k resistor from Q1 base to V+?then in this case led is always ON irrespective of output of comparator? As i want to turn on LED based on comparing ac signla with other signal refernce(0.5V ac rms)? Jun 9, 2019 at 9:39
• Try a LM392 - half a LM358 and half a LM393 in one package. Jun 9, 2019 at 9:54
• @Muhammad re " ... ?,Place a (say) 10k resistor from Q1 base to V+?then in this case led is always ON irrespective of output of comparator? ..." -> No. The pullup resistor (here 10k) is the ONLY way to cause an open collector output to go high. When the comparator turns on (low output) it will pull down the transistor base and turn the transistor off. Jun 9, 2019 at 10:24
• @Muhammad An LM324 would act as a comparator with a single stage but adding the amplifier makes some aspects easier. HOWEVER - comparing AC with AC is going to "cause problems". Presumably the 50 Hz is from the same source in each case so they are in phase. As they are ground referenced they will go above and below ground BUT if the opamp and comparator have their negative supply (Vss or gnd) connected to ground then they will only deal with the positive half cycle. As you have not told us what you are actually trying to do or why we cannot tell if what you are doing is wise BUT it ... Jun 9, 2019 at 10:29
• @Muhammad ... it is more usual to rectify the signals to DC and do comparisons with DC. | You need to tell us what you are trying to do overall - NOT how you think you are going to solve the problem. Until you tell us what the actual problem/task is you will not get the best possible answers. Jun 9, 2019 at 10:31