I have a Raspberry Pi outputting a 3.3v DC square wave that I'd like to be able to amplify to just under 20v, the maximum the piezo can handle. Just to clarify, the piezo does not have an internal oscillator and the Pi is outputting at anything from 50Hz to 3kHz to make audible tones. From looking elsewhere online, there seem to be many different approaches to amplification but most require an AC wave to work.

I'd like to be able to simply and cheaply amplify the wave generated by the Pi to make recognisable musical tones with the piezo as loud as possible. The wave doesn't have to be perfect, but I'd rather there was as little interference or noise as possible! I have 3.3v, 5v and 7.2v available on the project and I could add a pair of 9v batteries if 18v is needed. The piezo has a 7kohm impedance, if I remember according to the data sheets, if that helps.

A circuit diagram would be good but a bit of an explanation to go with it would be preferred!

Edit: The data sheet is at http://www.farnell.com/cad/356850.pdf

Another edit: I'll be testing Spehro's answer as soon as I can, assuming that school has all the extra components needed.

  • 1
    \$\begingroup\$ Since you're working with a square wave, just treat it like any other digital signal. Imagine the peizo is a relay - what would you use then? \$\endgroup\$
    – Majenko
    Oct 21, 2014 at 23:56
  • \$\begingroup\$ Could you post a link to the piezo data sheet, please? \$\endgroup\$
    – EM Fields
    Oct 22, 2014 at 9:31

2 Answers 2


You could use an inexpensive motor driver chip such as the Diodes ZXBM5210 (plus an inverter, such as 1/6 of a 74HC04 or a MOSFET + a resistor).

You put the piezo plus a small series resistor- perhaps 50\$\Omega\$- in place of the motor. Internal circuit looks like this:

enter image description here

So you would switch between Forward and Reverse using your port pin (you need the inverter to feed the complementary signal to (say) Reverse while the Forward input gets fed directly.

Note that this is a push-pull driver, so the peak-to-peak voltage across the piezo will be a bit less than double the supply voltage, so 9-10V is fine for the supply.

The resistor is to limit the peak current to 200mA since the piezo looks like a fairly low ESR capacitor. Put a good bypass capacitor on the higher voltage supply (perhaps 220uF/16V electrolytic or at least a 10uF/25V ceramic).

This chip has built-in dead time of about 3us so you can just drive the inputs in complementary fashion without worry. The PWM input should be tied to Vdd to avoid the chip itself doing PWM.

I also suggest putting a couple K ohms of series resistance in series with the port pins, just in case something gets shorted to the 10V supply it might save the processor from destruction.

Chances are the piezo will not fail with much higher voltage than the rated 20V, and this chip is rated for 18V maximum supply (36Vp-p) if you feel lucky and want to try it.


Arguably the cheapest way to get a loud output from the piezo would be to use a 556 or a couple of 555s to drive the piezo with an H bridge made from their totem-pole outputs, as shown below. I've shown the circuit with a 9 volt supply, but the [NE] 555 is rated for around 18V max, so you could drive them harder if you want the piezo louder.

V2 is the square wave from the Pi, the piezo is a WAG shown as R4 paralleled with C3, and the LTspice circuit list is here if you want to play with the circuit.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.