I have a circuit in which when output of comparator circuit is high (22V) led 1 should be off and led 2 should glow.
But problem is LED 1 is still glowing it is not switching OFF .I checked the voltage difference across R14 it is 22 V(Vcc=22V) on one (LED)side and 9V on other side due to which LED 1 is still glowing.
R16 current flow is causing LED1 to glow because Q1 operates in saturation with large base current. Moving R14 from collector to emitter side of Q1 should solve the problem. R16 can be omitted then.
I think the problem is more fundamental than that. The LM339 has an open collector output, it can sink the bias curent to turn LED2 off but when it's output is 'high' the two LEDs and transistor B-E junction are in series across the supply.
R16 current flow is causing LED1 to glow because Q1 operates in saturation with large base current. Moving R14 from collector to emitter side of Q1 should solve the problem. R16 can be omitted then.
If I connect a buzzer across LED2 and If transistor is ON buzzer operates and if it is OFF buzzer does not operate. But switching between ON & OFF state is not immediate there is gradual increase in sound level of buzzer. How can I make it it immediate .
If Vcc is less than 23V transistor is ON LEd2 & buzzer operates and if VCC is greater than 23V it is OFF buzzer does not operate and LEd1 is ON. But somewhere between around 23.100V both LED 1 and Led2 are ON and there is some sound in buzzer may be due to Hysteresis . This effect is happening when there is transistion from VCC>23V to VCC<23V somewhere around 23.1V.
when Voltage at Pin2 is greater than Pin 3 output Pin 1 is low and when voltage at pin 2 is less than pin 3 output Pin1 is high .