1
\$\begingroup\$

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:

schematic

simulate this circuit – Schematic created using CircuitLab

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:

schematic

simulate this circuit

The bridge configuration has a number of advantages, like increasing the overall max volume and allowing emulation of two channels (similar to the Arduboy2 or toneAC library).

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.

\$\endgroup\$
  • \$\begingroup\$ with only one speaker it's a single channel output, just use Spehro's circuit. if you actually need to control two signals for some undisclosed reason use a dual potentiometer. \$\endgroup\$ – Jasen Jan 17 at 1:32
  • \$\begingroup\$ I get that it's only really one channel, but you're correct that I do need to toggle two signals to emulate two channels. \$\endgroup\$ – menehune23 Jan 17 at 2:10
1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Just replace ground with the other phase.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks for the response. This will give the volume advantage, but not the multi-channel emulation, unfortunately :( \$\endgroup\$ – menehune23 Jan 16 at 0:09
  • \$\begingroup\$ I did update the question slightly with some info about ideas of my own. \$\endgroup\$ – menehune23 Jan 16 at 0:09
  • \$\begingroup\$ If you can use the DAC that would be a good solution. Doesn't really lend itself to using PWM-based signals though. \$\endgroup\$ – Spehro Pefhany Jan 16 at 0:15
  • \$\begingroup\$ Yeah that’s definitely a disadvantage. I could still do the mixing in an interrupt thankfully. Not quite as good as toggling the line directly but better than trying to achieve it in the main loop. \$\endgroup\$ – menehune23 Jan 16 at 0:30
  • \$\begingroup\$ Or add a real mixer and bridged amplifier on the outputs but that's a bit more involved. \$\endgroup\$ – Spehro Pefhany Jan 16 at 0:35

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.