Solution to connect a mono Class D audio amplifier to a 3.5mm headphone socket

Thread Starter

freeflyer

Joined Sep 9, 2016
169
I am trying to find a solution to connect a mono Class D audio amplifier (MAX98357A) to a 3.5mm headphone socket that allows the user to switch between left OR right speaker.

At the moment, the amplifier is connected as shown in the diagram below but means the audio only plays on the left speaker...


1782135598962.png


The device uses a single mono headphone speaker, but the speaker could be wired to the left or right channel on the stereo jack.

Is there a way it could be configurable so the user can change it to use either the left speaker or the right speaker ?

I did consider shorting the tip and ring together, but this is risky because if a mono plug was inserted it would short the amplifier output (refer to diagram below).

1782136076066.png


I then considered using a change over DIP switch, so the user could select whether the amplifier is routed to the left or right change of the socket. But DIP switches are only rated to a few hundred milliamp which is not enough for the amplifier.
 

MrChips

Joined Oct 2, 2009
34,920
Why would you want to select between LEFT and RIGHT headset?
Why not both sides working at the same time?

Connect the amplifier outputs OUTP and OUTN to TIP and RING of the stereo plug/jack (i.e. headsets in series, out of phase).

If the headset is 8Ω or higher, connect TIP and RING together and connect to OUTP. Connect SLEEVE to OUTN (i.e. headsets in parallel).
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
Why would you want to select between LEFT and RIGHT headset?
Why not both sides working at the same time?

Connect the amplifier outputs OUTP and OUTN to TIP and RING of the stereo plug/jack (i.e. headsets in series, out of phase).

If the headset is 8Ω or higher, connect TIP and RING together and connect to OUTP. Connect SLEEVE to OUTN (i.e. headsets in parallel).
Because this is used as an audible altimeter (vocal) fitted into a helmet and for safety I only want to use one speaker because:

1. Another audible device is usually used for the other ear (which beeps at different altitudes) as a backup
2. Having audio playing in both ears makes it more difficult to communicate with others in an already noisy environment whilst wearing a helmet
3. If it played on both speakers, the loudness of each speaker would be reduced potentially making it inaudible as it needs to operate in a noisy environment (and if I used a higher power amp it would result in hearing damage !).
 

MisterBill2

Joined Jan 23, 2018
27,713
While the posted question and pictures are a bit confusing, the solution is simple: Connect resistors in series with the output to both the TIP and the RING points on the connector. The resistors should be the same value, probably either 27 ohms or maybe 33 ohms, both standard values.
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
While the posted question and pictures are a bit confusing, the solution is simple: Connect resistors in series with the output to both the TIP and the RING points on the connector. The resistors should be the same value, probably either 27 ohms or maybe 33 ohms, both standard values.
Do you mean like this...

1782140263879.png


But wouldn't the resistors reduce the loudness of the speaker ?

I measured the resistance of each speaker and each one was around 63 ohms.

These are the speakers I am using....

https://cardosystems.com/products/40mm-hd-speakers-set

I have cut off the wire for the right speaker, because as shown in the original post the socket is only wired to the left channel (and sods law.... the left speaker has the shortest cable length !)
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
If you say so. But - Why not? What is it I'm not understanding that you want to accomplish?
It would work for linear amplifiers, where the connection to the socket is:

- sleeve is GND
- ring is right channel
- tip is left channel

But the MAX98357A is not a linear amplifier, it is a "switching" amplifier (i.e. Class D). The output is a high frequency PWM signal which is filtered by the speaker to create an analogue behavior.

Class D amplifiers are more efficient than linear amplifiers (Class A, Class A/B etc), because they only dissipate power when the PWM is switching (i.e. from low to high / high to low).

They are ideal for low power battery applications, although the trade of is that the audio quality is not as good as a linear amplifier.

This class D amplifier uses a BTL (Bridge Tied Load) output stage as shown below...

1782143031965.png

This means each speaker terminal continuously alternates between positive and negative. Since both ends of the load are connected to drivers, GND cannot be used as a reference.

So a simple stereo to mono converter (as shown in your link) would not work for this amplifier, and depending on the wiring it could short circuit the amplifier and damage it.
 

MisterBill2

Joined Jan 23, 2018
27,713
One solution would be transformer isolation. Or possibly two transformers, one for each channel. AND THEN put the two secondaries i series, so the output is the sum of both channels. OR the difference iif the polarity of one is reversed.
The limitation is that the transformers must be adequate for the power without causing saturation distortion. Since I have no hint as to the power level, I can't help with that part of the decision. For a 200 watts per channel car stereo the transformers will be rather heavy and quite a few cubic inches, each. For a 200 MILLIWATT system, they will be smaller and lighter and cost less.
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
One solution would be transformer isolation. Or possibly two transformers, one for each channel. AND THEN put the two secondaries i series, so the output is the sum of both channels. OR the difference iif the polarity of one is reversed.
The limitation is that the transformers must be adequate for the power without causing saturation distortion. Since I have no hint as to the power level, I can't help with that part of the decision. For a 200 watts per channel car stereo the transformers will be rather heavy and quite a few cubic inches, each. For a 200 MILLIWATT system, they will be smaller and lighter and cost less.
I'm not sure that a transformer would work for a class D switching amp that has a BTL PWM output ?

