100%
avswitch avswitch view
Description

Imported from GitHub: mmcmaster-au/avswitch · commit f9e3159 · license GPL-3.0

Description

6 input video switch

README

6-Input Component+composite Video Switcher

The motivation behind this project is to connect 5 retro game consoles to a TV (plus 1 spare for future expansion). The commercially available switches either lack sufficient inputs, or are prohibitively expensive.

The switch will support both component and composite video to provide some flexibility. All of the consoles support composite video. Most of them support component video, though I don't own all the required cables yet. Some (eg. N64 Pal) require a mod to support component video output. Some (eg. PS2) may need a composite connection to enable the the component output.

Costs

The total cost for the project is unreasonable - it's much cheaper and easier to buy a commercial product afterall!

ItemSupplierCost (AUD)Shipping (AUD)
ComponentsDigikey$158Free
PCB + StencilJLPCB$89$32
Arduino NanoAliexpressTODOTODO
Case hardware (threaded inserts ?)AliexpressTODOTODO
Case filamentTODOTODO
Consumables - solder paste, fluxDigikey$41Free
Total$298$32

Costs as of June 2025. Only part of the consumables were used, but they have a limited shelf life(6 months refrigerated for the paste)

The highest cost part is the RCA jacks. It would be possible to swap to a cheaper part, but at the cost of proper colour-coding. I like to be able to match colours when plugging in the cables. Paint or stickers could be a cheaper alternative.

The next highest cost part is the opamps. A second version of this project could investigate using a cheaper part (eg. lower bandwidth) and comparing the output.

Build Log

2025-11-16 - First test

Success! The video input and output works well.

What isn't so great:

  • The sound volume is very low. I made an assumption that audio works the same as 75Ω video, and that assumption is wrong. Line-level audio impendence should be around 100Ω to 200Ω for output, and 10kΩ-50kΩ for input. 10kΩ is very different from 75Ω!
  • Mixup with soldering R711, R713, R715 on the top board. These should be on the lower board and vice-versa. The mixup means it's not possible to use any inputs on the top board. I could fixup the resistors on the existing board.
  • Error in the schematic with inconsistent inputs being fed into the switch IC inputs. eg.X1 is connected to Pr2, but Y1 is connected to Comp4. There is only a single control to switch both X and Y. It could be possible to rework the existing board by cutting traces etc, but seems easier to just move on to a second revision.

2025-10-12 - SMD Soldering

Success! The power supply produces ±2.5V from a standard USB-C cable + wall charger. There's nothing else worth testing until the through-hole parts are soldered.

I spent 5 hours placing both boards with tweezers. There are many, many parts to place.

Soldering was performed using a Whizoo Controleo 3 powered toaster oven with Chip Quik SMD291SNL lead-free paste.

Part U401, a TPS561243DRLR in a SOT-563 package is very small. I had great difficulty in determining the correct orientation as the pin 1 marking was too small for my old eyes to see.

The solder pads of the TVS diodes is unnecessarily small. A few diodes will need some rework with the hot-air station. This issue could be fixed in a PCB revision to make placement easier.

Design

For aesthetic and cable management reasons I want all RCA connectors to be at rear of the unit. The front of the unit will have a selector button plus a display to indicate which input is selected. The display will also show auto scanning status, assuming I end up implementing such a feature.

The longest side of the PCB should be 200mm or less. This requirement means the rear needs to be angled in order to fit enough RCA jacks. The 200mm limit is to allow 3d printing a case using common 3d printers - my own 3D printer has a build volume of 220x220x250mm.

To allow 6 inputs within the above constraints I've chosen a stacked layout of 2 PCBs, with 3 inputs + DC Input on the top PCB, and 3 inputs + 1 outputs on the lower PCB. Ideally both PCBs will have the same design and differ only in the placed components.

Input Stage

input stage circuit

The input stage consists of:

  • 75Ω termination
  • A high-pass RC filter to block DC signals
  • A signal buffer to drive the signal through the relatively high-impedence switching stage. Implemented via a unity-gain opamp wired as a voltage follower.

The output from the input stage is source-terminated only (no need for impedence control - see discussion below).

The opamp device chosen is the Runic Technology RS8754XP quad rail-to-rail opamp.

  • Unity-gain stable
  • High gain-bandwidth of 250MHz
  • Low-price
  • Readily available

Switching Stage

The goal of the project is to connect a mix of 480p/576p consoles and a 720p/1080i console (Xbox original). The bandwidth required to pass a 720p or 1080i signal guides the choice of multiplexer IC.

Analog Devices AN-944 "Signal Bandwidth vs. Resolution for Analog Video" specifies 37.13MHz bandwidth is needed for 1080i.

