Author Topic: How to switch a speaker on and off?  (Read 10796 times)

0 Members and 1 Guest are viewing this topic.

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
How to switch a speaker on and off?
« on: July 29, 2015, 09:16:25 pm »
I have a 40W digital amplifier, in a mono BTL configuration (left and right channels both fed into a single output), powered by 12V and being fed into two 4 ohm speakers:
http://www.ti.com/lit/ds/symlink/tpa3131d2.pdf 

I would like to add a third smaller 8 ohm speaker and be able to switch it on and off, without using a relay, and without hearing a pop when it's turned on and off.

I'm not sure how to accomplish this though. 

I looked at some analog switches but didn't see anything that could handle anywhere near the amount of current required.  Also I believe the push-pull nature of the BTL setup means the voltage has to be able to swing negative, and a lot of analog switches don't support that.

I thought about sticking a couple nfets back to back like when you want to block current both ways, but I'm not sure if that will work with the negative voltage swings, and it probably won't do anything to avoid popping.  I may be able to mute the audio when switching them however to avoid a pop. 

Another thing that concerns me and that I don't know how to deal with is that the speaker is an inductive load, and will cause a voltage spike when switched off, but unlike a motor I might drive in only one direction, I can't just stick a diode across it.  I'm not sure how an h-bridge deals with this issue, but it's something that's probably going to be difficult to deal with.

Any ideas?
 

Offline Pjotr

  • Frequent Contributor
  • **
  • Posts: 461
  • Country: nl
Re: How to switch a speaker on and off?
« Reply #1 on: July 29, 2015, 09:34:18 pm »
Look for an optical coupled MOS FET, i.e. NEC PS710B. It is bi-directional and can stand 60V (off) and 2.5A (on). There are many flavours of optical coupled MOS FETs with various withstanding voltages and carrying currents. If you are afraid of inductive voltages from the speaker, simply use catch diodes from speaker to rail and ground on both sides for a BTL amp. But if it's a small speaker the fets will probably catch the small turn off energy spike easily in avalanche.
« Last Edit: July 29, 2015, 09:38:39 pm by Pjotr »
 

Offline BillW50

  • Contributor
  • Posts: 42
  • Country: us
