Go back
USB Controllable HDMI Switch 2023-01-15

I have possibly the worst computer setup in existence - I have Linux running, and sometimes I also have Windows running inside a VM. The VM gets a seperate graphics card, which means I have two HDMI outputs that I want to switch between automatically, but it takes over the mouse/keyboard that I use normally, so I don't want a whole KVM.

Surely this exists - but all I could find was manual switches, with a button you press. So I made one myself!

At first I got a regular HDMI switch and soldered a bunch of wires to it: A god awful hack that is definitely going to fall apart soon

But this was kind of terrible, and I couldn't make another one easily. The reason I was able to do this in the first place is that I got lucky and found one with a seperate switch IC, rather than a combined switch and control IC. And also the switch IC had a datasheet available from .. some random person who uploaded it to GitHub.

My own design uses a SAMD21 microcontroller (because I had some already) and a PI3HDX621 3.4Gbps HDMI1.4b Active 2:1 Switch with ARC and Fast Switching. There are a lot of switch ICs available, so I just sorted by price and this was the best, apparently.

Bad design

One problem is this switch specifies that the I²C buses should be 3.3V, explicitly on the sink side and implicitly by note (2) saying you should add level shifting "for the highly reliable system design". So I had to add that, because HDMI's I²C buses are 5V. Why would they do this?

This was my first time doing any kind of high speed layout where impedance control was required, but it seems to have turned out okay. The worst part was that the Out port pinout on the switch is mirrored for some reason, so I had to route it to the back side of the PCB and back again to un-mirror it.

Here's a picture: Picture of the board - with two HDMI ports labelled Input 1 and 2, and a third labelled Out.

The HDMI ports turned out to be very annoying to hand solder, with constant bridges between the pins. Maybe next time I will use a stencil and solder paste.

The board design and firmware can be found at https://github.com/Stary2001/hdmi-switch/.