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:
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?
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?