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

    Kaelin

    5
    0
    Dec 13, 2017
    I'm trying to drive a piezo buzzer/transducer from a microcontroller. The buzzer is this one: https://www.digikey.com/product-detail/en/cui-inc/CPT-2521C-500/102-3756-ND/6012427. 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...

    upload_2018-5-17_20-58-18.png

    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:

    upload_2018-5-17_21-0-2.png

    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

    13,598
    1,875
    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


    Dave
     
  3. Kaelin

    Kaelin

    5
    0
    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

    kellys_eye

    4,276
    1,146
    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

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

    Alec_t

    2,844
    760
    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

    BobK

    7,682
    1,686
    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.

    Bob
     
  8. dave9

    dave9

    907
    230
    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

    BobK

    7,682
    1,686
    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.

    Bob
     
  10. Kaelin

    Kaelin

    5
    0
    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.

    Thanks!
     
  11. AnalogKid

    AnalogKid

    2,371
    661
    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.

    ak
     
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

-