Electronic – The right way to have amplified speakers that mute when you plug in earphones

amplifieraudioheadphonesi2sspeakers

I am designing a handheld device that has an I2S DAC, small speakers, amplifiers (~2 watts), and an earphone jack. I'd love advice on the best way to hook these together. My goal is high quality audio for a broad number of configurations, including different types of earphones, without going nuts on complexity and cost.

Options I have explored:

  1. Have the DAC output to an earphone jack with internal switches, when the earphones are present audio plays through them directly, otherwise the signal passes through the earphone jack switches to the amplifiers and then speakers. This is what I've been using so far. It works, but is it really okay to drive earphones from the DAC output directly? The speaker amps are always active which is wasteful and pick up some noise. Also potentially noisy during insertion.

  2. The DAC feeds the amps directly, which connect to the earphones, or the speakers if earphones are not plugged in. Am I going to blow the earphones (or the user's eardrums) this way, or are earphones high enough impedance that the power delivered to them will be low? Will the brief shorting that occurs during insertion kill the amps? (I guess that depends on the amp)

  3. Implement insertion detection (I've seen a few ways to do this with some pros and cons) and route audio to either the speaker amplifier, or the earphones (with or without their own amplifier). Would I need to switch the signal, or would it be okay to route the signal to both in parallel and simply disable the speaker amps when earphone insertion is detected?

  4. Is there an integrated solution that can do this for me?

Thanks!

Relevant:

Mutually exclusive headphone and speaker

How does the phone detect if 3.5 mm jack circuit is closed?

How (not) to leave class-D amplifier's input hanging

Best Answer

The headphones may be connected to the amplifiers, through attenuators, with a DPDT switch to select speakers or headphones.

Since the PAM8301AAF output is for an 8Ω speaker, the sum of R1 and R2 should be 8Ω. The choice of R1 & R2 values would depend on the level of attenuation required. 1W resistors would suffice.

The schematic shown is for one channel.

enter image description here

With the PAM8301AAF outputs to be kept isolated between themselves and ground, a standard headphone plug/jack cannot be used.

Separate mono headphone plugs/jacks, with separate cables for each headphone element, would be required for the isolation.