I am looking to drive a piezo transducer at its resonant frequency (20kHz) to generate sound waves. I am doing an application similar to sonar technology.

I was looking into how to drive the transducer and I thought I would have to generate and feed it sine waves with its resonant frequency. I have access to an Arduino DUE, I was looking into how to do so and it seemed a bit complicated.

I was curious if anyone had any experience driving a piezo and if it would be possible to do so with just square waves. Or if they have experience generating sine waves of any frequency within an Arduino please let me know!


1 Answer 1


I'm not sure what the specs. of your piezo is, but you need a really high voltage to drive them. You will probably not be able to drive them with the outputs of a regular MCUs. If you have a DAC inside Arduino, connect it to a high Voltage audio amp specific for piezo speakers.

  • \$\begingroup\$ So I actually have already looked into sourcing the voltage needed with an external battery and op amp, I am just curious if a square wave will actuate it and make it vibrate at its resonance freq thank you though! \$\endgroup\$
    – gbck123
    Feb 5, 2020 at 2:33
  • \$\begingroup\$ You can input any periodic signals to piezo, but since the Fo is at 20kHz, anything below 20kHz will be hard to hear. I'm assuming this is not for human listening purposes, so you need a very good mic/receiver to see if it's working or not. \$\endgroup\$
    – BrianH
    Feb 5, 2020 at 3:14

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.