Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 15th October 2007, 02:33 AM   #1
diyAudio Member
 
Join Date: Mar 2007
Default Signal Detecting Source Selector

I set out to design an SPDIF signal detector/selector using an analog mux as the switching element. Little did I know that the project was going to morph into an audio signal detector/selector using relays.

The unique feature of this project is that I've utilised a small microcontroller to detect whether a signal is present on each of the 4 inputs. It works by using the builtin ADC to sample each channel at the maximum rate for a short time (100ms) and determining how many samples are above a threshold given in the firmware. If the number of samples is high enough, the signal is deemed to be on. Otherwise, this is similar to many of the other source selector projects out there.

I've breadboarded the detection part of the circuit and written the detection firmware, and it works well, reliably detecting when a source is playing. I'll build in some delay so that e.g. track changes don't cause the indicators to go out. The status of the inputs will not affect the selected input, so when a signal goes away that input will stay latched until it's changed. I'll need to do some tweaking to figure out how sensitive it will be to quiet passages, and EMI for floating inputs.

Output uses an 8-bit I2C expander to drive 4 sets of two LEDs (or 4 bipolar dual colour LEDs, which is my preference) to show signal presence and signal selected status, a 2-bit address (for the relay board interface) and an enable (active LOW) signal. The I2C signals are also available for a possible future slave mode to be read/written by a master controller.

Input is a single pushbutton that switches to the next active source. If all signal sources go away, the previously selected one will remain selected until the button is pressed again, which will disable all inputs. Unfortunately this state will leave the output floating with my relay board, but I don't have a better solution without putting junk in the signal path.

I would appreciate any comments. Please take a look at the board layout/schematic PDFs:

http://www.gotroot.ca/~ktims/dump/au...20selector.pdf
http://www.gotroot.ca/~ktims/dump/relay%20board.pdf

And the BOM:
http://spreadsheets.google.com/pub?k...j8i98ZqCAN4qbw
  Reply With Quote
Old 15th October 2007, 03:30 PM   #2
rossl is offline rossl  United States
diyAudio Member
 
rossl's Avatar
 
Join Date: Nov 2004
Location: Central Ohio
What are the inputs you are switching? Toslink receivers? Coax or AES?
  Reply With Quote
Old 15th October 2007, 04:32 PM   #3
diyAudio Member
 
Join Date: Mar 2007
Quote:
Originally posted by rossl
What are the inputs you are switching? Toslink receivers? Coax or AES?
I changed the scope of the project from switching digital to analog signals. It's just intended for switching line outs for now. Maybe this belongs in the analog forum? There's not really a good category for this type of project...most of the meat of it is in the digital domain so that's where I put it.

I may build a module that would replace the relay board with an analog mux and the hardware to switch SPDIF/AES signals, but for now I don't need this and would be able to make more use of the analog switching. This system *should* work with SPDIF as well when I have a need for it, at least the detection side should be fine. The relay board isn't the best approach for the SPDIF signals, but I think the layout and relays are good enough that it will work.
  Reply With Quote
Old 15th October 2007, 09:45 PM   #4
rossl is offline rossl  United States
diyAudio Member
 
rossl's Avatar
 
Join Date: Nov 2004
Location: Central Ohio
OK, your schematic makes more sense now. I am still concerned that your relays ground the input signals when the channel is off.

It would be better to terminate the "off" inputs with resistors instead of grounding. If the analog source drivers see a 600 ohm resistor switched in by the relay, they will not drive very much current if there is an output voltage.

For digital, you would want to terminate coax with 75 ohm and AES with 110 ohm. Shorting to ground could damage the output circuit of the source.
  Reply With Quote
Old 15th October 2007, 10:33 PM   #5
diyAudio Member
 
Join Date: Mar 2007
Quote:
Originally posted by rossl
OK, your schematic makes more sense now. I am still concerned that your relays ground the input signals when the channel is off.

It would be better to terminate the "off" inputs with resistors instead of grounding. If the analog source drivers see a 600 ohm resistor switched in by the relay, they will not drive very much current if there is an output voltage.

For digital, you would want to terminate coax with 75 ohm and AES with 110 ohm. Shorting to ground could damage the output circuit of the source.
You're right of course, thanks for the heads up. Originally I had planned to leave the unused inputs floating, but I didn't really like the idea. I made some updates late last night and at the time I was playing with grounding them instead - I don't like that idea either, but it made it into the PDFs I uploaded...oops. I've added the terminating resistors in my working copy.

The terminating resistor seems to solve both problems. 10K seems to be an average input impedance, why would I want to use something smaller? Wouldn't this potentially increase crosstalk by increasing the current flowing in the unused circuits? Or is the goal to force the signal as close to ground as possible without causing damage...
  Reply With Quote
Old 15th October 2007, 10:38 PM   #6
rossl is offline rossl  United States
diyAudio Member
 
rossl's Avatar
 
Join Date: Nov 2004
Location: Central Ohio
10K will work fine. You could probably use either 10K or 600 and not notice the difference.

  Reply With Quote
Old 15th October 2007, 11:33 PM   #7
diyAudio Member
 
Join Date: Mar 2007
I've updated the relay board PDF to include my changes. Some parts shuffling was required to fit the resistors, but nothing too serious, and I've still managed to keep active analog signals from crossing or being so close there's no ground between them. I made another minor change as well; the unused side of the decoder no longer has enable asserted - not that it matters much. The digital signals are all static so there shouldn't be any interference from there; and I've kept them away from the analog where possible anyway.

The one thing I'm not happy with is the position of R1, but the only solution I can find is to move all the components except U4 north, but I like that idea even less than having this one part hanging off to the side because of what it does to the input connectors (or symmetry, take your pick).
  Reply With Quote
Old 15th October 2007, 11:45 PM   #8
rossl is offline rossl  United States
diyAudio Member
 
rossl's Avatar
 
Join Date: Nov 2004
Location: Central Ohio
I think you only need 4 resistors on the relay board...

On an "off channel", the signal path from pin 3 of a connector goes through a relay contact, through a single resistor to the other relay contact, and back to pin 1 of the connector.

With the 2 resistors to ground in each channel, you will get current in the ground traces.

With one resistor terminating, all the current returns back to the source. This way, there is no crosstalk or current in the ground trace.
  Reply With Quote
Old 15th October 2007, 11:57 PM   #9
diyAudio Member
 
Join Date: Mar 2007
Quote:
Originally posted by rossl
I think you only need 4 resistors on the relay board...

On an "off channel", the signal path from pin 3 of a connector goes through a relay contact, through a single resistor to the other relay contact, and back to pin 1 of the connector.

With the 2 resistors to ground in each channel, you will get current in the ground traces.

With one resistor terminating, all the current returns back to the source. This way, there is no crosstalk or current in the ground trace.
I'm not sure what you mean. If I were switching ground and keeping it isolated from the control circuit I see how that'd work (connect the signal to the source's ground), but the two poles on the relays are L and R signal, so I don't think that will work - but I could be wrong, I can see how it might work, but I'd be confused as to the benefit of connecting it so that the larger (L-R) is, the larger the current flow is. As it is in the current layout, each signal is terminated to its ground (since they're all connected together, this is just local ground). Am I missing something?

The grounds on all sources are necessarily connected together so that the detection circuit can work. I tried to come up with a scheme to isolate them and alleviate potential grounding issues, but I wasn't successful. All the schemes I came up with were a fairly difficult load for the source, and I don't want to load the source appreciably more than if it were directly connected to the amp. I made the concession of spec'ing 1M input resistors for this reason (though I will probably try 100K, and even lower should be okay with all of my gear), which hurts the ADC performance pretty seriously due to the sample and hold input.
  Reply With Quote
Old 16th October 2007, 12:48 AM   #10
rossl is offline rossl  United States
diyAudio Member
 
rossl's Avatar
 
Join Date: Nov 2004
Location: Central Ohio
OK I get it now. You aren't switching the grounds.

I wouldn't do it that way, I think you will get unwanted currents in the ground traces.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WTB source selector switch limono Swap Meet 1 23rd April 2009 07:47 PM
Relays for Source Selector SRMcGee Everything Else 1 9th November 2008 10:02 PM
source selector mnr102 Multi-Way 0 24th February 2008 11:11 PM
twisted pair signal, source selector and ground buss??? cbutterworth Tubes / Valves 2 30th March 2007 07:39 AM
Here's a source selector DragonMaster Everything Else 0 7th August 2005 03:52 AM


New To Site? Need Help?

All times are GMT. The time now is 04:44 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2