USB through VGA cable

Thread Starter

Andrius Slizys

Joined Jul 20, 2019
12
Hey guys,
I'm making cnc hand held controller. Actually it's already made and last thing left to do is to connect it to the machine and PC.

Inside controller there is Arduino that acts as a virtual Modbus slave and communicates with a program on my computer. So Arduino has to be connected via USB to PC. Besides that, controller has Analog signal outputs (Manual Pulse Generator, and few switches) that should be connected directly to the CNC machine driver board. Also, I want to pass some 5V to pendant for LEDs.

So....
USB actually works via 4 wires (I do not count shielding).
I need 2 wires for 5V power supply
And I need 9 wires for Analog output.

I counted that in total I would need 15 wires. As much as VGA connections has.
I was stupid enough, so I drilled a hole into controller casing and mounted VGA female socket, without even thinking of how USB would react being wired through VGA cable. I've got some 3meters VGA cable, plugged that in, and hell ya USB doesn't work. Power comes on, but signal seems to be too weak. Few times all worked just fine, but disconnecting and connecting again would lose the signal.

I could think about other ways to wiring it up, but that VGA socked looks really nice to me, and I don't want to mess around again with removing electronics from inside, drilling case again. So I'm still thinking to stay with VGA cable. 3 meters of cable is what I'm looking for.

Any idea? Solution? Tip?

Cheers!!

DSC00358.JPGDSC00350.JPG
 

nsaspook

Joined Aug 27, 2009
13,087
The connector is fine but the cables inside a standard VGA cable were designed to carry single-ended video and signals.
TB1i_LincyYBuNkSnfoXXcWgVXa_!!0-item_pic.jpg

There might be some twist on the signal wires for a marginal USB signal if you select the right pair.
 

MisterBill2

Joined Jan 23, 2018
18,176
Passing through the 15 pin connector will not be the problem, it is the length of the cable. USB-2 uses really skinny wire. One other thing is that a standard VGA cable does not have all 15 pins wired. So you will need to make your cable no matter what. Your best choice would be a cable with about 8 to 10 twisted pairs of #28 wire. Good luck.
 

cmartinez

Joined Jan 17, 2007
8,220
USB requires a single pair of wires to be twisted and shielded for it to work. The other two correspond to power and ground. If you're able to find a pair arranged that way, you should be able to get away with the three meteres you want.

Another important thing to consider is to make sure that the USB-UART converter you are (or might) be using does *not* take its power from the computer's USB port, but rather from a more stable source. I speak from personal experience when I tell you that a computer's USB power source is possibly the dirtiest and noisiest source of power there is. If you *must* draw power from the USB por for said purpose, I'd use an electrolytic capacitor of at least 22uF, plus a ceramic 0.1uF across the power pins of your USB-UART converter as close to the cip as you're able to place them. And even then you might experience glitches every once in a while.
 

Thread Starter

Andrius Slizys

Joined Jul 20, 2019
12
There might be some twist on the signal wires for a marginal USB signal if you select the right pair.
Thank you. I tried many options, but seems that none of the pair is right.

The big red, green and blue wires are individually screened. It might work if you use two of those for the USB D connections.
Unfortunately my cable doesn't have individually screened pairs, I have some other VGA cables , and all of them are internally different. Most of them has 10-12 wires in total, so doesn't fit my purpose.

Passing through the 15 pin connector will not be the problem, it is the length of the cable. USB-2 uses really skinny wire. One other thing is that a standard VGA cable does not have all 15 pins wired. So you will need to make your cable no matter what. Your best choice would be a cable with about 8 to 10 twisted pairs of #28 wire. Good luck.
Actually this cable that I have is wired with all 15 pins + shielding, not sure what for it was used, got lucky I guess. Anyways, it doesn't work.
Thanks for pointing me out! I'm going to check where can I find some twisted pairs cable at that size.

USB requires a single pair of wires to be twisted and shielded for it to work. The other two correspond to power and ground. If you're able to find a pair arranged that way, you should be able to get away with the three meteres you want.

Another important thing to consider is to make sure that the USB-UART converter you are (or might) be using does *not* take its power from the computer's USB port, but rather from a more stable source. I speak from personal experience when I tell you that a computer's USB power source is possibly the dirtiest and noisiest source of power there is. If you *must* draw power from the USB por for said purpose, I'd use an electrolytic capacitor of at least 22uF, plus a ceramic 0.1uF across the power pins of your USB-UART converter as close to the cip as you're able to place them. And even then you might experience glitches every once in a while.
Thanks for useful information!
I don't use separate USB-UART converter, Arduino communicates via it's native USB port, but I had already an idea to drive it from separate power supply rather than USB, plus I already dedicated pair of wires for my 5v input from the DC power supply to drive my LEDs

After reading answers popped one more idea. I've seen these stainless steel braided sleeves for the cables. I think it's possible to pass through actual USB cable and other wires beside, and still have an esthetic look. Only soldering all those wires to the VGA plug will take some time.

Thank you all, I appreciate it.
 

cmartinez

Joined Jan 17, 2007
8,220
I think it's possible to pass through actual USB cable and other wires beside, and still have an esthetic look.
If you're motivated by aesthetics, I suggest you do away with the connector on the handheld control side, and use a suitable cable gland. You may then use a custom connector on the controller side. Finding a good cable for your purpose shouldn't be much of a problem then. Just look at Digikey, Mouser an Newark. One of them should have what you need.
 

MisterBill2

Joined Jan 23, 2018
18,176
Thank you. I tried many options, but seems that none of the pair is right.



Unfortunately my cable doesn't have individually screened pairs, I have some other VGA cables , and all of them are internally different. Most of them has 10-12 wires in total, so doesn't fit my purpose.



Actually this cable that I have is wired with all 15 pins + shielding, not sure what for it was used, got lucky I guess. Anyways, it doesn't work.
Thanks for pointing me out! I'm going to check where can I find some twisted pairs cable at that size.



Thanks for useful information!
I don't use separate USB-UART converter, Arduino communicates via it's native USB port, but I had already an idea to drive it from separate power supply rather than USB, plus I already dedicated pair of wires for my 5v input from the DC power supply to drive my LEDs

After reading answers popped one more idea. I've seen these stainless steel braided sleeves for the cables. I think it's possible to pass through actual USB cable and other wires beside, and still have an esthetic look. Only soldering all those wires to the VGA plug will take some time.

Thank you all, I appreciate it.
With a small vise to hold the connector, a fine-tip iron, skinny solder, and a good magnifier it is not hard to do a very good solder job. But without one or more of those it can be very difficult.
AND there are tinned copper braids that look good and are a whole lot easier to solder than stainless steel. Also, think about some of that teflon tube/stainless braid hose that is available, if you can find some that is not too stiff.
 
Top