8
\$\begingroup\$

I'm looking for the right circuit to connect my piezo buzzer to MCU (STM8S in my case). I don't have a partnumber\datasheet for my particular buzzer, but I've found a number of similar schematics in datasheets:

Some of them also have a protection diode (like described in this question) What's the function of the diode in this driver connected to a piezo buzzer?

My buzzer works when connecting directly to MCU pin (measured current is about 3mA).

So here comes questions:

  1. Do I really need a transistor if current through buzzer is so low?

  2. What is a good circuit to connect a non-piezo (magnetic) speaker to MCU? I've tried 8Ohm speaker with 500Ohm series resistor -- the sound is very low.

\$\endgroup\$
7
\$\begingroup\$

I would recommend to use a transistor, even when the required current is low. A piezo buzzer is highly capacitive, and microcontroller outputs usually can drive only small capacitances.

For the speaker you also want the transistor. The reason why your setup only produces very low sound volume is that the resistor and speaker form a voltage divider, so that the speaker only sees \$\dfrac{8}{8 + 500}=1.5\%\$ of the microcontroller's output voltage. You have to place a flyback diode over the speaker.

\$\endgroup\$
3
\$\begingroup\$

Piezo buzzers are capacitive. These don't show a typical 8R impedance as magnetic speakers. If you really want great sound try to drive the piezo with a semi-bridge configuration = 2 outputs from your MCU driving each pin of the piezo. To make it work, you have to send a square wave on both outputs but with a phase difference of 180º, that is: one negated to the other. With this trick you can double the applied voltage to the piezo, which is the most sensitive parameter on these devices along with the frequency of oscillation.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.