USB over Serial

My computer is in a different room than my monitor, keyboard and mouse. I can get the video from the computer to my monitor using HDBaseT. However, I haven't found an inexpensive solution for doing the same with my keyboard and mouse. Hence I am considering doing some project with an Arduino to achieve this.

I have two options. One is building a "USB over IP" device. So I hook up the USB mouse/keyboard to the Arduino, which helps me translating this to regular IP traffic and then convert it back to USB on the other side.

The other option is building a "USB over 3-pin serial". My HDBaseT device has TX/RX/GND built in. Hence I could have an Arduino project translating USB signals to serial on one side and then serial to USB on the other side.

Has anybody done anything similar or has some hints on how to go after that.

HDBaseT supports USB as well (according to the specifications). So that'd be my first choice as there is HDBaseT in place already.

Otherwise, just use a long USB cable. The maximum allowed length is 5 meters, you can easily double that by adding a USB hub halfway. Must be cheaper, easier, and more reliable than using some Arduino-based hack.

HDBaseT does support USB but my device does not have a USB input. Also the computer is downstairs in a different romm which would require about 30' of cable which at this point I cannot run through the wall anymore. Hence I need a different solution and maybe Arduino is the key to this.

You're confusing.
First you say you want to connect a USB mouse and keyboard that has to be connected to your computer.
Then you suddenly have "a device" that doesn't do USB. What "device" you want to connect now?

Yes, I want to connect a USB mouse and keyboard to a computer that is some 30' away from the USB mouse and keyboard. I only have two wired options: 1) going over the regular LAN (IP traffic) or a 3 pin (TX/RX/GND) serial connection.

So one idea is having a Arduino on one side. Plug in the keyboard and mouse into the Arduino. Have the Arduino somehow translate the commands from the keyboard and mouse to a serial signal. That signal is sent over the 3 wire cable via a RS232 Serial Port to TTL Converter. Then on the computer side I do the reverse, i.e. the Arduino received the serial signal and converts it to USB. The USB output is then plugged into a USB port of the PC.

A similar approach could be made but instead of converting the USB to serial it would be converted to TCP/IP which is sent over the LAN and then decoded back to USB.

Are there some libraries that can do those conversions?

One possible option.

USB Keyboard -> USB Host Shield -> Uno -> UART-> RS232 -> RS232 -> UART -> Leonardo -> USB device port -> PC

https://www.arduino.cc/en/Reference/MouseKeyboard

Another option is to replace UART - RS232 with Ethernet Shields.

I have no time to work on this.

USB can't possibly work over Serial. It's expecting data rates in the hundreds of KB/s and Serial just can't go that fast. It's also expecting certain timings between requests and responses. The two Arduinos in the middle are going to slow this down by an absurd amount.

Now an Arduino Micro, Leonardo or Teensy can be configured as a keyboard and mouse and then it can accept inputs over a Serial link which causes it to emit keyboard and mouse events over USB. But plugging a regular USB mouse and keyboard in the other end will be problematic. I think this is what GDSports is trying to suggest.

Just get a proper KVM extender. There's a zillion models out there. There must be one within your price range.

All the fast USB I/O is between the USB keyboard and the USB host controller. When the users presses the A key, this information is available to the sketch as key up/down events (just a few bytes). Key up/down information must be sent out over the UART. When no keys are pressed, nothing is going out over the UART. 9600 bps should be OK.

Make versus buy is always a good idea to consider. Of course, a lot of Arduino projects make very little sense except for people who enjoying making and understanding how electronic devices work.

By the way, I have not built this. If I had, I would have pointed to my github repo. So take this with a grain of sodium-free salt alternative. The USB Host shield and library are not easy to use with so this could take more effort than it is worth.

Get a laptop.

...R

"take this with a grain of sodium-free salt alternative" :open_mouth: :open_mouth:

"Get a laptop". That's not the solution I am looking for. I want one central computer with keyboards/mice/monitors(32"/4k) connected to that computer. I don't want any other equipment that is visible or has to be maintained. It seems there isn't any good solution with Arduino so I might have to bite the bullet (and get protection from my wife;) and spend a few hundred dollars on 4k HDBaseT with USB.

Thank you all for the input.

a few hundred dollars

Wondering what kind of dollars that are... the usual suspects, USD, AUD, CAD - a couple hundred of those sound quite absurd for less than 10 meters of just about any cabling (you're not buying monster cable, do you?). In SGD it's still too much, in HKD it sounds rather reasonable.

I am open to any other solution. Each location has a direct Ethernet connection (point-to-point) to the central location plus a regular Ethernet connection to the LAN. One alternative solution I can think of is mounting a small mini computer on the back of the monitor and then remote login to the main computer in the central location. But now I have to maintain that mini computer and there is delay from the remote session. Hence, I would like a direct connection between the monitor and computer (again, there is only a point-to-point Ethernet connection plus the regular LAN).

mulu:
"take this with a grain of sodium-free salt alternative" :open_mouth: :open_mouth:

"Get a laptop". That's not the solution I am looking for. I want one central computer with keyboards/mice/monitors(32"/4k) connected to that computer.

You are mostly correct when you say that my comment "get a laptop" was in jest.

On the other hand, the notion of "one central computer" was last taken seriously in the days of the IBM 360 mainframes.

You should be able to get 2 or 3 laptops for the "few hundred dollars" you are thinking of spending on USB stuff and you would also have more capability and more resilience.

...R

Robin2:
On the other hand, the notion of "one central computer" was last taken seriously in the days of the IBM 360 mainframes.

Funny you mention that because I was going to make a reference to mainframes. It's actually exactly what I want to do. Yes, you will have one big failure point that can bring 'everything' down (though we still have our phones and tablets). However, it also means I just have to maintain one system. And it keeps things clean for each terminal. Eventually, the 'mainframe' will move to the cloud and all the programs and data will be there, again with just a terminal in your home. Kind of a "cloud mainframe". In the meantime I have to have my local 'mainframe'.

mulu:
Eventually, the 'mainframe' will move to the cloud and all the programs and data will be there,

So the mafia can poke about in your private life at their leisure ?

My data is on my PC and on backup devices where I can see them.

...R

Did you check what kind of Arduino is required to implement 2 USB ports for the mouse and keyboard input? Perhaps a RasPi is a simpler solution for that part of your project. Otherwise 2 Nano's may be usable as well, which share a communication line towards the central computer, where another Nano can act as the the USB HID device.

Data can be in one place. A big networked drive can hold all your movies and personal data.

Then just get a media server wherever you need to display the data. It can be a small box about as big as the box your Arduino came in. Or it may be the TV itself - most seem to have that kind of tech built in these days. With the right apps, your handheld devices can control the media server over the WiFi.

What about a wireless keyboard and/or mouse? I'm sure that I have seen some spec'd for 30+ feet.

If you want to make a project out of this and use existing devices, I understand not buying new devices, but I guess it depends on how much you want to spend in time/money.

blah2222:
What about a wireless keyboard and/or mouse? I'm sure that I have seen some spec'd for 30+ feet.

Ideal conditions and line of sight. OP has walls in the way.