Connect with us

Driving a piezo buzzer: resultant tone is noisy. Why?

Discussion in 'Audio' started by Kaelin, May 18, 2018.

Scroll to continue with content
  1. Kaelin


    Dec 13, 2017
    I'm trying to drive a piezo buzzer/transducer from a microcontroller. The buzzer is this one: At the moment, my driver circuit looks like this:

    Buzzer driver_schem.png

    It works, generally. However, I'm now trying to pick up the tone via a separate microphone. Looking at the waveform on the receiving end...


    It's not pretty. You can see that the overall 800Hz signal is there, but there's a bunch of additional higher-frequency oscillation too. For comparison, my phone generating an 800Hz sine wave looks like this, measured in the same way:


    It's much cleaner; there isn't any additional oscillation, although there's some obvious noise which I can filter out.

    I want to know why my buzzer isn't producing nearly as clean a tone.

    My primary theory is that I am not properly handling the significant capacitance and/or back-emf of the piezo element. It's also possible that it is simply a result of using a square wave via the MOSFET rather than a smooth sine wave... but that seems unlikely to me. It could also simply be a characteristic of the buzzer itself.

    Does anyone have ideas or suggestions?
  2. davenn

    davenn Moderator

    Sep 5, 2009
    Not to me, a square wave is full of harmonics. There is no way you can produce a clean tone from a square wave
    ( well, not without some seriously harsh filtering, but it would still be far from a smooth sine wave)

    and that is likely to be a cause as well .... don't recall having ever hearing a smooth sine tone from a piezo

  3. Kaelin


    Dec 13, 2017
    Interesting. I had come to the conclusion I did because the wave that was actually being produced seems like a superposition of exactly the wave I want and something else. Am I just thinking about this too idealistically -- would the sudden on/off switching be causing the extra oscillations, perhaps as a result of the way air travels within the body of this buzzer? The element itself is enclosed in plastic, which could definitely be acting as an echo chamber.

    I'll see if I can test it with a proper sine wave tomorrow.
  4. kellys_eye


    Jun 25, 2010
    Try varying the frequency - the transducer will have a natural resonant frequency that you might be missing.....
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Your microcontroller isn't using pwm to create something which averages out to a sine wave is it?
  6. Alec_t


    Jul 7, 2015
    In the linked buzzer device the piezo element is mounted in what is effectively an echo chamber, so that will have a natural resonant frequency (which looks to be about 5khz in the 'scope trace).

    Edit: As per the post below, 3.6kHz is a better estimate. Bob has better eyes than me :).
    Last edited: May 18, 2018
  7. BobK


    Jan 5, 2010
    The buzzer is rated for 3700 Hz and probably has a strong resonance at that frequency. Your square wave input at 800 Hz is ringing this resonance. Looking at your waveform, assuming the lower frequency is 800 Hz, it looks like about 4.5 cycles of ringing which comes to 3600 Hz.

  8. dave9


    Mar 5, 2017
    Why would you use a 3.7kHz, buzzer, and/or square wave drive if you want an 800Hz "clean tone"? Take a look at the datasheet.
  9. BobK


    Jan 5, 2010
    If you drive it with a sine wave, it will not ring like that, but the output will be about 1/8 as high as it would be at the design frequency of 3700 Hz.

  10. Kaelin


    Dec 13, 2017
    Thanks for the ideas and suggestions, this certainly is helping to point myself in the right direction.

    Yes, I'm aware that I am using this buzzer at a wildly different A) frequency and B) voltage than it's rated at. I chose this one because it's one of the few off-the-shelf buzzers which is rated for operation at any significant depth underwater and I'm particularly uninterested in dealing with pressure issues. The waveform it's producing still works; my FFT is picking up the 800Hz fine, even though there are also some other frequencies mixed in there.

  11. AnalogKid


    Jun 10, 2015
    A 1-opamp phase-shift oscillator circuit and a single-chip audio power amp will get you a nice, clean sinewave that will drive the piezo without kicking up harmonics. Distortion can be under 2-3%, and the frequency is tuneable over a narrow range with a single pot.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day