-1

I am having a ridiculously hard time trying to make a passive buzzer work correctly on my Seeeduino XIAO.

Here is the buzzer module : enter image description here

Here is how I believe it works, assuming the SOT23 smd is a PNP transistor? : enter image description here

I plugged VCC to a +5V rail, GND to the ground rail, and I/O pin to my Seeeduino XIAO's pin 2 (aka "A2 / D2" : enter image description here

When I write DigitalWrite(2, LOW), I can mesure about 0.4V on pin 2, while DigitalWrite(2, HIGH) reads about 3.3V (I assume the 5V rail feeding my Seeeduino XIAO's VCC gets converted to 3v3 through an internal regulator)

I understand I have to oscillate the signal to make this module buzz (remember it is a passive buzzer, or a transducer, whatever it is called), or simply use the tone() method, and I eventually managed to make this beep on and off every 1 second successfully during 10 seconds, but what bothers me is that I can NOT turn this module OFF after 10 seconds as a test in my sketch. It stops beeping after 10 sec as expected (ìf (millis() < 10000) { doBeep(); } , but it still draws massive current and gets hot after that delay. It's like the PNP transistor never turns off? I tried both digitalWrite HIGH and LOW but no success.

This is driving me crazy. What am I doing wrong?

1 Answer 1

0

You're right that it's a PNP transistor - the SS8550 to be precise.

And therein lies the problem.

When running at 5V to "make no current flow" through the base the voltage at the base has to be higher than 4.4V (5v - 0.6v), and since you're controlling it from a 3.3V microcontroller that can never happen. So you are right in thinking it never turns off - it never does.

Even when you're "beeping" it it's not turning fully off, so the beep sounds you make will be reduced accordingly.

You should power the board from 3.3V instead of 5V so the PNP can turn off fully. If that is not possible then switching the GPIO pin to INPUT mode will prevent it from driving the PNP thus allowing it to turn itself off.

1
  • Thank you for the explanation. Adding an AMS1117 3.3v did solve the issue. The buzzer was shy indeed. Knowing all this, I will probably prefer a logic level converter.
    – Musa
    Jun 17, 2022 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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