Re: How to switch a speaker on and off?
« Reply #2 on: July 29, 2015, 09:43:26 pm »
My Marantz 4400 (a quad from the 70's) uses a relay to switch four speakers on and off and it doesn't have a pop. You can also add another four speakers (they call remote vs main) that is also on a relay. I do know the relay has a delay to allow the amplifiers to stabilize first. That might have something to do with this. But they probably have other circuits to avoid the pop too.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: How to switch a speaker on and off?
« Reply #3 on: July 29, 2015, 10:57:21 pm »
My Marantz 4400 (a quad from the 70's) uses a relay to switch four speakers on and off and it doesn't have a pop. You can also add another four speakers (they call remote vs main) that is also on a relay. I do know the relay has a delay to allow the amplifiers to stabilize first. That might have something to do with this. But they probably have other circuits to avoid the pop too.

 I agree, most speaker pop comes at power on and power off which was handled by most of the great vintage hi-fi amps and receivers (70s) with a delay/speaker protection relay. Once stabilized one could switch to different speakers without artifacts. Many such amps had termination for two sets of speakers that could be switched between or all on with just a standard front panel switch or button(s). You just had to insure you don't switch in too low a total speaker impedence (<4 ohms) when driving parallel switched in speakers.
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #4 on: July 30, 2015, 08:28:24 am »
Is it possible to do this in a solid-state manner?  I looked at a few solid state relays but I can't seem to find any which look like they'd accept a negative voltage swing.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: How to switch a speaker on and off?
« Reply #5 on: July 30, 2015, 10:06:20 am »
Triac-based SSRs are unsuitable since they won't conduct at less than 1.4 V (at which point they will turn off) and they triggering circuits are only designed for ~50 Hz, maybe 400 Hz (avionics) max.

MOSFET ones might work ok.

Mechanical relay will work ok, too.

Either one will make a pop noise with a bad amplifier. Pop noises when connecting speakers are caused by excessive DC output of the amplifier (and sometimes "transient" instability).
,
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: How to switch a speaker on and off?
« Reply #6 on: July 30, 2015, 10:29:15 am »
Is it possible to do this in a solid-state manner?  I looked at a few solid state relays but I can't seem to find any which look like they'd accept a negative voltage swing.
No you didn't, according to your first post, you looked at analogue switches which are not the same as solid state relays.
I looked at some analog switches but didn't see anything that could handle anywhere near the amount of current required.  Also I believe the push-pull nature of the BTL setup means the voltage has to be able to swing negative, and a lot of analog switches don't support that.

An analogue switch is just some MOSFETs controlled with digital logic to switch a signal. It does not provide any isolation and because the gate voltage can't exceed the power supply rails, the signal range also has to remain within the power supply rails. Analogue switches tend to only be rated for a couple of mA because they're designed for switching small signals, not power.

A solid state relays isolated from the switching circuit. The most common type use TRIACs or SCRs which are unsuitable because the don't conduct at low voltages, as mentioned above.

A MOSFET solid state relay would probably do. The difference between a MOSFET solid state relay an analogue switch is the MOSFET gates are driven from an isolated supply voltage so the signal being switched can exceed the supply rails of the control side. They're also rated for higher currents.

A quick search led me to this:
http://uk.farnell.com/panasonic-ew/aqv252g2s/relay-solid-state-spst-no-3a-10ma/dp/2302215
 

Offline Pjotr

  • Frequent Contributor
  • **
  • Posts: 461
  • Country: nl
Re: How to switch a speaker on and off?
« Reply #7 on: July 30, 2015, 11:07:10 am »
..............................
A quick search led me to this:
http://uk.farnell.com/panasonic-ew/aqv252g2s/relay-solid-state-spst-no-3a-10ma/dp/2302215

That one is in the same league as the one I posted in post 2 but is a lot more expensive. Many companies make this, Avago, IR, ON, Panasonic and so on. But is appears OP didn't even look up the part I mentioned. It is also available from Farnell and Mouser has similar. But imho OP is better off with a plain relay ;)
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #8 on: July 30, 2015, 11:26:55 am »
Is it possible to do this in a solid-state manner?  I looked at a few solid state relays but I can't seem to find any which look like they'd accept a negative voltage swing.
No you didn't, according to your first post, you looked at analogue switches which are not the same as solid state relays.

I looked at both.  And then I looked at solid state relays again after Pjotr suggested one.

Quote
A solid state relays isolated from the switching circuit. The most common type use TRIACs or SCRs which are unsuitable because the don't conduct at low voltages, as mentioned above.

A MOSFET solid state relay would probably do. The difference between a MOSFET solid state relay an analogue switch is the MOSFET gates are driven from an isolated supply voltage so the signal being switched can exceed the supply rails of the control side. They're also rated for higher currents.

A quick search led me to this:
http://uk.farnell.com/panasonic-ew/aqv252g2s/relay-solid-state-spst-no-3a-10ma/dp/2302215

That's a bit large for my needs.  Here's a bunch I found on Digikey.  I was able to narrow the search to 30 relays:
http://www.digikey.com/short/tqrz85

What do you think of this one?
http://www.clare.com/home/pdfs.nsf/www/CPC1020N.pdf/$file/CPC1020N.pdf

Cheap-ish, small, rated for 1.2A, 250mOhm resistance.

I would just stick that in the middle of one of the wires leading to the speaker and drive the internal LED with 3-5V and a resistor to limit the current to 0.5-2mA, right?

The only difference I see is that the diagram doesn't show any diodes inside, but I'm assuming those are ESD protection or something.  Should I have any external diodes to deal with the inductive spikes?  I don't know how to connect those for an AC source if so, or how to rate them.
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #9 on: July 30, 2015, 11:29:28 am »
That one is in the same league as the one I posted in post 2 but is a lot more expensive. Many companies make this, Avago, IR, ON, Panasonic and so on. But is appears OP didn't even look up the part I mentioned. It is also available from Farnell and Mouser has similar. But imho OP is better off with a plain relay ;)

I did look up the part you mentioned.  But I could not find it on Digikey and only found one old PDF for it. 

And I did not notice how much the part he suggested cost.  Yeowch!  The one I found is only $2.50 @ qty 25.
 


Offline RABeng224

  • Contributor
  • Posts: 24
Re: How to switch a speaker on and off?
« Reply #11 on: July 31, 2015, 01:12:13 am »
I built a "speaker router" that takes a simple 2 channel receiver and routes it to different speaker zones.  I used decent quality relays and I have no issues or popping when switching between speaker zones.   
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: How to switch a speaker on and off?
« Reply #12 on: July 31, 2015, 04:45:50 am »
Maybe I'm overly idealistic, but I'm surprised that there's no way to just ease the amplifier in, rather than letting it have a mini-tantrum and just disconnecting it from the speakers while it does that. Like, inhibiting the upper half of the bridge and turning them on gradually so the output voltages just gently move into position.
 

Offline BillW50

  • Contributor
  • Posts: 42
  • Country: us
Re: How to switch a speaker on and off?
« Reply #13 on: July 31, 2015, 07:54:10 am »
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: How to switch a speaker on and off?
« Reply #14 on: July 31, 2015, 10:06:30 am »
I did look up the part you mentioned.  But I could not find it on Digikey and only found one old PDF for it.

It's an obsolete part.  This got me thinking about vactrols, another old optoelectronic part no longer manufactured.  In the few cases when one is needed nowadays, people build their own.  And that it would be a similar process to build your own SSR.

The PS710B internal diagram shows we need two N-MOSFETs, back to back.  Pick MOSFETs that switch at a low gate voltage.  MOSFETs intended for 3.3V operation are common.

Next, we need an isolated source of sufficient voltage for each gate.  We don't need much current at all, since the gate is a capacitor.  So two of these SMD 4.0V solar cells would do nicely:

https://www.sparkfun.com/products/9962

Add a light to illuminate the solar cells.  LED(s) are an obvious choice.  But the slow turn-on/off of a small incandescent might make for a more pleasing switch.  That solar cell has best sensitivity in infrared, which incandescents produce plenty of; the incandescent can be slightly underdriven and basically last forever.

If the solar cells don't bleed off gate voltage fast enough when the light is turned off, we'll have to add two bleeder resistors to do that job.

Finally, you might want to wrap the light and solar cells together; both to prevent external light from reaching it, and to maximize the amount of light absorbed by the cells.  White electrical tape looks ghetto, but does the job fine; or substitute something more classy.

There's currently an Ebay auction for two of those solar cells, US seller, $4.54 for both including shipping.  The other parts you might already have on hand, or could be scavenged.

It's just an option to consider.  You could opt to buy something like a CPC1020N at Digikey for $3.12, and be done with it.  Well, maybe.  Consider that it and others like it are built for relatively fast switching times.  It switches on and off in ~0.5ms.  That will soften the pop for sure, but I don't know if the result will be entirely satisfactory.  You might get a thump rather than a pop, especially if the amp has a large DC offset.  If so, and you don't like it, you'll end up having to build something to fade the internal LED at an acceptable rate.  Whereas if you build the SSR from scratch, especially using an incandescent, you can be certain it will be slow enough!
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #15 on: July 31, 2015, 10:23:40 am »
Sure it is possible.

http://lmgtfy.com/?q=solid+state+audio+relay

Huh, three of those links are already purple.  I guess I must already have googled that before asking. :)
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #16 on: July 31, 2015, 11:11:38 am »
I did look up the part you mentioned.  But I could not find it on Digikey and only found one old PDF for it.

It's an obsolete part.  This got me thinking about vactrols, another old optoelectronic part no longer manufactured.  In the few cases when one is needed nowadays, people build their own.  And that it would be a similar process to build your own SSR.

The PS710B internal diagram shows we need two N-MOSFETs, back to back.  Pick MOSFETs that switch at a low gate voltage.  MOSFETs intended for 3.3V operation are common.

Next, we need an isolated source of sufficient voltage for each gate.  We don't need much current at all, since the gate is a capacitor.  So two of these SMD 4.0V solar cells would do nicely:

https://www.sparkfun.com/products/9962

Add a light to illuminate the solar cells.  LED(s) are an obvious choice.  But the slow turn-on/off of a small incandescent might make for a more pleasing switch.  That solar cell has best sensitivity in infrared, which incandescents produce plenty of; the incandescent can be slightly underdriven and basically last forever.

If the solar cells don't bleed off gate voltage fast enough when the light is turned off, we'll have to add two bleeder resistors to do that job.

Finally, you might want to wrap the light and solar cells together; both to prevent external light from reaching it, and to maximize the amount of light absorbed by the cells.  White electrical tape looks ghetto, but does the job fine; or substitute something more classy.

There's currently an Ebay auction for two of those solar cells, US seller, $4.54 for both including shipping.  The other parts you might already have on hand, or could be scavenged.

It's just an option to consider. 

Neat idea.  And I didn't know tiny SMD solar cells like that existed.   But this solution is too complicated and expensive, and incandescent are prone to failure.


Quote
You could opt to buy something like a CPC1020N at Digikey for $3.12, and be done with it.

Oh good, that's the one I linked to above.


Quote
Well, maybe.  Consider that it and others like it are built for relatively fast switching times.  It switches on and off in ~0.5ms.  That will soften the pop for sure, but I don't know if the result will be entirely satisfactory.  You might get a thump rather than a pop, especially if the amp has a large DC offset.  If so, and you don't like it, you'll end up having to build something to fade the internal LED at an acceptable rate.  Whereas if you build the SSR from scratch, especially using an incandescent, you can be certain it will be slow enough!

If you look at the datasheet, there's a graph of turn-on time vs LED current on page 3:

http://www.clare.com/home/pdfs.nsf/www/CPC1020N.pdf/

It looks like if I limit it to 1mA it will take 1ms to turn on, and if I limit it to 0.5mA it will take 2ms. 

I don't know if that's enough to completely eliminate the pop, but if my calculations are correct it looks like a ramp up over 2ms would be equivalent to one quarter of a 250hz sine wave, and 45 samples at 22KHz, which seems sufficient to avoid a pop. 

Also in my specific usage case, a pop when the speaker is turned on would not be a show stopper.  Also, I could mute or ramp the audio briefly, or wait until a zero crossing to make the switch, since my microcontroller will be processing all the audio. 

But I'd rather not make more work for myself, so hopefully the relay will just work with the 2ms transition time.


Now the only thing I need to worry about is if I'm going to get an inductive spike when the speaker turns off.  Any thoughts on that?
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3327
  • Country: gb
Re: How to switch a speaker on and off?
« Reply #17 on: July 31, 2015, 11:24:33 am »
What's the actual issue with using a normal relay?  If you described that, maybe there's a way to work around this problem which would be easier than using a solid state switch.
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #18 on: July 31, 2015, 01:18:14 pm »
Relays wear out and are large.  The speaker will be turned on and off many times a day when in use.  Since it won't be in use every day, it would probably last long enough... a few years...  but if I can do the same job with a tiny chip that I never have to worry about wearing out, why not go that route?

Relays also draw a lot of current for the coil, so I'd need to add a transistor as well if I want to drive the thing from a microcontroller pin.  Also I think when looking for one and having narrowed down the selection to SMD relays they wanted at least 12V to activate.  And that would require me to run a 12V supply to the relay.

Contrast this with the SSR, which requires only half a mA from a single IO pin and a GND connection to trigger it.  I could connect it with a servo cable, or two wires.  The servo cable would be convenient since I already have servo outputs on my board.  A 5V relay would also work, but I'd probably have to use a large through hole one.  I'll have to take another look and see what's available.

Another issue with relays is their specs are confusing - coil voltage, switching voltage min, max?  and a panasonic relay lists "pick up" and "drop out" voltage as a percentage of coil current, and I'm not sure if that's the switching voltage or not. 

Also, I think that if I get a 5V relay then if I ever want to use 3V logic to control it I'm out of luck and will have to redesign the board to use another relay.

Also also, I think I'll need a diode across the relay's coil to avoid killing my microcontroller.


Quote
maybe there's a way to work around this problem which would be easier than using a solid state switch.

Well, what's not easy about using a SSR?  It looks easy enough, and sounds like I can make it switch slow enough.  Is there another issue I should be worried about?  Nobody has yet answered if I need to be concerned about the inductive spike from the speaker.  But I can't see how using a regular relay would solve that problem.  I mean the relay itself would survive, but maybe not the amplifier.
« Last Edit: July 31, 2015, 01:35:15 pm by Starlord »
 

Offline Pjotr

  • Frequent Contributor
  • **
  • Posts: 461
  • Country: nl
Re: How to switch a speaker on and off?
« Reply #19 on: July 31, 2015, 01:35:37 pm »
.........................................Nobody has yet answered if I need to be concerned about the inductive spike from the speaker.  But I can't see how using a regular relay would solve that problem.  I mean the relay itself would survive, but maybe not the amplifier.

Read over post 2 then. If the amplifier likes it or not depends on the amplifier. But a decent one shouldn't care about it.
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: How to switch a speaker on and off?
« Reply #20 on: July 31, 2015, 01:53:49 pm »
Yep, a decent amp should have at least some protection against inductive spikes built-in.  Otherwise, any time you had a loose speaker wire, you'd blow the amp.

However, an SSR may or may not have this protection.  It can be added by putting two zener diodes in series, but facing in opposite directions, across the SSR; with the zener voltage being less than the maximum voltage of the SSR.  (Or a TVS, which is equivalent to two zeners.)

You may be able to get away without that, if you're:

1) Switching the SSR slowly enough that an inductive spike doesn't develop.
2) Switching only a secondary parallel speaker, leaving the primary speaker connected at all times; which gives the spike a path to travel through, so it won't rise to a particularly high voltage.

