# Why do I need transistor in the following mains power failure circuit?

In this main's power failure alarm circuit, when main power is connected the diode is reverse biased and so the buzzer is off. But when main power is not connected, the diode is forward biased and so the buzzer gives the alarm. So the switching in this circuit is being done by the diode, so what is the transistor doing in the circuit? If the transistor is being used as a switch, then why it is needed as the diode is already doing the switching?

• The diode is the switch. But look at the resistors in that circuit : when on, there is less than 2V across R1, so it is switching less than 2mA. That'll work, after a fashion, but using that small current as base current for the transistor allows it to switch a large current, making the alarm much louder.
– user16324
Commented Apr 15, 2017 at 14:54
• @BrianDrummond: You should post that as an answer. Commented Jul 21, 2017 at 13:59
• BEWARE: though it works, this circuit has a serious flaw. There's nothing limiting current thru D1 and T1 BE junction. Your V13 battery will actually power whatever connected to VF1-VF2 if it's own power should be missing. Current can easily be high enough to zap either T1 and/or D1. But, even worst, if you just happen to short the same VF1-VF2, again, blue smoke right away. Easy to fix though, just wire a few kiloohm resistor in series with D1. Commented Jul 21, 2017 at 19:22

Yes, the diode does work as a switch. But without the transistor, only a very small current can flow through the buzzer.

simulate this circuit – Schematic created using CircuitLab

When the mains power is on, D2 is reverse biased. But when the mains go out, D2 becomes forward biased. The buzzer is then connected to a 8.3 V voltage source with 1 kOhm resistance, that resistance will limit the current and it could drop too much voltage for the buzzer to function.

You could simply reduce the value of R1, but the power dissipation will be high: a 130 Ohm 1W resistor is the lowest you could use.

So lets use something to amplify a small current through the dummy load into a big current through the buzzer:

It looks like a 3V battery?

When the main goes out D1 becomes forward biased and the voltage across R1 becomes Vbat - Vbe - Vd1 = 1.7 volts. Only 1.7 mA flows through R1 and gets split between R2 and the base emitter junction of T1. R2 conducts 0.7V/2.2kOhm = 0.3mA of the current, leaving the remaining 1.4 mA to the transistor.

A typical general purpose transistor has a current amplification of at least 100 meaning that it can supply at least up to 140 mA of current to the buzzer. And the voltage won't drop too low if the transistor is saturated.

Load current. The 12 volts across 1Kohm..............12mA.

That 12mA may not provide a LOUD warning tone, so the transistor is used to switch a backup battery across the piezo horn.

Key here is the "backup battery", used to ensure a warning sounds, when the mains power is off.

• The backup battery does not necessarily supply 39 V. The 12 mA through the resistor is only true when mains power is on. The current would probably be a lot less. Commented Jul 21, 2017 at 14:01

It is because of the current which causes loudness in sound. If omit the transistor circuit and connect the buzzer with that V1 battery backup buzzer may not sound kind or it doesn't sound totally. It is because, there is a resistor 1.1k in series with the buzzer which ultimately limits the current that output cannot be sufficient to buzzer.

You can simply test this with led and pot in series with the battery. Whenever current limit changes, there will be changes in led brightness. Same thing will happen here if you omit the transistor and connect buzzer in series. By connecting transistor, it outputs sufficient current to the buzzer to be loud enough when main is disconnected because there is no current limiting factor like resistor.

As you said, you have done this with 9V battery. If you try that with V1 battery backup, you might see the difference.

• Your answer is a bit confused. (1) Connecting the buzzer to V1 will cause it to sound at full power. (2) The transistor is there to invert the logic. The circuit is designed to buzz when power is lost. (3) R1 is not in series with the buzzer - it is there to bias the transistor on. It does not limit the current to the buzzer but rather maximises it by turning the transistor hard on. Commented Jul 21, 2017 at 7:48
• No. I just tell the difference. User who asked this question, did comment for the first answer that, he/she constructed a circuit of this buzzer only with diode and it works well. So that he asked why we need transistor there? So, I put an answer relevant to that comment. Also in my answer I noted that, just removing transistor and resistor R2 and connecting a buzzer in between battery and didoe 1n4148 will not turn on buzzer due to resistor R1 which is current limiting factor. My answer is based on that. Also thanks for the correction. I don't know why my answer gets down vote.
– CNA
Commented Jul 21, 2017 at 9:52

The transistor, when saturated, drops 0.2-0.3V. The diode conducting drops 0.6-0.7V. Since the battery for the buzzer has very low voltage, that 0.5V difference between the diode and the transitor make a difference.

• I constructed the circuit using just a diode and it works and gives an alarm sound when main power is disconnected and the buzzer remains off when main power is connected (I have used two 9V battery as main power and backup power). And also constructed the circuit as the picture using the transistor and two 9V batteries and the circuit worked. So what is the benefit of the transistor as the circuit is working fine without it? Commented Apr 15, 2017 at 14:29
• @Fahim Ahmed, Perhaps transistor prevents full battery discharge. Commented Apr 15, 2017 at 16:09
• @FahimAhmed your circuit says the backup battery is 1.3V. With high voltage batteries the difference is negligible, but it seems a bit silly to put huge batteries only to say that the main battery is dead. The circuit with the transistor works even with coin batteries, with the diode, it is doubtful it will. Commented Apr 15, 2017 at 16:38