I have a 10K potentiometer that I'd like to use to control the volume of a piezo transducer/buzzer, which is driven by one or more MCU PWM-capable pins (ranging from 0 to 3.3V). Originally, my configuration looked like this, using a single pin:
I need to adapt this to use a bridge configuration across the piezo buzzer, using two separate PWM-capable pins, similar to what's shown below, except with volume control somehow:
Is there any simple way that I can effectively scale two separate signals with the same potentiometer? Preferably, I'd need to stick with simple through-hole components.
Some things I've thought about:
Using diodes somehow, maybe in an ORing configuration, but I don't think this will give the desired effect.
Since I do have a DAC available on my MCU (SAMD21E), I can mix the two audio signals (square waves) in firmware and output on the DAC pin, using the configuration in diagram 1 to control the overall volume.
Thanks for any help or advice.