But I'd be more comfortable with the zeners.  Cheap insurance.
 

Offline StarlordTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
Re: How to switch a speaker on and off?
« Reply #21 on: July 31, 2015, 02:16:23 pm »
Yep, a decent amp should have at least some protection against inductive spikes built-in.  Otherwise, any time you had a loose speaker wire, you'd blow the amp.

However, an SSR may or may not have this protection.  It can be added by putting two zener diodes in series, but facing in opposite directions, across the SSR; with the zener voltage being less than the maximum voltage of the SSR.  (Or a TVS, which is equivalent to two zeners.)

So wire them cathode to cathode or anode to anode (which way doesn't matter?) across the SSR's output pins?  Or use a TVS?

When you say Zener voltage do you mean breakdown voltage or voltage drop?


And is there a way I could tell if the SSR has these diodes even if they're not shown in the schematic?  Some spec that would give their presence away?


Quote
You may be able to get away without that, if you're:

1) Switching the SSR slowly enough that an inductive spike doesn't develop.
2) Switching only a secondary parallel speaker, leaving the primary speaker connected at all times; which gives the spike a path to travel through, so it won't rise to a particularly high voltage.

But I'd be more comfortable with the zeners.  Cheap insurance.

Number 2 would be likely true most of the time, but I can't trust that will always be the case.
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: How to switch a speaker on and off?
« Reply #22 on: July 31, 2015, 05:39:31 pm »
So wire them cathode to cathode or anode to anode (which way doesn't matter?) across the SSR's output pins?  Or use a TVS?

Yes.

When you say Zener voltage do you mean breakdown voltage or voltage drop?

Breakdown voltage.  For example, the 1N4749 is a 24V zener, and might be a good choice for the CPC1020N (30V max).

And is there a way I could tell if the SSR has these diodes even if they're not shown in the schematic?  Some spec that would give their presence away?

Not sure on this class of components.  In general I'd look for phrases like "ESD", "inductive spike", or "overvoltage" protection on the output.  I noticed "Arc-Free With No Snubbing Circuits" on your pick, that might be significant or just mean no dV/dT triggering (a different issue with TRIACs), I don't want to falsely assume.
 

Offline dashpuppy

  • Regular Contributor
  • *
  • Posts: 87
  • Country: ca
    • http://www.dashpuppy.com
Re: How to switch a speaker on and off?
« Reply #23 on: September 26, 2019, 03:11:47 pm »
Did anything ever come of this ?
 

Offline Audioguru again

  • Regular Contributor
  • *
  • Posts: 115
  • Country: ca
Re: How to switch a speaker on and off?
« Reply #24 on: September 28, 2019, 05:05:20 pm »
A speaker makes a POP sound if it is switched at the peak of the signal. To avoid the POP then mute the signal, switch the speaker then unmute the signal. The mute and unmute must be ramps, not abrupt changes.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf