Go Down

Topic: Audio switching (Read 2508 times) previous topic - next topic

cowasaki

I need to switch multiple audio signals to multiple locations ie (A to B), (A to C) or (A to B & C) plus (D to E), (D to F) or (D to E & F) so basically multiple inputs which get switched to either 1 of 2 outputs, neither or both.

Just wondering what technique people would use to do this.....  The actual switching logic is a high pin from the arduino, a low pin would be off so basically A comes in and if pin 10 is high it goes to B and if pin 11 is high it also goes to C, either being low will turn that output off.  I would prefer to keep the audio signals isolated from the data board so would prefer not to connect the audio ground to the data board's ground and then switch the signal pins using transistors but would this be best?  What do people think.....  This is effectively like a computerised source switch for an amplifier.

The actual signal is an audio signal either un-amplified, line level or headphone level (I will not know before hand). 

kapelan

something like moc3041:
http://kubuntu.free.fr/wiki/data/fp/moc3041.pdf

cowasaki

Not really, we are talking a hifi audio level signal.

vasquo

#3
Jan 25, 2013, 06:42 pm Last Edit: Jan 25, 2013, 06:45 pm by vasquo Reason: 1
Quote
I would prefer to keep the audio signals isolated from the data board so would prefer not to connect the audio ground to the data board's ground and then switch the signal pins using transistors but would this be best?  What do people think.....  This is effectively like a computerised source switch for an amplifier.


I would use DPDT relays.  (If you're switching unbalanced audio, or a 4PDT relay if you're switching balanced audio).  The relay will be switching both the signal and the audio GND lines, and in no way will connect to your digital circuit's GND.  

The relays will be controlled via logic level mosfets/or transistors, which turns on/off the individual relays.

You'll need a LOT of relays to do this, and increases as you have more inputs and outputs.

a 2x2 matrix, you'll need 4 relays (and 4 control signals)
a 2x3 matrix, you'll need 6 relays (and 6 control signals).
a 3x3 matrix, you'll need 9 relays (and 9 control signals).
etc...

You'll run out of AVR pins, so you'd probably want to use some external logic ICs to save some pins)

EDIT: This is just a diagram for one channel. So for stereo, you'd need another matrix board. 
The "black lines" in this diagram represents both the audio signal and ground wire. X represents the DPDT relays.

Using this scheme, you can send IN1 to any combination or all of OUTA, OUTB, OUTC.   

cowasaki

Input A only goes to B and/or C OR none
Input B only goes to D and/or E OR none
Input C only goes to F and/or G OR none....

Each line could be handled by 2 relays but solid state relays are not cheap and mechanical ones are expensive so looking for electronic suggestion really....

vasquo

Quote
Input A only goes to B and/or C OR none
Input B only goes to D and/or E OR none
Input C only goes to F and/or G OR none....

You can build this logic in your program. That's not a big deal.

Quote
Each line could be handled by 2 relays but solid state relays are not cheap and mechanical ones are expensive so looking for electronic suggestion really....

If your want your audio ground separated from your digital ground, you have no choice but to use relays.  Also don't forget about ON resistances, and tolerances of ON resistances of each part. Otherwise, you'll end up with your left channel being weaker or stronger than your right channel.

You can buy DPDT DIP relays (small signal) for $2.60 in 100 qtys. Pretty cheap.
ON Resistance of these relays are also in the milliohm range, suitable even for use with phono or mic-level signals.

cowasaki

Oh yes, DIPs :D  I had totally forgotten about them.  I have a few in my parts collection, could well be the answer!

I hadn't realised that we have an AUDIO section so posted this in the wrong one....  If a mod sees this can they please move it, I can't report my own posts :D

pwillard

if you can still find one... the CD22100 would work.

http://www.datasheetcatalog.org/datasheets/105/108401_DS.pdf

These are so unique, I have had some in my collection for ages.

SirNickity

The relay will be switching both the signal and the audio GND lines


Nope.  Leave the grounds connected please.  :-)  You don't have to join the digital and audio grounds if you're using relays, but don't switch both legs of the input signal.  There's no good reason to isolate them, and in fact they probably won't be isolated anyway if the input jacks have any common grounds, plus it can cause switching noise if the relays really are the only ground junction.

I've done a little research into solid-state digitally-controlled analog switches and potentiometers.  If you want to look at non-relay options, I can try to find some of my notes.  I haven't actually tried any of them in a circuit, but I did look for good reviews on DIYAudio, etc.  Although, with only two channels to switch to four outputs, relays might be the path of least resistance.  If you have more than that, going SS becomes more attractive.

cowasaki

Its going to be 4 channels to 8 outputs in total. 

My next challenge is a pot for levels that can be adjusted by hand or the arduino can adjust it..... So basically a voltage controlled pot........

arduinoadrian

Check the CD4066 I remember it was an excellent analog switch having several channles. Maybe its useful or give you some ideas.
Perseverance is 90% of the solution. The remaining 10% is more perseverance.

zoomkat

Using relays often introduces a noticable "pop" into the audio stream. You might googgle for audio multiplex to see what products are already available. The analog multiplexing chips would be worth looking into.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

arduinoadrian

I agree, the CD4066 will prevent that "popping noise". I remember it was a very very simple and reliable device.
Perseverance is 90% of the solution. The remaining 10% is more perseverance.

vasquo

As they say, engineering is a game of compromise.  Pick your poison.

Yes, with relays, there could be ticks/pops depending on how large the waveform you're switching (and at what point in the waveform you're doing the switching.)  The same could also happen in switched gain controls.  -- for switches, one can use a make-before-break switches  -- but these are usually special order items and a bit more expensive than the normal break-before-make switches.

The other option is adding a zero-crossing detector (which is what chips like the PGAxxxx series do), they only switch when the waveform is a few millivolts above/below the zero level. It's not perfect, but minimizes zipper/tick/pop noise.

Of course, one can look for analog multiplexers with built-in ZCD... but then again you compromise on the high Ron resistances, variability/tolerances  between parts, and the low analog headroom (13dBu theoretical max., ideal case for +/-5V supply)

LarryD

These are a possible solution:
http://www.fairchildsemi.com/ds/H1/H11F1M.pdf
http://www.digikey.com/product-detail/en/H11F1SR2M/H11F1SR2MTR-ND/1793947
The way you have it in your schematic isn't the same as how you have it wired up!

Go Up