Driving a Piezo sounder off an MCP23017

Hi all.

I have an output on an MCP23017 multiplexer that is switching 3.3v.

I want to use it to drive a Piezo...

Externally driven Piezo

I don't have the ability to use through hole components (something underneath) and this is the only range of piezo's I have found that are SMD.

Also, the internally driven Piezo's are madly expensive.

Any idea of a very simple drive circuit (square wave?) to enable this Piezo as a warning/beep sounder?

Everything I have Googled so far is madly complicated. I can't drive off the processor, as there are no pins left.

The venerable 555 comes to mind.

1 Like

That's an I/O expander, not a multiplexer. Both have their uses but do not confuse them one with the other.

a7

Sorry my bad...

OK, this has gone in a slightly different direction, but same parts....

I have a 3.3v Arduino pin that is either the piezo, or used as some other input/output. It is never both, this is something that is configured at boot.

If it IS set as a piezo, then the MCP23017 switches in the ground to enable it.

If it is NOT set as a piezo, the MCP23017 stays low and the piezo is only connected to the Arduino pin in question.

Is this going to affect the usage of the Arduino pin for other uses? As in... will anything weird occur through that NPN (and therefore through the attached piezo) to affect the usage of the pin for other purposes if it's not a piezo pin?

Basically.... will that NPN make a clean enough break from 0v?

Makey sense?

Can you drive the MCP23017 fast enough to produce a square wave that is fast enough for the piezo? They're I2C driven so rather slow, lots of data to be pumped over the slow I2C bus just to change one output. If not this idea is pretty much dead in the water.

You will need a resistor across the piezo to discharge it during the "off" part of the cycle.

An active buzzer would be the easier way to go about this. All you need to do is apply voltage and they make a lot of noise. Those things are dirt cheap, too.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.