Building an AV switchbox - electronic or analogue switching?

Discussion in 'Modding and Hacking - Consoles and Electronics' started by MangledLeg, Jan 23, 2013.

  1. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    Hopefully this is the right spot to put this one!

    I've been thinking of building a custom switchbox to take care of the variety of stuff hooked up to my CRT. At the moment I'm using a Joytech switcher that's only designed to take 7 inputs, with each input having component, composite and s-video. I've murdered it a little by whacking on RCA splitters on the audio leads to double up most of the connections (therefore have a component video and s-video source hooked up to the same source; a couple have three inputs hooked up and I have a set of cable to hook up other systems ad-hoc, useful for my Twin since the controller cables are short, so I can hook it into the switcher while it sits on the coffee table), and since I only have one console on at a time, there aren't any issues to date.

    The problem I have is two-fold -- first up, I've well and truly exhausted the thing and it also lacks RGB switching which I can now take advantage through my RGB to Component transcoder. I've also noticed there is some colour smearing/imbalances on the component output (thus all component inputs are affected) and on a couple of the s-video inputs (on some inputs there is noise regardless of the source - moving the source to another input results in a noise-free image).

    I can't find an after-market machine at a reasonable price (well, a price I'm willing to pay :p), so I'm keen to build a dedicated box. The following are the specs:

    10 x composite video + stereo
    10 x S-video + stereo
    10 x component video + stereo (would like to add optical audio switching as well, but that's getting crazy!)
    10 x RGB + stereo (via SCART, with an option for RCA-based stereo)

    4 x discrete outputs for each family of inputs (useful for routing to the TV and my amp).

    Everything housed inside a single case (have an ATX tower I'll use)

    As it stands, I have the option of going for an analogue or an IC-based solution. My aim was to go analogue and have a nice big rotary switch to handle each family of inputs. The problems here are cost/availability of a rotary switch happy to handle all those signals as they're not cheap and I've had trouble sourcing suitable rotary switches when I've searched before, and my understanding is that it is very likely to get a lot of noise and cross-talk amongst devices, which would be a terrible outcome. The act of soldering everything is easily within my skills though, which is why I like this method. Since its passive, it also means no power is required and there should be a reduced likelihood of component failure.

    Option 2 is to use an IC-based solution, like the infamous piece demo'd on Engadget. The questions in this one are around the suitability of the CBT3244A for analogue video (particularly for component and RGB video) and if there are likely to be any issues with AV quality, such as noise or cross talk, with all those components. There's also the concern of IC failure, but I may be being paranoid since the IC-based Joytech switchbox has always had some issues (in comparison, my Yamaha AVRs have done a delightful job of switching sources over the years, so it's probably all about component quality :)). The only other concern is that I'm comfortable with a soldering iron and have performed stacks of mods over the years, but I'm no engineer and lack some of the skills to create something new to suit.

    Any thoughts or advice would be welcome. Would be happy to share pics and build progress with everyone as well so others can learn from my experiences building up this sucker!
     
  2. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    IMO passive switching is way too clumsy for that many inputs.

    Analog multiplexers ("IC solution") would work, but they're not perfectly linear and so introduce distortion, plus have a finite (often low) bandwidth; To get the best results you'd need to buffer each and every input and that would get expensive fast, plus it'd be kind of difficult to engineer. Or you could build an over-simplified Ben Heck circuit, but YMMV.

    The most straight forward and best quality solution for a hobby build will be reed relays. You can actuate the relays using microcontroller, or some simple digital logic (debounced switches + up-down binary/decade counter + 7-segment decoder or something for display, and a binary/decade decoder + discrete transistors to drive the relays). Done right the affect on the audio/video will be negligible.
     
    Last edited: Jan 23, 2013
  3. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    Calpis is right relays would be the best to keep a top notch image quality. However, you could do it benheck style with careful shielding and caution and it should be at least "good" as long as only one input is connected at a time.
     
  4. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    Thank you both so much for the feedback and suggestions! Was afraid of going for either solution I suggested to put all that effort in and see an average result... Ultimately it's not just the cost of components, but the time to put the whole thing together.

    With the relays option, do either of you have any sources I could use for inspiration? I'm a novice at engineering solutions but am handy with a soldering iron and wiring stuff up (have rewired a few arcade cabs over the years as well as countless console mods). If there are any examples I could use that either of you know about (or any keywords I should be using when searching, aside from "AV switch relay" or words to that effect, or other websites that might have some info), that would be awesome. In the meantime I'll start some research into what might be possible!
     
  5. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    Alright, just wanted to bump this to see if I'm on the right track.

    So, reed relays are electronically-activated mechanical switches. So, if I want to activate input 1 (say, composite AV), I have the composite in, left audio and right audio inputs going into a SPDT reed relay each (so three relays total), and when +5v is run through the relay coil the NO is activated and the signals flow through from the common pin to the output, which then goes to the TV/amp. When going through to input 2, the +5v is moved from the relays for input 1 to input 2, thereby moving the relay from input 1 to NC and the relay from input 2 to NO.

    In order to protect whatever device is controlling the flow of current, a diode is fitted to the circuit activating each respective relay to keep the +5v going the other way and unintentionally damaging something.

    So this leave a couple of gaps in my understanding, but the next question I have is how to create the logic to change inputs, or how to cycle through the inputs. On my Joytech switch you press a button to cycle through the 7 inputs and it cycles in order of 1-7 forwards, not backwards. So I'm guessing a a basic level, I need to have something fitted so that each time a button (micro switch?) is pressed, the +5v travels from one set of relays to the next for a total of 40 inputs, or if that's not possible, a switch for each family of inputs (I.e. RGB, composite, s-video, component), and it will cycle back in a loop once it has reached the final input source.

    At least at this stage, do either of you have any advice on what ICs I should be looking at to get to this point? In the above I've only looked at using a single button to cycle in a single direction, but it would be even better if it could be bidirectional (I.e. moving forwards and backwards amongst all the inputs).

    Once I've got this determined, the next step would be to use counters and a seven segment decoder or similar for the display. If that gets too tricky for me, I guess I could always add an LED to each set of relays that lights up when the input is active.

    Hopefully the above makes some sense!!
     
  6. RetroSwim

    RetroSwim <B>Site Supporter 2013</B><BR><B>Site Supporter 20

    Joined:
    Dec 10, 2012
    Messages:
    605
    Likes Received:
    26
    There are a number of ways... If you want something like your Joytech switch, a 4017B decade counter IC would do the trick.

    The current draw of 3 or more relay coils (e.g. Composite, Left, Right) would toast the logic outputs of such an IC though, so you would use NPN transistors as switches to trigger the relays. http://www.kpsec.freeuk.com/trancirc.htm

    I'm building a switch soon, based on the Ben Heck design, using 74CBT3244 bus switch chips and an AVR micro to select inputs and run a character LCD for added swish. :) I was going to use relays, but that was going to get expensive for 12 RGB inputs.
     
    Last edited: Jan 27, 2013
  7. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    Cool, thanks for the details!

    So, I can use 4 (or would it be 5?) 4017B decade counter ICs chained together to go through the various inputs? Mind, since each IC can fire +5v to 10 outputs, might be just as easy to use 1 of them per input family. Makes it faster to scroll through them as well.

    Thanks for the details on the NPN transistors - I saw that in a couple of things I was reading and watching when learning about relays, but didn't realise what they actually did. So with the transistor in mind, the +5v is fired through via a single NPN transistor to each cluster of relays, or do you set it up as 1 transistor per relay? The latter is what I think would be best practice given the diagrams I've seen with protection diodes (which are still needed with the NPN transistor), so it's safe to say that, for each input signal (composite video, Y, C, R, G, B, etc) I will need to have a +5v >> NPN transistor >> Relay (with protection diode), with the input coming in via the common pin and out via NO as the +5v activates the relay and switches on the mechanical SPDT switch inside the relay. The +5v is sent to the relay via the 4017B IC that uses a micro switch to clock through each output (0, 1, 2, 3, etc).

    So, assuming I'm on the right path, are there any additional components required on the signal inputs/outputs (composite video, audio-L, etc) to ensure quality remains solid?

    And finally, what kind of relays should I be using assuming we're working on +5v to switch the relay (I figured +5v would be handy since a 9v DC power supply should do the job if running it through a 7805 voltage regulator, and I have a couple lying around) and I'm keen to keep the quality up? Will I also need to add in any RF shielding around the ICs and relays to prevent noise affecting the video sources? The whole thing will be housed within an old ATX case I have lying around.

    BTW RetroSwim, will be keen to see how your switch tuns out - sounds like an awesome RGB switching beast!
     
    Last edited: Jan 27, 2013
  8. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Don't chain SPDT, just use SPST and put them all in parallel. Each decoder output can drive one transistor which then drives as many relays as necessary for the connection (3 for composite, 4 for S-video, 5/6 for component and RGB).
    For your specs you're looking at 180 relays. Something like this.
     
  9. RetroSwim

    RetroSwim <B>Site Supporter 2013</B><BR><B>Site Supporter 20

    Joined:
    Dec 10, 2012
    Messages:
    605
    Likes Received:
    26
    What he said! :)

    [​IMG]

    The resistor value is based on a little calculation, which is listed on the page I linked earlier. It won't be 1K, as shown on my diagram.
     
  10. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    If you put the coils in series they won't get enough current.The ones I linked specify 12V/1000 ohms == 12 mA apeice, so unless you have a 72 V supply they must be put in parallel.

    Also the enable signal should be coming from an active high decoder, not from the counter directly or multiple inputs will be enabled at once. You could flip it around and use standard active-low decoders and PNP transistors, but it becomes an issue interfacing with the 3-5V logic so you'd use 2 transistors/relay set.
     
    Last edited: Jan 28, 2013
  11. RetroSwim

    RetroSwim <B>Site Supporter 2013</B><BR><B>Site Supporter 20

    Joined:
    Dec 10, 2012
    Messages:
    605
    Likes Received:
    26
    Blagh. Why did I think that would work.

    [​IMG]

    4017B is a logic high counter, it has internal NOTs on the outputs. http://www.ti.com/lit/ds/symlink/cd4017b.pdf (That's why you use them to make Knight Rider scanners. :cool-new:)
     
    Last edited: Jan 28, 2013
  12. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    Awesome stuff guys, really appreciate the help!!! The updated circuit makes sense and the SPST relays look like they'd do the job, and the pricing per unit at 180 makes things pretty reasonable if the quality is solid.

    So, in terms of keeping the signals in good shape, is there anything I should keep in mind when wiring things up? Shielding and stuff? I was thinking of using shielded copper for all of the wires with GND connected at either end, is this overkill? The other question is if I would need to add anything to shield the PCB housing all the relays?
     
  13. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Group the relays together by the output jack so there should be 18 groups, each with 10 relays. The output pin construction should be very tight, you don't want a lot of loose wire which both picks up noise and adds parasitic elements which is bad.

    Other than that it takes a significant amount of engineering to get better signal quality which will probably go unnoticed (a custom impedance-controlled PCB, input termination and 75 ohm friendly relays or analog multiplexers, level shifters, input and output amplifiers).
     
  14. bacteria

    bacteria I am the Bacman

    Joined:
    Apr 8, 2008
    Messages:
    978
    Likes Received:
    61
    Electronics method of course will be ideal, if you know what you're doing on electronics.

    I don't, so made my own bank of switches, 32 rows of 9 connections (actually, 16 sets of 18 connections as one of my systems needs up to 18 connections to work).

    [​IMG]

    Did this for my Project Unity (which is about 80% complete now), yes, it's a large bank of switches, however using a computer case as you intend to would not be an issue for my solution (it is 43 cms approx wide), so a bank of 40 x 10 which is what you're after would end up about 50 cms approx, or less if you made it with thinner wood strips.

    Yes, my method is large, yes better with electronics methods, etc; HOWEVER, I can have any/all connections a few amps each if I want to, and being mechanical is easy to know if it works or not (you don't have to follow a diagram to see if one path is set or not, and also not have to worry about trigger voltages to get a circuit to work or not work, mechanical is on or off, simple) - and I can add, i've used my switch unit quite a lot over the months and it works every time.

    Just an alternative suggestion; not for everyone but hey, it works and is reliable, what else matters? ;o)
     
  15. RetroSwim

    RetroSwim <B>Site Supporter 2013</B><BR><B>Site Supporter 20

    Joined:
    Dec 10, 2012
    Messages:
    605
    Likes Received:
    26
    Oh man, that is soooo ghetto, I love it!!! :D
     
  16. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    I bet that is one of those things that violates 80% of all apartment leases.
     
  17. MangledLeg

    MangledLeg Peppy Member

    Joined:
    Jul 11, 2010
    Messages:
    353
    Likes Received:
    4
    @Calpis: Awesome, thanks for that. I was originally looking at having the relays mounted close to each socket and then hitting the output bus from there (so therefore long lines from the relay outputs to the output sockets), but I could cluster the relays at the end of the bay where the output RCAs are and run double-insulated/shielded copper from the RCA input sockets to that point, which then puts the output from the relays super-close to the output sockets, which I believe is what you're suggesting to reduce noise along the outputs.

    Since everything will be mounted in an ATX case, I was thinking of running DC GND from the power supply socket to the case to ground everything which would, in theory I guess, would also help keep things noise-free... Although that may be an issue if the GND off the power supply is wonky??

    I'm probably just overthinking it!! Figured that if it was an opportunity to utilise the GND to help improve things it'd be worth a shot!

    @Bacteria: I remember following you ghetto switch project, it's so awesome :)

    Edit: I've had a look at cables for running between the RCA sockets to the relays and am looking at Belden 1694A in various colours for the video signals (including on the RGB from the SCART sockets) and Belden 82761 for audio. Any thoughts if this is good or any recommendations on where to pickup? Found a few sites stocking them, but if someone can recommend anywhere that will post to Australia, I'll keep it in mind when I start shopping for gear.

    Oh, last question on the 4017B - for trigger the input, would it suffice for the clock input to have +5v sent to the clock to get it to switch inputs:

    +5v >> Momentary-on micro switch >> clock input on 4017B.

    If not, what's the best method for a momentary on micro switch/button to get it to scroll through its 10 outputs.
     
    Last edited: Jan 30, 2013
  18. bacteria

    bacteria I am the Bacman

    Joined:
    Apr 8, 2008
    Messages:
    978
    Likes Received:
    61
    Thanks, took me several remakes to get the final configuration; as mentioned, it is reliable, is manual, and if needs any repairs, is easy to do so (strip a piece of wire, and superglue in place) - not had to do that though, works reliably. As mentioned, puritans will certainly think a manual method is inferior for sure, but when you consider the benefits, it makes a lot of sense - no electronics to add to the system, no logic gates that may or may not work, no reliance on voltages and tolerances - different consoles output these differently, so an IC method may not be good in practice BTW), and no issues with amperages being too low; also, no headscratching when something works sometimes and not other times - manual is "on" or "off" so easy to troubleshoot.
     
  19. RetroSwim

    RetroSwim <B>Site Supporter 2013</B><BR><B>Site Supporter 20

    Joined:
    Dec 10, 2012
    Messages:
    605
    Likes Received:
    26
    That's the way to do it.

    Good call using a microswitch. They have a positive action, so you should be able to get away with not using a de-bouncing circuit.
     
    Last edited: Jan 30, 2013
  20. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    I don't think there's a switch in existence that you don't have to debounce. (For typical logic families.)
     
    Last edited: Jan 30, 2013
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page