For this project's example we'll be building a 3 input, single output composite video, left / right audio switcher. This will allow us to, say, switch between SNES, NES, and the God of War II adapter (aka PS2) using the single input on the back of the TV. Quality. We'll also explain how to wire up a VGA or S-Video port as well.
Here's the electronics we'll need to build this project. Quantities are noted as they will vary depending on how many inputs we want.
Bus switch - Digi-Key part # 568-3619-5-ND. We'll need one of these for every input you wish to have. They're pretty cheap, about 56 cents each.
10k resistors - Digi-Key part # 10KQBK-ND. We'll need one of these for every input.
1k resistor - Digi-Key part # 1.0KQBK-ND. Just need one of these.
Pushbutton on/off switch - Digi-Key part # 519PB-ND, Radio Shack catalog # 275-1565. We'll need one per input. Any switch that can stay on or off will work, these are a couple good choices. The Digi-Key model is much cheaper of course.
7805 voltage regulator - Digi-Key part # 497-1443-5-ND, Radio Shack catalog # 276-1770. Converts the voltage from the power supply down to 5 volts for the circuitry. We just need one.
Heat Sink - Digi-Key part # 294-1108-ND, Radio Shack catalog # 276-1368. Sucks excess heat off the 7805 regulator. You can use a chunk of scrap aluminum if you wish, even a PC's expansion slot cover with a hole drilled in it, as this project isn't going to generate much heat. Again, just one is needed.
Project box - Radio Shack catalog # 270-1805. We grabbed a large one so we could add more ports in later on if we wish. Any plastic box will work, go nuts and be creative. I'll let you guess how many are needed.
Here's the Digi-Key part numbers of any jacks you might need. Get as many as you plan to use for inputs and the output.
Yellow RCA jacks - CP-1415-ND
Red RCA phono jacks - CP-1413-ND
White RCA phono jacks - CP-1414-ND
Blue RCA phono jacks - CP-1416-ND
Green RCA phono jacks - CP-1417-ND
S-Video jacks - CP-2440-ND (also called a mini-din)
VGA jacks - 215FE-ND (also called a d-sub 15)
Other things you'll need:
Thin wire - Such as ATA-33 hard drive wire. To connect the bus switches.
Low wattage soldering iron
Solder - As usual we suggest the thinnest stuff you can find.
An old wall-wart DC power supply - These usually range from 5-15 volts, 9 is very common. Any old supply should work, such as from a Zip drive, game console, cell phone adapters. Look for "DC output" on the label, as well as a mA rating of at least 200. This relates to how much current it can supply. You can also power this project with batteries if you wish, for whatever reason.
Power switch - For the entire switch box, "main power" you could say. Any small switch will work, or you can skip it and have the switcher be always-on.
Don't miss the bus
This project works using bus switch IC's (integrated circuits or "chips"), in this case, 8-bit switches. Each switch has 8 inputs and 8 outputs, actually arranged as a pair of 4's that can be switched on or off separately. By connecting multiple bus switches together and putting all of the outputs on the same line (or bus) we can build a multi-input, single-output switcher.
The term "bus" refers to a group of signals, typically in a computer, that carry data. For instance, in a 8-bit computer like the Commodore 64 the data bus consists of 8 traces that interconnect most everything on the board. For our project the bus will connect to all of the outputs of the bus switches and the output jacks. Each set of input jacks is connected to, get this, the inputs of a bus switch. Thus, whichever bus switch is enabled, that's the signal that gets outputted to the main bus and to the output jacks.
Wiring the bus switches
Here's the trickiest part of the project. Like most ICs these days, the bus switches are surface mount and thus are harder to solder manually than the DIP sockets from the olden days. We covered soldering like this back in How-To: consolize an arcade PCB but here's a recap:
The 20 pin bus switch integrated circuits
As with many of our How-To projects, making your own circuit board can be a big help. Now let's talk about how this bus switch works.
- Clamp the IC in something to hold it steady, such as a "Helping Hands" or vice.
- Put a very small amount of solder on each pin to prep it for the wires.
- Cut 2 sections of 8 wires each from the ribbon cable and strip a small bit of plastic off the ends.
- Tin a small bit of solder onto each exposed wire.
- Hold each wire to each pin and heat it to connect the pre-soldered parts together. For best results, start on the center wires and work your way out.
How to wire the bus switch in many different ways
Above is a drawing of the bus switch, with the pins relabeled to make them a bit more clear. There are actually 2 switches in this IC, labeled here as A and B. When the Enable pin (A or B) is pulled LOW (connected to GND) the appropriate inputs are connected to the outputs, ie, Input A-1 connects to Output A-1 and so forth. The line above "Enable" in the drawing means it is active low (activated when pulled low) When the enable pin is HIGH (connected to +5 volts) the inputs and outputs are disconnected.
Thus, one of these IC's could act as (2) 4 signal switches, such as composite and left and right audio, or S-Video (luma and chroma) and left and right audio. To use the switch with all 8 lines at once, simply wire Enable A and B together so they are both activated at the same time.
When a switch is turned off (or open, not engaged) the output pins are at high impedance, which basically means they're neither on nor off and won't affect whatever else is on the bus. This is what allows us to use multiple bus switches on the same bus and is similar to how a computer memory map works.
The following examples will show how the bus switch can be wired for a variety of video input types. We'll talk about hooking multiple bus switches together and the rest of the wiring (such as power, ground and the enable switches) later on. In every example "Bus Out" refers to the signals / pins that will connect to the main output jacks on your video switcher. So no matter how many inputs you have, all the Bus Out signals go to the same place. (That's why it's called a bus, and you're probably already sick of the word.)
This illustrates how to hook up two inputs, consisting of S-Video (Chroma and Luma) and stereo audio, to the IC with 1 ouput. The Bus Outputs (colored green) are connected together, this is because they are both on the output bus to the output jacks. To connect another 2 inputs, we'd simply use another bus switch and attach its bus outputs to the same place. All the bus outputs end up at the output jacks.
Note how the bus outputs are at opposite sides of the chip, thus they can be easily interconnected using a thin piece of wire between them under the IC.
Here's a slight variation of the first design, this time just using composite video (single wire). Note how some of the pins are unused since we're only using 3 inputs this time.
Above is a drawing of how you'd wire a component video signal, the kind with the red, green and blue cables, like a DVD player or Xbox 360. Note how we've only used 5 of the inputs so 3 go unused. Since we're using five inputs we can no longer "split" the IC -- it can only function as one input switch. Thus, both the ENABLE pins would be connected so the pair of 4-bit inputs switch on and off together. In this configuration each input will require its own super-elaborate 56 cent bus switch IC.
Why, here's a wiring diagram for VGA + stereo audio even! This one uses 7 signals so as with the last, you'll need to connect the ENABLES together and use one bus switch IC per input. Later on in this How-To we'll provide pinouts for the VGA adapter, in case you need them. You could even use one of the signals for a S/PDIF digital audio signal.
Building a switch box
Alright now that we've described how the bus switches are wired let's put together a switch box.
Here's the project box we're using for this example. It's a bit big but gives us plenty of room to work with and we can put more jacks and switches in it later on if we choose.
First we drill out some holes for the output jacks. We put ours on the end to set them apart from the input jacks. A 3/8-inch bit will make the correct sized holes for an RCA phono jack.
Secure the jacks in place with the metal ring and the nut - it's best to clasp the nut with pliers and twist the jack as tight as possible on the outside so it won't wiggle loose over time. Use some bits of wire to solder all of the jacks grounds together (the outer shell, the metal ring part) and attach a single long wire as well. This will connect to the power supply when we get to that point.
Install as many input jacks as you'd like the same way you installed the output jacks, we put ours on the top of the box. Drill holes for the switches as well. For the type of switches listed in "Parts" we drilled 2 small holes for the leads to go into the box and then glued the switch to the surface of the case. If you use a larger Radio Shack style pushbutton you'll need a bigger hole, around 1/2-inch. Make some small holes (3/16-inch works well) next to the pushbuttons for the indicator LEDs. More on wiring those in a bit...
The installed input jacks, from the inside. Plus the IC is hanging out there on the right, ready for action.
Now let's do some wiring on the input jacks, as well as the switches and LED's.
Here's what all this does: 5 volts runs through the 1k resistor and into the positive terminal of each LED. (We use a resistor to avoid buring out the LED). 5 volts also runs through the 10k resistors and into the negative terminal of each LED, thus it doesn't light. It's off.When you click down a switch, the enable terminal gets connected to ground or is "pulled low" as mentioned during the wiring section. This puts ground into the negative terminal of the LED, thus it lights. The ground also goes into the enable pin of the IC (which, as mentioned above, will be connected to the enable terminal) and activates that switch.The 10k resistor is used as a pull-up resistor, which keeps the terminal high (+5 volts) until it's pulled low by the switch, and the resistor itself keeps the ground from having a direct path back to the +5 volts, which of course, in the words of Egon Spengler, "would be bad".
- Wire all of the input jacks grounds together. (Same for S-Video or VGA if you're using those.)
- Wire one terminal of each pushbutton switch to ground.
- On the left we see a spot called "+5". This is where the input voltage will be connected and we'll branch several things off it.
- Connect a 10k resistor between +5 and the unused terminal of each switch (this will become the "enable terminal"). The enable terminal connection is what we'll hook up to the enable pin of the bus switch to activate each input.
- Install your 3 LEDs (we used random junk ones we had laying around) and connect all of their positive (long) leads together. Connect a 1K resistor between this and +5 volts.
- Connect the ground lead of each LED to its corresponding Enable Terminal.
Here's what the switcher should look like thus far.
Next let's put in a power supply, using as cheap of parts as possible. As mentioned in the parts list you can use pretty much any old wall-wart DC power supply. Some, such as those for cell phones, output between 3.3 and 5 volts and thus you won't need a 7805 regulator as the power is already within the range of what the bus switch IC needs. However most adapters output at least 9 volts (even those labeled as outputting less) so you should always test the wires with a multimeter first to find the voltage.
Cut a small hole in the box for your power switch. I'm using a slide switch from a Super Nintendo, but any small switch will do.
The knotted power cord and the switch, which is of course secured with hot glue. Stock market tip -- build a time machine, go back to before we were born and put everything you've got into hot glue.
Drill another hole and bring your power supply wires through and tie a knot so they can't slip back out. This also keeps the connecting from being torn loose if, perhaps, you trip over the cord while jumping out of the way of an errant Wii-mote. Using a multimeter, find the polarity of the wires. Connect the positive wire to a terminal on the switch.
- Screw the 7805 regulator to your heat sink and put it in the box however you see fit. The bus switches don't take that much power so there's not going to be much of a load (heat), so don't bother overdoing it.
- Connect the other terminal of the switch to the left pin of the 7805. This is the input.
- Twist another long wire (colored black if you have it) to the ground wire of the power supply. Solder both of these together to the center pin of the 7805.
- Solder another wire (red is nice) to the right pin of the 7805. This is the output, and it'll connect to the +5 volt spot we talked about when we wired the input jacks together.
Here's our project thus far. As you can see, we've connected the output of the 7805 regulator to the +5 volt spot near the inputs. We've also connected the ground from the regulator to both the output jacks and the input jacks. We're ready to attach the bus switches themselves.
Wiring the bus switches to the input jacks
The wiring of the bus switches themselves was covered earlier, so here we'll just show you how they are physically connected.
Above we see the first bus switch and its first connections to the input jacks. The Vcc pin goes to the +5 volt spot, ground goes to any ground, and Enable A goes to the first switch's enable terminal. From this angle, that's the switch on the right. Remember, each bus switch has (2) sets of 4 switches, so each of these works for 2 inputs.
Here's the first bus switch again but now with the first 2 inputs hooked up. The second enable pin on the IC, Enable B, has been hooked up to the middle switch.
Earlier we talked about an "output bus" and here it is -- a very elaborate piece of copper perfboard. Laid across the pads are some bits of wire, these are the output busses, video, left audio and right audio. Ribbon cable connects these to the output jacks. Doing it this way makes wiring a little easier as you have a long strip of a connection to connect all of the bus switch outputs too and won't have excess wires between the two halves of the case.
Here's the second bus switch attached to give us the 3rd switch we need. Therefore, in this example, the second switch inside the second bus switch (confused yet?) will be unused and thus a lot of wires go unconnected. It's best to connect the unused Enable pin (in this case B) to +5 volts, so it stays off even though we don't have a switch for it.
Enable A on the second bus switch goes to the leftmost pushbutton as seen above. The inputs of this bus switch connect to the leftmost set of jacks, and the output bus connections go to the same place as the first bus switch did. Remember, a bus is connected to everything.
Our switcher is now finished and we can cram everything inside the case and test it out. Before we get to the troubleshooting here's the pinouts of S-Video and VGA adapters if you plan to make a switcher using those.
Here's a pinout of a VGA port, in case your Google is broken and you have trouble finding one because there's no internet connection to your cave.
On the same token, a pinout of an S-Video port. Troubleshooting
If the switcher doesn't work check the following...
LED indicators don't light up:
- Check that the LED polarity is correct - long lead is positive, short is negative.
- Check that the +5 volt and ground connections are connected to the 7805 regulator.
- Ensure that the selection switches have one terminal connected to ground.
Poor video / audio signal:
- Make sure the power supply and regulator is supplying +5 volts to the bus switches.
- Check for short-circuited connections on the inputs and output bus.
- Make sure all input and output jacks have their shells/shields connected to the main ground.
- Don't enable multiple inputs at once, and check that only the input device you want to use is on to avoid interference.
No video / audio signal:
- Using a multimeter set to voltage, see if +5 or ground (reads as 0) is getting to the enable pins.
- Check the wiring of the inputs and outputs on the bus switches.
- Make sure the bus switches have their Vcc (+5 volts) and ground connections made.
- Check that your test unit (game system, disc player) is on. As a last resort you know.
You now have the information required to build any type of custom A/V switcher you'd like. It's a great way to hook up multiple gaming system or to put more than one device into a TV's single component video jack. Have fun with it and see what you can come up with. Remember, since the switching is done with a TTL level input signal you can control the switches with other electronics such as timers, counters, PIC's and Basic Stamps. Now go forth and multiply!