Electronics > Projects, Designs, and Technical Stuff

How to switch a speaker on and off?

<< < (4/5) > >>

Starlord:

--- Quote from: BillW50 on July 31, 2015, 07:54:10 am ---Sure it is possible.

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

--- End quote ---

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

Starlord:

--- Quote from: Chris C on July 31, 2015, 10:06:30 am ---
--- Quote from: Starlord on July 30, 2015, 11:29:28 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.
--- End quote ---

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. 

--- End quote ---

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.

--- End quote ---

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!
--- End quote ---

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?

mikerj:
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.

Starlord:
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.

--- End quote ---

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.

Pjotr:

--- Quote from: Starlord on July 31, 2015, 01:18:14 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.

--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod