1
\$\begingroup\$

Please note: Even though this question involves a Raspberry Pi, I really think its an essential electronics question at its heart, and that the fact that I'm dealing with a Pi is secondary.


I have the following piezo buzzer wired up to my Raspberry Pi 1 Model A (hereafter RPi) as follows:

enter image description here

When my software (which uses wiringPi under the hood) sends an output signal to GPIO output pin, which is the pin driving the buzzer, it just makes a faint clicking noise, not a big booming buzzzzzz like I expected. I'm trying to figure out why.

My thoughts:

  • Perhaps its not as simple as just sending a HIGH signal to the buzzer...perhaps there's a more sophisticated signal I need to send it
  • Perhaps the buzzer is junk, however I ordered 3 of them from DigiKey and all three produce the same faint clicking sound
  • Perhaps something else isn't wired correctly

I have confirmed that my software is sending an output signal to the correct GPIO pin, namely because the buzzer does click when the software sets this pin HIGH.

Any idea how I can troubleshoot here and begin diagnosing?

\$\endgroup\$
  • 1
    \$\begingroup\$ What kind of buzzer it is? What kind of signal you are feeding it? Maybe it is accepting an alternating signal (square wave) rather than a single toggle? \$\endgroup\$ – Eugene Sh. Oct 3 '17 at 14:51
  • 1
    \$\begingroup\$ I bet the buzzer does not have a built in oscillator. You need to switch your GPIO on and off at the desired frequency in order to achieve the "buzz" you're looking for \$\endgroup\$ – DerStrom8 Oct 3 '17 at 14:53
  • 1
    \$\begingroup\$ BTW, this is a dangerous way of wiring it. you better drive it with a transistor or something. \$\endgroup\$ – Eugene Sh. Oct 3 '17 at 14:54
3
\$\begingroup\$

As I suspected the buzzer you linked to does not have a built-in oscillator. It must be externally driven with a square wave per the datasheet. You can do this by switching the GPIO pin on and off repeatedly at the frequency you want your buzzer to "buzz" at.

\$\endgroup\$
  • 1
    \$\begingroup\$ Which gives a better control of the sound produced, by the way... One can even play some tunes with it. \$\endgroup\$ – Eugene Sh. Oct 3 '17 at 14:57
  • \$\begingroup\$ Ahhh thanks @DerStrom8 (+1) so to confirm (because I am a man of very little brain!) you're saying that instead of just sending a 1-time HIGH signal to the buzzer's GPIO pin, I need to send a succession of HIGH/LOW signal pairs over and over (say, setting it HIGH->LOW->HIGH->LOW repeatedly for 1000ms, etc.) in order to get it to actually produce a buzzzzing sound? Thanks again! \$\endgroup\$ – smeeb Oct 3 '17 at 15:05
  • 1
    \$\begingroup\$ @smeeb Yes, that is correct. If you want your buzzer to buzz at, say, 400Hz with a 50% duty cycle for 1 second, you need to tell the GPIO to turn on for 1.25ms and then turn off for 1.25ms to get the required period for the 400Hz tone, and repeat this over and over again for 1 second \$\endgroup\$ – DerStrom8 Oct 3 '17 at 15:07
3
\$\begingroup\$

This is not really an "active" buzzer, it's simply a piezo transducer. It expects to be driven with an AC voltage. The datasheet suggests 3 volt peak-to-peak, at 2 kHz to get the maximum oomph.

The clicking is to be expected from your 3 v step.

\$\endgroup\$
-4
\$\begingroup\$

It could be a magnetic Buzzer which has a DCR much lower than the If rated when buzzing with open and closed duty cycle increase of DCR + inductance.

e.g. OPERATING VOLTAGE RANGE 2 ~ 4 Vdc RATED CURRENT (MAX) 30 mA

This does not include start up surge current which GPIO cannot provide to move coil contact to off position inside buzzer.

Measure DCR of buzzer and see why . This is a problem with magnetic low voltage buzzers . Just like DC mototrs have a DCR and a surge starting current until moving, your buzzer does not move and the GPIO voltage is too low.

Let's assume your GPIO RdsOn is 50 Ohms and Buzzer starting current is 5x rated current 150mA @3V then the DCR is 20 Ohms so the GPIO voltage is now reduced to 20/(20+50)*3V=0.9V which is below spec for the Buzzer.

Crude solution use a Bias R to help start it, better solution use a transistor.

\$\endgroup\$
  • 6
    \$\begingroup\$ You are probably having much experience and knowledge, but often I find your answers rather cryptic and overcomplicated. \$\endgroup\$ – Eugene Sh. Oct 3 '17 at 15:04
  • \$\begingroup\$ If you try to decrypt your confusion, and search for abbreviations, the answer becomes clear. \$\endgroup\$ – Sunnyskyguy EE75 Oct 3 '17 at 15:07
  • 3
    \$\begingroup\$ The buzzer model is linked in the question, no need to guess. \$\endgroup\$ – pipe Oct 3 '17 at 15:08
  • 1
    \$\begingroup\$ @TonyStewart.EEsince'75 I actually tried to search for DCR. There are dozens of unrelated terms. \$\endgroup\$ – Eugene Sh. Oct 3 '17 at 15:09
  • \$\begingroup\$ DC resistance . Do you nave a DMM? \$\endgroup\$ – Sunnyskyguy EE75 Oct 3 '17 at 15:12

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.