Change gain between speaker and headphones

Hello,

I am using a 10W TPA3138D2 amplifier for my projects, and I would like to be able to use it with headphones as well. However, the output signal for the headphones is too powerful and I would like to find a way to switch the output between the speaker and headphones with two different power levels.

Currently, my system is wired so that when the headphone jack is inserted, the speaker is disconnected.
View attachment 1258355
The signal starts from A+ (amplifier output) and goes to SP+ (speaker cable).

How could I modify the circuit so that I can change the gain and disconnect the speaker when the headphone jack is inserted?

The circuit includes a classic preamplifier based on TL072 that can be modified. Any ideas or suggestions are very welcome, perhaps there is a type of jack input with a different pin configuration, or one that has an isolated switch in parallel, or...
 
Here's the picture:
1704928517893.png


Thank you Dave R, simple and effective, I have already downloaded the Excel file for the calculation. The other half of the problem remains, the headphone signal (A+) comes out before the speaker signal (SP+), so any modification to the headphones would be directly transmitted to the speaker.
 
Moderator
Joined 2011
The speaker is switched by the present jack, so it's easier to just plug a cable into the jack
when you want to use headphones.

So the attenuator becomes part of the headphones, and the combination is used as before.
 
Last edited:
I'm sure in the past, I have used a switching 1/4" jack with an isolated DPDT switch, but I can't find them on the internet. There are some DPDT 9-pin jacks that are close and may be usable.

In any case there are issues to worry about. Running the speaker through jack switch contacts is potentially unreliable.
And headphones use a common ground, so the headphones need DC blocking capacitors.
In the past, I used a series resistor about 150 Ohms for headphones. The issue of impedance match or current feed is a subject for lengthy discussion.
 
I found an isolated DPDT jack entry PJ-307A, which I have already adapted into my circuit with its respective footprint.
1704985177417.png

With this layout I can test both attenuation resistors and voltage divider; I added the two zener diodes as extra protection, I don't know if they may be needed but I prefer to have them available on the PCB and not need them rather than needing them and not having the footprint on the PCB.

Pins 6/7/8 are for the DPDT, JP7 is only needed because the datasheet does not specify which pin is connected between 6 and 8 when the jack is not inserted. With this 307A model I can manage headphones and speakers independently.

Steve, do you mean to insert two capacitors in series before the output in pins S and T? My power amplifier states that output capacitors in series to the speaker are not needed, could they still be necessary?
 
Your amplifier is a bridged amp and does not require capacitors because the two outputs (A+, A-) have the same DC offset, ie half the power supply voltage. But when you use just one side (A+), it has a DC offset with respect to the (negative?) power supply. You cannot connect A- and B- together for the headphone common ground. Your Jack appears to be a SPDT, not a DPDT. The diodes will cause distortion unless there is DC bias on them.
 
Last edited:
Your schematic seems to have both sides of the headphones connected to the amplifier "A" channel. And the connector you show does not have two poles (DPDT) to switch two channels? Unless you have an uncommon set of headphones, the common ground for left and right creates a problem with bridged amplifiers that do not have a common return for the left and right speakers. The PJ-307N5 connector does not have the required DPDT switch. Possibilities are:
https://datasheet.lcsc.com/lcsc/2110151730_XKB-Connectivity-PJ-3440-2_C381136.pdf
https://www.retroamplis.com/Jack-stereo-dpdt-jalco
JALCO_ml.jpg


Amazon and Walmart show "9-pin" connectors but they do not provide data sheets to verify that this is the required connector.
The solution to the common ground issue is to use only the A+ and B+ outputs for headphones with DC blocking capacitors, and the headphone ground connected to the supply negative.
 
Last edited:
Another potential issue is the TPA3138 is designed to be used "inductor free". Again, this operation depends on the existence of the two bridged outputs and may create an excessive high frequency drive for headphones, unless the headphone attenuator includes a low-pass filter, which could be a little as a shunt capacitor in the attenuator.

You may want to consider disabling the TPA3138 in favor of a separate headphone driver chip.
 
You rightly assumed that the audio output was stereo from my previous picture, but it is actually mono, and I have corrected the diagram, my mistake. I have further changed the output jack to a PJ-307E, which has two separate switches:

1705161445921.png

In this way, when no jack is inserted, A+ is connected to the speaker and the headphone circuit is interrupted, it should not dissipate power.

HP connects a resistor in the preamplifier to lower the gain of the guitar and balance the volume between the instrument and the mp3 signal, directly connected to the TPA. This is a marginal detail, as the resistive divider must still attenuate the power of the TPA receiving the preamplifier mp3 signal from the smartphone/tablet. Do you think this assumption is correct?

I will still insert the LC filter at the output of the TPA, which can work both with and without the LC filter, as specified in the datasheet.

Furthermore, as you suggested, I could also use a smaller separate amplifier just for the headphones, it is an extreme measure if I cannot solve the problem, I want to maintain high sound consistency between the two outputs.