Electronic – Adding a volume control for headphones, driven by microcontroller

audiopotentiometer

I'm currently driving a pair of earbuds with this circuit:

enter image description here

P0 is directly connected to a 3.3V microcontroller pin, which is using PWM to drive it.

I "stole" this filter circuit from the upper left corner of this schematic. I modified it slightly, since I am driving stereo headphones from a single mono input.

The problem I'm running into is that the sound is really loud. I would like to add a volume control. I've read through How to make my own volume control for headphones?, but my situation is slightly different:

  • I don't have an amplifier.
  • The signal I'm starting with is 3.3V, rather than 1V.

My questions are:

  • Should I put the potentiometer before or after the filter? Or does it not matter?
  • Should I use a 1K pot, as mentioned in the other question, or does my situation require a different value of pot? More importantly, how do I calculate this value? (The other question doesn't explain how the value 1K was chosen.)

Thanks!

Best Answer

You can place a 1kOhm potentiometer in series with R1. This will control the current flowing into the 4-8 Ohm speaker load. It will also alter the cut-off frequency of the High-Pass filter, but I think this should not be a problem.