Multiplexer IC bandwidth is often specified at a -3dB level, so a device that supports at least 50Mhz will be required for a good picture.

A search for applicable parts comes up with 2 categories:

  • Cheap ICs with a high Ron impedence
  • ICs with a low Ron impedence which cost much more

I've selected the cheap + high impedence path with a buffered input stage to deal with it.

The multiplexer device chosen in the 74HC4052D. This is a 4:2 2-channel multiplexer. The inputs of the top PCB will pass through the multiplexer twice - once on the top PCB, and a second time on the lower PCB. This simplifies the PCB layout compared to a 8:1 device (74HCT4051D)

  • Multiple sources and readily available
  • 170MHz -3dB bandwidth
  • The HC version supports a lower Vcc voltage compared to the HCT version. This eliminates the need for a +5V supply rail.

Output Stage

output stage circuit

The output signal is buffered via a 2:1 gain voltage follower to a 75Ω output impedence for connection to a coax cable with 75Ω characteristic impedence. The 2x gain is required as the 75Ω terminting resistor to ground (within the television) forms a voltage divider with the resistor at the output of the opamp.

Display

The display will be a common 128x32 0.91" OLED panel, based on the SSD1306 Driver IC. Communication is over i2c. Such panels are available very cheap on aliexpress and elsewhere, and they look great. The display requires up to 25mA at 5V.

Microcontroller

There's not much processing required in the project, so the goal here was to use something easy to program and flash. An Arduino Nano is trivial to flash over USB, includes libraries for outputting to the display, and the clone versions are readily available and cheap.

Power Requirements

The device will be powered by regulated 5V via USB-C as a UFP (Upstream facing port - 5.1K resistors to ground on both CC pins). There's no need to negotiate power via USB-PD or similar since we need less than 15W. However since we can draw more than the 500mA offered by legacy USB ports we need to check the connected cable and charger is correct (USB-C) before enabling the multiplexer ICs. This can be done by checking the voltage range on the CC pins (whichever is higher): source

VoltageCurrent AvailableEnable multiplexers ?
< 0.2VNo connectionNo
0.2 <= CC < 0.66V500mA, Legacy USBNo
0.66 <= CC <= 1.23V1.5AYes
CC > 1.23V3AYes

The USB socket part can be either Same Sky UJC-H-G-SMT-2-P6-TR, or GCT USB4125-GF-A-0190. Each use an indentical footprint and suitable for 1.6mm PCB. These parts only offer the minimal pins needed for power, which makes them considerably easier to solder than a connector with all the data pins.

The USB standard limits Vbus to only 10uF capacitance seen when plugged in. ie. inrush current must not be greater than that of a 10uF capacitor. We'll easily exceed that with the 2x voltage regulator input caps (22uF each), and a large bulk cap, so a usb power switch is needed. Diodes Inc AP22816B is only $0.18, supports 1A, and is designed for USB. If needed the higher capacity AP22817B or AP22818B can be used to support 1.5A/2A respectively.

Selecting a single input voltage simplifies part selection, and a low voltage reduces the impact of DC Bias on capacitors (eg. vs using a DC barrel jack and 7-12V input).

The Arduino Nano can be powered directly from the 5V DC input via pin 27. The display is also powered directly by 5V. Everything else will use a cleaner/filtered power supply.

DevicePurposeDevice Count+5V-2.5V+2.5V
Arduino Nano125mA
OLED Display125mA
74HC4052D 4:1 2-channel MultiplexerSupply Current6120mA300mA
RS8754XP Quad OpampQuiescent current14196mA196ma
Output current - Input to Switching stage120.1mA0.1mA
Output current - RCA Out296mA96mA
Output current - Microcontroller ADC (Luma/Y & composite only)2TODOTODO. Use Summation Amplifier mode
Total50mA412mA592.1mA
Power0.25W1.03W1.48W
Total Power2.76W
Current @ 5V input552mA
PTC Resettable Fuse750mA

Power Supplies

The intention is to 3d-print a case, which means switching power supplies is preferred for lower heat. A linear regulator with heatsink may work fine at 80°C but risks softening/deforming the surrounding case, especially if it's printed from PLA.

The Power Supply Rejection Ratio of Opamps is generally very good at lower frequencies, but poor at higher frequencies. The same generalisation applies to linear regulators. There is no point in using a linear regulator after the switching regulator, since in either case a low-pass filter is required to remove high-frequency noise.

A combination of a switching buck regulator (TPS561243DRLR) and low-pass filters on both input and output sides will be used to create a clean +2.5V source.

Generating a -2.5V supply can be done easily with either a charge pump or Cuk converter. The limit for most negative charge pumps is only 200mA, so a Cuk converter will be used (LM2611AMFX/NOPB). As for the +2.5V supply, an additional LC filter stage will be used both before and after the regulator to reduce high frequency noise.

I've discounted a single split-rail buck converter as it may struggle to maintain regulation with light loads and different loads on each rail.

Capacitor Selection

A large 100uF aluminium polymer cap (KYOCERA AVX RPA0609101M025B, 25V, 30mOhm ESR) will be used as the bulk capacitor on the power switch output. The AP22816B power switch requires at least 100uF according to the datasheet.

I've assumed ceramic SMD capacitors are used at the input and output of the switching regulators based on cost. It would be possible to use Film Capacitors for better tolerances, but they cost too much and are physically too large.

The use of SMD Capacitors presents a DC-Bias challenge, which is especially relevant in the power supply filtering section. The table below picks a few representative parts to illustrate the DC-Bias impact from the Kemet simulation tool.

According to the TPS561243 datasheet, the voltage rating of the switch output capacitor needs to be 25V or above

VoltagePackagePartDielectricCapacitanceVoltage RatingDC-Bias De-rating
5V0805Kemet C0805C226K8PACX5R22uF10V6.9uFInsufficient
5V1210Kemet C1210C226K3RACX7R22uF25V16.5uF
2.5V1210Kemet C1210C226K3RACX7R22uF25V20.8uF
5V1210Kemet C1210C107K4PACX5R100uF16V44.8uFInsufficient
2.5V1210Kemet C1210C107K4PACX5R100uF16V71.8uF

In general, the larger package sizes exhibit better DC-bias characteristics.

For the 22uF capacitor 0805 is too small for 22uF, and doesn't even come in a X7R version nor a 25V rated version. 1210 looks to be the sweet spot.

For the 100uF capacitor (>= 4x 22uF needed for LC parallel damping filter) it's unlikely that a suitable ceramic cap can be found for a reasonable price. Aluminium-polymer cap have low-enough ESR, however the ESR varies with frequency and will be higher than rated at the LC filter cutoff frequency. As such I've chosen to simply place 4 discrete 22uF caps in parallel as a fool-proof solution.

Power Supply Filtering

The RS8754XP has a typical PSRR of 90dB, though it's unclear what frequency that is measured at - possibly only at 100Hz. The low-pass filters should be at a sufficiently low cut-off frequency that we can assume the PSRR of the opamp at unfiltered frequencies will be good enough.

TI SNVA538 "Input Filter Design for Switching Power Supplies" shows how a damped-filter can be implemented. I've chosen the simpler parallel damped design presented in the article, mostly because the maths for the two-stage filter is too hard.

parallel damped filter

An LC Filter has a peak at the resonant frequency: $f_{0} = \frac{1}{2 \pi \sqrt{L \times C}}$

Optimum damping resistance value: $R_{d} = \sqrt{\frac{L}{C}}$ where $C_{d} = 4C$

Actual resistance value is rounded to the nearest standard 1% tolerance value.

VLCC (DC-bias derating)$f_{0}$$C_{d}$$R_{d}$$R_{actual}$
5V10uH22uF16.5uF12,390Hz88uF778mΩ787mΩ
2.5V10uH22uF20.8uF11,035Hz88uF693mΩ698mΩ
2.5V2.2uH22uF20.8uF23,527Hz88uF325mΩ324mΩ

This is a plot of the simulation in SPICE (via Kicad), comparing the plain LC filter (green) vs the damped filter (blue) using the component values above: parallel damped filter simulation

Playing around with the values, better results are obtained from a larger inductor (with Rd resized to suit). The Cuk switch will use a much larger 10uH inductor, and using this for the filter results in 9.5dB lower noise at 1MHz compared to 2.2uF.

Cuk converter design

Part: LM2611AMFX/NOPB. The design steps below follow the Detailed Design Procedure of the part datasheet.

Duty Cycle:

$V_{out} = -V_{in} \frac{D}{1-D}$

$D = -\frac{V_{out}}{-V_{out}+V_{in}}$

At 5V input, $D = -\frac{-2.5}{2.5+5} = 0.333$

Note: Maximum duty cycle of LM2611 is 82% over the temperature range.

Inductor Ripple

The data sheet suggests an inductor in the 10-22uH range. Assuming an average current of 300mA, the ripple current using 22uH inductors was too low (10%), and 10uH seems ok (20%) (recommendation = under 30%).

$\Delta i_{L} = \frac{V_{in} \times D \times T_{s}}{2 \times L} \text { where } D = \text {duty cycle and } T_{s} = \frac {1}{f_{s}} = \frac {1}{1,400,000}$

At 5V, $\Delta i_{L} = \frac{5 \times 0.333 \times 0.000000714}{2 \times 0.000010} = 59.4mA$

Assuming an average current of 300mA, the ripple current will be between 19.8%, which is under the 30% limit recommended by the datasheet.

$i_{SW(PEAK)} = I_{out} \times (1 + \frac{D}{1 - D})+\frac {V_{in} \times D \times T_{s}} {2} \times (\frac {1}{L_{1}} + \frac {1}{L_{2}})$

$i_{SW(PEAK)} = 0.412 \times (1 + \frac{0.333}{1 - 0.333})+\frac {5 \times 0.333 \times 0.000000714} {2} \times (\frac {1}{0.000010} + \frac {1}{0.000010}) = 737mA$

Based on these values, I've chosen Taiyo Yuden NRS6045T100MMGK 10uH inductor for high current ratings (2.4A), and low dc resistance (59.8mOhm).

Feedback Resistors

LM26211 uses a 1.23V reference voltage.

$1.23V = 2.5 \times \frac {R_{fb2}}{(R_{fb1} + R_{fb2})}$

Assuming $R_{fb2} = 10k, R_{fb1} = 10325.20$ (or 10k + 324Ω using standard resistor values)

$\frac {1.23 \times {(10324 + 10000)}}{10000} = 2.499852V$

Buck Converter Design

Part: TPS561243DRLR

Feedback Resistors

TPS561243 uses a 0.6V reference voltage.

$2.5V = 0.6 \times (1 + \frac {R_{fbt}}{R_{rbb}})$

Assuming $R_{rbb} = 10k, R_{fbt} = 31666$ (or 31.6k using standard resistor values)

$\frac {0.6 \times {(31600 + 10000)}}{10000} = 2.496V$

Inductor Ripple

Peak-to-peak ripple current:

$I_{P-P} = \frac{V_{out}}{V_{in(max)}} \times \frac{V_{in(max)} - V_{out}}{L_{out}\times f_{sw}} = \frac{2.5}{5} \times \frac{5 - 2.5}{2.2uH \times 1,280,000} = 444mA$

Max current: $I_{peak} = I_{out} + \frac {I_{P-P}}{2} = 0.5921 + \frac {0.444}{2} = 814mA$

Based on these values, I've chosen Taiyo Yuden NRS4018T2R2MDGJ, with 2.2A current rating, 3A saturation, and low 50.4mΩ DCR.

PCB Design

The upper and lower sections will both use the same PCB, but with different components placed. This is to save cost, as generally the minimum order is 5 PCBs for hobbiest boards (eg. at JLPCB)

The video signals between the upper and lower PCBs will travel over 5cm 1.0mm pitch inverting ("Type 2" / "Type D") FFC. Such cables are dirt cheap and readily available.

The power rails will be connected using screw terminals, so that thicker wires can be used.

A common rule of thumb is to not worry about transmission line effects until the line reaches 10% of the wavelength. For a 1080i signal, effects can be ignored less than

$\frac{\lambda}{10} = \frac{c}{f} \times \frac{1}{10} = \frac{3\times 10^{8}}{37,130,000} \times \frac{1}{10} = 80cm$.

Therefore there's no need to consider the impedence of the FFC connections, nor any of the internal video signals between the input stage and output stage. However all traces from the RCA inputs and RCA outputs need to be impedence controlled.

Using values from JLPCB's 4-layer JLC04161H-7628 Impedance Control Stackup:

  • Dielectric constant: 4.4
  • Top layer copper: 0.035mm
  • Prepreg layers (2): 0.21040mm
  • Core layer: 1.065mm

... The Kicad "coplanar wave guide w/ ground plane" calculator gives 0.172264mm trace-width and 0.199998 separation for a 75Ω trace on the outer copper layers. This assumes a ground plane next to the 75ohm signal, and also under it on the inner layer.

Assuming one of the inner layers is used for power rails, the impedence controlled traces are constrained to the top copper layer only.

ESD

This Hackaday article convinced me to add extra ESD protection on all external signals (eg. all RCA connectors and the USB connector)

This document OnSemi AND8424/D Unidirectional versus Bidirectional Protection explains the difference between unidirectional and biderectional TVS diodes. For the video signals (-1V <= signal <= 1V) bidirectional protection is needed. Unidirectional is sufficient for the USB CC signals connected to the arduino ADC.

For the video signals individual TVS diodes will be used to ease PCB routing. The part needs to be low capacitance (<= 5pF), SOD-323 package, 3.3V standoff voltage Vwm, 4V Breakdown voltage Vbr. eg. SMC SD03LCC

The USB CC lines connected to the arduino need 5V unidirectional protection, use SRV05-4 in SOT23-6 package (multiple suppliers).

Comments
Sign in to comment

No comments yet. Be the first to ask about this board.