DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: DIY Dood on March 16, 2021, 03:26:04 PM

Title: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 16, 2021, 03:26:04 PM
Note: This is actually an automotive audio switching question, but I'm guessing a number of folks here have the expertise to advise me with. It's the same sort of stuff we do with stompboxes. The audio world is very short on this level of circuit building.

What I need to do is select stereo audio input from source 1 or source 2. Source input is pre-amp level, like Ipod or Iphone output. Probably close to max level. So I need top quality audio transfer.

The issue is that the switch that will do the switching is an SPST, not the DPDT that I need to do this with just a switch. (The switch is integrated into the automobile).

It was suggested that I could an audio switching IC, but I'm definitely unqualified to select one and design the circuit to implement it. I can read a schematic and build a board, but I'm not familiar enough with components to understand what's a good choice or bad.

Pointers to circuits or specific IC chips I could study the datasheets of ? Or other ideas?
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on March 16, 2021, 05:39:12 PM
DPDT 12VDC relay

(https://i.postimg.cc/DSSqgxSV/DPDT12-VDCrelay-42.gif) (https://postimg.cc/DSSqgxSV)
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: ElectricDruid on March 16, 2021, 07:30:52 PM
PRR is right. A relay is definitely simplest.

You *could* do it with audio switch ICs, but you'd probably need buffers and biasing, if it's running on 0-12V. All in all, a nuisance.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 16, 2021, 10:59:20 PM
I have some standard 12v auto type relays and I'm qualified with that component level. LOL.

But, I was assuming that having a 12 volt coil near an audio signal of the pre-amp level would be just asking for noise in a car. Not a concern? I can shield the relay... but the contacts will be next to the coil by definition.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on March 17, 2021, 01:19:01 AM
Audio has been switched by millions of relays (look in a 1920-1960 telephone exchange). Clean DC is "noiseless". The consumption of a small relay (50mA contacts) is so small that a 33r and 330uFd R-C filter will clean of spark-buzz and blunt dynamo spikes. If it were truly a problem, you get a 5V relay and multiple layers of R-C filtering and a LM7805 regulator.

Yes, there is a click when the relay pulls-in. But that is also the moment when polka is switched to salsa (or whatever you are switching to/from), so there has to be a discontinuity. And a generation of audio consoles (now lost) did relay switching without fuss or clack.

Don't use those big relays for fog-lights or A/C or that damm O2 bypasser in my car (when I hear it chatter I know I have to change the O2 bung). They take big control current which will spike audio, they are typically single-pole so you need two for stereo (double the current spike), and a 10A contact will stay clean with 1A-10A load current to burn tarnish but not with sub-mA audio current.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on March 17, 2021, 01:22:57 AM
Relay-switching is a darling of the high fidelity audio-world for volume and for source selection.
https://www.google.com/search?q=relay+volume+control&source=lnms&tbm=isch
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 17, 2021, 09:08:30 PM
Ah, I was thinking of using dpdt auto relays but they do pull some significant current.

Thanks for validating the approach. I understand relays.

So you're suggesting getting a PCB type relay and using that to do the switching? Do I need to get something that's runs 5v and step it down or can I use a 12v version?
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: iainpunk on March 18, 2021, 09:46:21 AM
QuoteDo I need to get something that's runs 5v and step it down or can I use a 12v version?
yes

cheers, Iain
edit:both do the trick, i'd personally go for the 5v step down version, because i already have 5v regulators and relays, but if you are going to buy new, i think its cheaper to get the 12v ones and not use a regulator.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: BJM on March 18, 2021, 10:19:08 AM
Quote from: ElectricDruid on March 16, 2021, 07:30:52 PM
PRR is right. A relay is definitely simplest.
Hi all,

Some time ago I looked at a relay bypass kit with which you needed a momentary switch. Stupid question maybe, but the switch in the car may not be momentary? Would that make a difference?

Gr,

Bert
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: vigilante397 on March 18, 2021, 10:52:18 AM
Quote from: BJM on March 18, 2021, 10:19:08 AM
Quote from: ElectricDruid on March 16, 2021, 07:30:52 PM
PRR is right. A relay is definitely simplest.
Hi all,

Some time ago I looked at a relay bypass kit with which you needed a momentary switch. Stupid question maybe, but the switch in the car may not be momentary? Would that make a difference?

Gr,

Bert

Momentary switch -> use a latching relay

Latching switch -> use a non-latching relay
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: BJM on March 18, 2021, 12:23:40 PM
Quote from: vigilante397 on March 18, 2021, 10:52:18 AM
Momentary switch -> use a latching relay

Latching switch -> use a non-latching relay

Thanks! Btw, do you make those Sushi Box pedals? They look great  :)
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: vigilante397 on March 18, 2021, 12:28:49 PM
Quote from: BJM on March 18, 2021, 12:23:40 PM
Thanks! Btw, do you make those Sushi Box pedals? They look great  :)

That's me, thanks! ;D
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: BJM on March 18, 2021, 03:16:12 PM
Quote from: vigilante397 on March 18, 2021, 12:28:49 PM
That's me, thanks! ;D
No thanks, you're welcome  :)
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 24, 2021, 08:46:02 PM
Following up on this: While searching for an appropriate relay, I decided to check Amazon (I have temp Prime membership, which makes them a better option that other vendors).

Found this module. Costs less than I would have spent for a relay and perf board... diode (bounce) protection included. Low current trigger, although that's somewhat irrelevant for my application.

It's all SMD now, in contrast to the photos. I would have preferred non-SMD, because I can work with old-school stuff, but it should do the job and I don't really need to play with the components. I just like options :- )

https://www.amazon.com/ELECTRONICS-SALON-Signal-Module-RY12W-K-Assembled/dp/B00LWX9PPA
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 27, 2021, 10:38:11 PM
Followup question:

This all works, but there's a thump when switching the inputs. I'm guessing there might be some way to buffer the audio lines with a capacitor or two? But I'd have no idea how to design that.

The circuit is below... mostly just a relay with a support circuit to allow the trigger to be lower voltage. The "input" is the switching line that's controlled by a latching switch.

Ideas?



(https://i.postimg.cc/K1CvsSjf/41k-Ou-B4-4-EL-1.jpg) (https://postimg.cc/K1CvsSjf)
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: CodeMonk on March 28, 2021, 12:55:00 AM
ElectricDruid brought up using IC's for switching, so here's a link: http://www.geofex.com/article_folders/cd4053/cd4053.htm

Just to let you know there are other options available.

A CD4053 is essentially a 3PDT switch in a chip.

I used a DPDT switch (one pole for an LED) as opposed to the other options listed to activate the IC.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on March 28, 2021, 02:02:57 AM
> there's a thump when switching

Usually means there is small stray DC on connections. On bass-shy guitar amps/pedals this is a "POP!". Try that search term here.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 28, 2021, 09:52:03 PM
Couldn't find any under "POP" or "stray DC"... aside from your post.

Do I just need a capacitor on each audio like to the amp to stop the DC? If so, I'd need cap-value guidance.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on March 28, 2021, 10:56:52 PM
Sorry. 3-letter words baffle the Search. Try "pop resistor".
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 29, 2021, 09:31:24 PM
Thanks, doing some reading on pop resistors.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: CodeMonk on March 30, 2021, 03:30:27 AM
"Pulldown resistor" is another search term you might want to try
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on March 30, 2021, 06:59:44 PM
Quote from: PRR on March 28, 2021, 10:56:52 PM
Sorry. 3-letter words baffle the Search. Try "pop resistor".

OK... studied a bit... from what I've learned (keep in mind I'm 'electronics light') it looks like the pop is usually from a typical circuit where DC can potentially mix with the AC signal. In my case, they should be totally isolated because the audio is switching through the relay.

Do you think I'm getting leakage through the switching circuit into the relay circuit? So should I be testing for DC voltage on the relay lines when they are disconnected from any input?

Or is the suggestion that the radio and "aux" input have their own issues and are putting DC on the lines from those devices and into the amp (common) output contacts? So perhaps I should try 1M pull down resistors on the audio inputs?
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: ElectricDruid on April 02, 2021, 05:10:32 PM
Unless the audio just happens to be at zero volts at the point you switch, there will be some voltage on the relay - after all, AC voltage spends very little of its time close to zero. And if the little metal springy contacts bounce at all (they probably do) then that voltage gets switched on and off rapidly with each bounce. That makes a pop.
I think expecting relays to be silent is a bit unrealistic. Some of them are quiet, but silent? Not really.

BTW, that's a completely different mechanism of making a pop than the usual thing you get in pedals, where you've got a bias voltage to avoid, although the fundamental problem of springy metal contacts remains.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on April 03, 2021, 06:21:50 PM
Quote from: ElectricDruid on April 02, 2021, 05:10:32 PM
Unless the audio just happens to be at zero volts at the point you switch, there will be some voltage on the relay - after all, AC voltage spends very little of its time close to zero. And if the little metal springy contacts bounce at all (they probably do) then that voltage gets switched on and off rapidly with each bounce. That makes a pop.
I think expecting relays to be silent is a bit unrealistic. Some of them are quiet, but silent? Not really.

BTW, that's a completely different mechanism of making a pop than the usual thing you get in pedals, where you've got a bias voltage to avoid, although the fundamental problem of springy metal contacts remains.

Yeah, understood...  So is there a mechanism by which I can discharge that voltage? Will the 1M resistor do it (on one side of the contact or the other)?
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: PRR on April 04, 2021, 01:56:27 AM
It's not a guitar. Radios, iPods, etc can drive a 10k resistor, and that will bleed more leakage.

Discussing it won't fix it. Just GET some medium resistors and try it.
Title: Re: Switching stereo audio inputs with an SPST? (IC?)
Post by: DIY Dood on April 05, 2021, 10:41:00 PM
Quote from: PRR on April 04, 2021, 01:56:27 AM
It's not a guitar. Radios, iPods, etc can drive a 10k resistor, and that will bleed more leakage.

Discussing it won't fix it. Just GET some medium resistors and try it.

Understood, I'm just unclear on where to start testing the values 10K? 1M?... and where I need the pull down. Do I place them on the common (output to amp) contacts or should they be sitting on the inbound side (the N/C & N/O contacts).