How to approach a USB KVM?
Hello all,
I hope this is the right sub for an issue like this. The situation is the following: I bought a KVM hub for my computer displays, which works fine for the keyboard and mouse input devices. However, it's an unreliable mess when it comes to the other USB 2.0 port that I used for my USB microphone.
I assume this is due to the way the switching is handled, and I heard about audio devices causing issues in this kind of setup. I also want to add a webcam that is incompatible with the KVM anyway, since it requires USB 3.0 or faster.
Since I'm somewhat interested, i electronics, but have no experience beyond frying a few LEDs with my Arduino. However, I did some research till this point and figured I may actually be able to pull this off given enough time and patience. One question that remains is: how would I implement the actual switching?
Conceptually, the idea is for it to look like this
Conceptual drawing on how the final wiring should look like
The idea is simple enough. A Wi-Fi connected microcontroller (wireless because the KVM is mounted under my desk) with a few photoresistors to detect the indicators on the front of the device, keeping track of the current state to account for external triggers. Via home assistant, the KVM can be switched using the keyboard shortcuts sent to the KVM via keyboard emulation. With some small delay, the state is synced to the USB KVM that is controlled by a small microcontroller (ATTiny?) via I2C.
Is there something dumb that I'm missing with my concept?
The specific implementation of the functionality of the USB KVM is where I'm struggling. My concerns start with the USB 3 protocol being fairly high bandwidth, which I presume requires some precise planning for the wiring? Is there a beginner-friendly source to read up on this? For the actual hub, I figured the TUSB8043 would be a good choice
Additionally, how would I reliably and safely switch between the two host PCS? Could I use transistors for that, or would they cause issues? What would be the best way to go about this.
For me, it's important that the hub actually disconnects the upstream USB device properly when not in use, since I assume this is the current source of most of my device swapping issues with the current hub.
I appreciate your input!
Posted Jul 24, 2023, 9:13 PM UTC
Not sure if this is the right subreddit for your post?
Not to worry, the mods have been contacted to check it over. The next time you are not sure, try the following before posting:
After that, if you are still not sure, contact the mods using the link in the sidebar and we'll be happy to help!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.