Pages: [1]   Go Down
Author Topic: Audio switching  (Read 1482 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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). 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Sr. Member
****
Karma: 9
Posts: 296
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.   


* relay.gif (7.64 KB, 513x321 - viewed 23 times.)
« Last Edit: January 25, 2013, 12:45:54 pm by vasquo » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
Logged

Offline Offline
Sr. Member
****
Karma: 9
Posts: 296
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh yes, DIPs smiley-grin  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 smiley-grin
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1627
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 37
Posts: 1144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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........
Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 285
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the CD4066 I remember it was an excellent analog switch having several channles. Maybe its useful or give you some ideas.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8897
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 10
Posts: 285
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree, the CD4066 will prevent that "popping noise". I remember it was a very very simple and reliable device.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Offline Offline
Sr. Member
****
Karma: 9
Posts: 296
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Offline Offline
Edison Member
*
Karma: 56
Posts: 2140
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These are a possible solution:
http://www.fairchildsemi.com/ds/H1/H11F1M.pdf
http://www.digikey.com/product-detail/en/H11F1SR2M/H11F1SR2MTR-ND/1793947
Logged

Pages: [1]   Go Up
Jump to: