I'm making a simple dark sensor project with a light dependent resistor (LDR) and I want to replace the LED with a buzzer but it doesn't work

I replaced the resistors with small ones to give the buzzer more current,but itstill doesn't work. I checked my buzzer and it's working fine. The circuit works perfecly with the LED in the breadboard and the simulation program.

I'm using a TMB12A05 buzzer.

• How much current does the buzzer require compared to the LED? Jan 5 at 17:33
• what kind of buzzer is it? Does it have the tone generator builtin, or needs to be fed with some AC? Jan 5 at 17:42
• i'm using Small Buzzer 5V (TMB12A05) Jan 5 at 17:59
• @Ahmed, that information along with a link to the datasheet (not an Ali-what's-it or Amazon ad) belongs in the question, not buried in the comments. Hit the edit link ... Jan 5 at 18:04
• @Ahmed. He sounds wise. Listen to him. Jan 5 at 18:19

First, delete R2. The buzzer has inherent current limiting, so an external resistor does nothing but reduce the volume.

Second, I think the value of R1 is so high that it is "starving" the transistor. If you decrease the value of R1 it will help, but might not be enough. The problem is that for the BC547, R1 does not allow enough base current so the transistor can sink 30 mA.

But there is another issue. When you decrease R1 it changes the amount of light (or darkness) that activates the buzzer. If 50 K is the right value for your light levels, then you need to change the transistor to either a darlington type or a MOSFET.

• The TMB12A05 requires about 30 mA at 5 V.
• You appear to be running from an 8 V supply so your resistor needs to drop about 3 V at 30 mA. $$\ R = \frac V I = \frac 3 {30m} = 100 \ \Omega \$$.
• To turn the transistor on fully aim for a base current of about 2 or 3 mA. That means the base resistor should be $$\ R = \frac V I = \frac 8 {2m} = 4 \ \text {k}\Omega \$$.
• The voltage at the collector of Q1 should drop to about 0.2 V or so when on.
• Because the OP is happy with the circuit's darkness transition with a 50 K pullup and the LED, there is almost no way the LDR resistance will go low enough to turn off the transistor with a 4 K pullup. And it certainly will not turn off at the same illuminance as with the LED circuit. Jan 5 at 20:58
• I tried that and it didn't work I even lower the base resistor to 82 ohms and remove R2 and still nothing which is weird so it must be that bc 547. I think a Darlington pair will do the job, it worked in the simulation. Jan 6 at 1:13

From the data sheet, the buzzer will work at a minimum of about 4 volts. If the transistor works as a perfect switch, 8 volts will appear over the series combination of buzzer and R2. If 4 volts is the buzzer voltage, the voltage over R2 is also 4 volts, and for a 500 ohm resistor, that implies a current of 8 mA.

In order to get this much current through the load, the base current should be about 1/10 this, or 0.8 ma. However, the voltage across R1 will be (about) 7 volts, and 7 volts divided by 50k is 0.14 mA, which is too small by a factor of about 6.

To compensate, reduce R1 to about 5k. At the same time, reduce R2 to something like 100 ohms or less. For that matter, you can reduce R2 to about 30 - 50 ohms and get maximum loudness from the buzzer. If you do this, you'll need to supply about 30 mA to the buzzer, which will imply a value of R1 of about 230 ohms. There is a little bit of uncertainty here, since if R2 is zero you run the risk of putting more than the rated 7 volts on the buzzer. Frankly, I doubt a little more than 7 volts on the buzzer will damage it - but there are no guarantees when you exceed the manufacturer's maximum specifications.

When you do this, I'm afraid you'll find that the turn-on light level will change as well, and the buzzer will sound when it's not all that dark. It will depend on exactly what LDR you use.