I have several piezoelectric crystal speakers connected to a TI MSP430 series MCU.
All speakers share a common PWM driven MCU pin and each one use a distinct MCU pin to select them. If only one of those select pins is driven low or high and the others are in open state, one distinct speaker can output the audio waveform delivered by the PWM pin. The peak-to-peak PWM amplitude is 3V this way, as the select pins can't be driven by the PWM frequency too.
Now I need to raise the volume level of the audio output.
I tried to use an integrated amplifier, however the options are scarce as the circuit should be battery powered for years, and only amplifiers with uA standby consumption are usable. I tried some, but they are meant for analog input and can't cope with the PWM drive, thus producing a massive noise floor.
What else options are there? It is possible to use some IC providing an balanced PWM drive (eg. dual H bridge to provide 6V peak-to-peak) which operate with one-digit uA standby power? Or is there any discrete circuit with equally low static consumption?
Best Answer
To provide 6V peak to peak (thus increasing volume), you need the select speaker pin to be driven out of phase, as you suggest.
Now, nothing really prevents you to have this pin:
If you can't do it without external components because the MCU doesn't have enough PWM outputs, or because it doesn't allow you to configure them as required, let's use simple logic gates to do that. What you need is just an inverter gate (actually one per speaker) that has an enable input which puts the output in high impedance. You feed the input with the PWM, and the output enable with your select signal. The output goes to the speaker terminal (the other terminal being fed with the PWM directly, just like it currently is).
Of course, such a chip doesn't exist off-the-shelf. So a solution is to use a single inverter (but I'm sure you can actually avoid it by configuring the MCU to directly output a complementary PWM signal), followed by some buffer with 3 state outputs and independant output enable: 74LVC125, can feed four spakers. Typically 1uA current consumption.
If you have a lot of speakers, you'll need several 74LVC125 and their quiescent currents will add up. At some point, it may become too much. In that case, gate their supply with a small P-channel MOSFET that you turn on (using an additional GPIO) only when at least one speaker is active. Then, only the FET leakage will be consumed most of the time. In this case, however, make sure from the software that the PWM output and all select lines from the MCU are tristated when the MOSFET is off, because otherwise, you may burn the buffer chips.