This circuit is supposed to turn ON the buzzer when light is detected by the sensor (Light Dependent Resistor or LDR). The designer assumed that when light is applied to the LDR sensor, the LDR resistance falls, thus increasing the transistor input current and turning ON the buzzer.
There is nothing wrong with that reasoning. This is how the circuit is supposed to work. However, there are a number of issues.
First of all, the Rldr resistor should not be so low. This resistor is used to make sure that the transistor is OFF when LDR resistance is infinite (this occurs in the dark). The Rldr value should be from 10 kohms to 100 kohms.
Let us assume that the voltage of the light-dependent resistor (LDR) is almost zero when light is applied to the sensor. We now ask ourselves. What should be the minimum current gain for the transistor to saturate? First, we determine the approximate Ib (base current) value:
Ib = (Vs - Vbe) / Rb
(this is an approximation, assuming that the voltage across LDR is zero and the voltage across the Rldr resistor is 9 V)
Ib = (9 V - 0.7 V) / 10,000 ohms
= 8.3 V / 10,000 ohms
= 0.830 mA = 830 uA
Then we calculate the collector current (Ic) during saturation:
Ic = (Vs - Vsat) / Buzzer
= (9 V - 0.2 V) / 100 ohms
= 88 mA
Now we can find the minimum current gain (Beta) for transistor saturation:
Beta = Ic / Ib
= 88 mA / 0.830 mA
= 106.024
The average current gain of a typical transistor is 100. This circuit is bad because it works on the edge. There is no margin. Also, transistor gain can change with temperature and fall to a minimum value of 20. Then this circuit will not work.
One solution to this problem is reducing the Rb value to 1,000 ohms and thus increasing the base current. This will work if the buzzer resistance is more than:
Rbuzzer > (Vs - Vsat) / Ic
Rbuzzer > (Vs - Vsat) / (Ib * Beta)
Rbuzzer > (Vs - Vsat) / (((Vs - Vbe) / Rb) * BetaMin)
Rbuzzer > (9 V - 0.2 V) / (((9 V - 0.7 V) / 1000 V) * 20) = 53.12 ohms
The resistance of the buzzer would depend on the type of buzzer that you are using. Because the buzzer is a coil (ideal coil has zero resistance) that is not ON all the time we are dealing with average resistance or reactance/impedance. However, this theory is beyond the scope of this article.
However, there is also another problem. The minimum resistance of an expensive LDR (light-dependent resistor) is usually no less than approximately 1,500 ohms inside a room. Cheaper LDRs that are less sensitive have greater minimum resistance values that could be 3,000 ohms. Then the LDR voltage will not be almost zero when light is applied, the Rldr resistor voltage will not increase to about 9 V and the circuit will not work.
You might now say: "Why not replace Rb with a short circuit?". This is because if you take the circuit outside in bright sunlight at temperatures of 40 degrees or above the LDR resistance might actually fall to 500 ohms, thus burning the transistor.
The third and final issue with the circuit is the lack of a diode across the buzzer. If a high high-current buzzer is used, it might discharge high currents after the light is turned OFF and the transistor input current falls to almost zero. This is because the buzzer is a switching coil. This is why this circuit is not just bad but a wrong circuit. This circuit will not only not work but could fail very quickly.
This is the possible solution to the problem:
The diode across the buzzer is known as the snubber circuit. A snubber circuit is also used for relays and motors that are also made from coils. I added an additional transistor to ensure transistor saturation. I also included an additional transistor in parallel with Q1a because 2N2222 is a general-purpose transistor that might fail when driving high-current buzzers. You can also use a power transistor with a heat sink. However, this will cost more money.