Also board space is very tight, even fitting a small DIP switch would be a struggle.
 

MisterBill2

Joined Jan 23, 2018
27,713
Do you mean like this...

View attachment 368636


But wouldn't the resistors reduce the loudness of the speaker ?

I measured the resistance of each speaker and each one was around 63 ohms.

These are the speakers I am using....

https://cardosystems.com/products/40mm-hd-speakers-set

I have cut off the wire for the right speaker, because as shown in the original post the socket is only wired to the left channel (and sods law.... the left speaker has the shortest cable length !)
YES!! That is exactly what I meant. With 63 ohm headphone speakers tere will be some sound level reduction, so it will require adjusting the loudness level setting on the sound source.

Now a question: If the load connected is aheadphone set, how much power do they actually require?? I have been places where I can hear the music from another persons headphones several feet away. My hearing is fairly poor, so I am certain that their headphone sound level was very loud. WHAT sound level are you wanting to produce in thos headphones??
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
YES!! That is exactly what I meant. With 63 ohm headphone speakers tere will be some sound level reduction, so it will require adjusting the loudness level setting on the sound source.

Now a question: If the load connected is aheadphone set, how much power do they actually require?? I have been places where I can hear the music from another persons headphones several feet away. My hearing is fairly poor, so I am certain that their headphone sound level was very loud. WHAT sound level are you wanting to produce in thos headphones??
The issue is the environment that the device will be used in. It is a VERY noisy environment !

Inside the aircraft is VERY noisy (its no where near as quiet as a commercial jet). Then in freefall its EXTREMELY noisy.

As it stands, the audio can be heard in both situations most of the time. But if the volume was reduced then the audio might not be heard at all.
 

boostbuck

Joined Oct 5, 2017
1,056
I suggest your original idea of shorting ring and tip together is the best. As you say, a mono plug will short the output, but looking at the datasheet for the amp, it is described as having "robust short circuit protection" and the Absolute Maximum Ratings shows duration of short to power or ground or compliment as "continuous" so it seems it is nothing to worry about - the correct two channel plug (either side) will work, and an inadvertent mono plug will have silent output.

https://www.analog.com/media/en/technical-documentation/data-sheets/max98357a-max98357b.pdf
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
I suggest your original idea of shorting ring and tip together is the best. As you say, a mono plug will short the output, but looking at the datasheet for the amp, it is described as having "robust short circuit protection" and the Absolute Maximum Ratings shows duration of short to power or ground or compliment as "continuous" so it seems it is nothing to worry about - the correct two channel plug (either side) will work, and an inadvertent mono plug will have silent output.

https://www.analog.com/media/en/technical-documentation/data-sheets/max98357a-max98357b.pdf
I tired shorting the ring and tip.

I connected a speaker with a mono plug, which therefore shorted the sleeve and ring (i.e shorted the amplifer output) and surprisingly I could still hear some audio, although it was distorted and low volume. I would have expected the short would prevent any audio. In this test the speaker resistance was 32 ohms.

Hopefully the datasheet is correct, when it says its robust against short circuit and can handle that condition continuously !?


1782409673828.png

1782409758410.png
 

Attachments

AnalogKid

Joined Aug 1, 2013
12,174
Your requirement still is not clear to me. Here is a solution for one of the possible interpretations.

The two outputs are identical except for polarity. Both outputs are squarewaves that are referenced to GND, on a fixed DC offset above GND. Normally, driving stereo headphones like this would be a psycho-acoustic problem because the audio in the two speakers would be out of phase. But since you are driving only one speaker at a time, phasing is not an issue.

Alternatively, you can combine the two SPST switches into a single DPDT switch for simple single-toggle action.

ak

!!Mono-Headphone-Switch-1-c.gif
 

AnalogKid

Joined Aug 1, 2013
12,174
Round 2.

This version shows single-switch wiring. I added resistors to GND after the capacitors to reduce popping when switching.

ak

!!Mono-Headphone-Switch-2-c.gif
 

boostbuck

Joined Oct 5, 2017
1,056
Your requirement still is not clear to me......
Nor me, tbh. Even shorting tip and ring together is not going to select left or right unless using one-sided headsets with specific plug wiring. In which case why not wire each left- or right-headset to a simple mono plug??? But if the headsets are stereo there would need to be a way to disable one side. It is a bit unclear.
 
Top