Maximum length of a USB Cable?

45

20

I want to use a very long USB cable to place a webcam in a different room. The maximum length that I found was five meters.

  1. What is the maximum length of a USB cable?

  2. What is the maximum length achievable when using USB extension cables?

Click Ok

Posted 2009-11-03T01:36:26.393

Reputation: 3 436

Answers

51

5 meters is the maximum USB cable. You can get further by connecting USB hubs serially (maximum of 5 hubs chained this way). You can't just use USB extension cables due to timing issues.

From the USB FAQ:

Q1: How long of a cable can I use to connect my device?
A1: In practice, the USB specification limits the length of a cable between full speed devices to 5 meters (a little under 16 feet 5 inches). For a low speed device the limit is 3 meters (9 feet 10 inches).

Q2: Why can't I use a cable longer than 3 or 5m?
A2: USB's electrical design doesn't allow it. When USB was designed, a decision was made to handle the propagation of electromagnetic fields on USB data lines in a way that limited the maximum length of a USB cable to something in the range of 4m. This method has a number of advantages and, since USB is intended for a desktop environment, the range limitations were deemed acceptable. If you're familiar with transmission line theory and want more detail on this topic, take a look at the USB signals section of the developers FAQ.

Q3: How far away from a PC can I put a USB device?
A3: With the maximum of 5 hubs connected with 5m cables and a 5m cable going to your full speed device, this will give you 30m of cable (see section 7.1.19 for details). With a low speed device, you will be able to get a range up to 27m, depending on how long the device's cable is. With a straightforward cable route, you will probably be able to reach out 25m or so from the PC.

Q4: I need to put a USB device X distance from my PC. What do I do?
A4: If X is less than 25m or so (see previous question), buy a bunch of hubs and connect them serially with 5m cables. If you need to go farther than that, put another PC, or maybe a laptop, out where you need the device to be and network it with the first PC using something that's intended to be a long-range connection, such as Ethernet or RS-485. If you need to use nothing but USB, consider using USB based Ethernet adapters to hook the PCs together.

quack quixote

Posted 2009-11-03T01:36:26.393

Reputation: 37 382

3@Breakthrough No, the signal voltage is easy enough to amplify; I think it is about the timing on the single link. The problems from capacitance and inductance are - if you look closely - exactly the timing issue; The signal is spread in time direction. But even the latency can be relevant inside the link protocol; It get's much easier if you can use a full round trip for each byte you transfer - no need to keep track what may need repeating on a glitch. And the latency over five hubs is just the same for the device to computer link ;) – Volker Siegel – 2014-08-29T07:02:39.480

Those 5 hubs connected in series, do they need to have an external power supply? or is it enough with the power supplied by the USB connection itself? – GetFree – 2014-10-25T09:52:49.480

1@getfree usually you need to power the hubs separately. If you know the hubs power consumption and the end devices power need, you can calculate whether your 500 mA from the source will be enough. Over longer stretches the village drop might be enough to need at least some posted hubs in the sequence. – TafT – 2018-04-12T05:16:51.363

7Just FYI, it's not really a timing issue, since using hubs doesn't mitigate the signal's propagation time. Rather, the maximum cable length is due to line capacitance/inductance issues, and the signal's voltage loss along the length of the cable. If the cable was too long, the digital logic levels might not be triggered properly at the receiving end. Each hub "resends" the signal so-to-speak, which is why this solution works. – Breakthrough – 2011-08-09T16:21:55.943

28

All answers are incorrect if OP meant the link operating at High-Speed USB2.0 communication speed (480 Mbit/s).

The length of a USB communication link is limited by the USB architecture of having five hubs in the link. The USB protocol requires that USB devices send back handshake packets as ACK, NAK, NRDY, etc. These responses must come back to host within a specified time-out, which is set to 1.7 µs. The host controller hardware would set a flag/interrupt if the response is not received in time after 1-2-3 attempts, which would mean the link failure.

Now, what was the basis for this 1.7 µs limitation? It is based on a worst-case round trip of handshake packets. All is explained in USB 2.0 specifications, Section 7.1.19.2. There are three factors:

  1. Physical signal integrity over a twisted-pair differential for a realistically manufacturable cables (impedance matching, cable uniformity, signal loss). This came out as 5 m cable length limit per segment. A 5 m cable has an estimated one-way propagation delay of 26 ns per USB specifications. All six cables will have the round-trip delay of about 300 ns.

  2. Digital signal propagation delay along the hub's repeater path, which is limited to by suggested architecture to 40 HS bit times, which is about 80 ns per hub one-way. Five hubs will have the round-trip delay of about 800 ns.

  3. A USB device is allowed to respond in 192 bit times, which is 400 ns.

So, total response time is 1500 ns. The specification allows some slack, and extends the time-out to 1700 ns.

Therefore, the limit for media propagation time is 1700 ns - 400 ns = 1300 ns, or 650 ns one way. If you can manufacture a cable that has such a low loss over 650 ns of wave propagation that it can deliver an open signal eye meeting USB far-end template, a host with a single USB device can work with it. Taking 26 ns per 5 m, it comes down to 125 m of cable. This is the maximum theoretical limit.

I'd love to see if this kind of cable can be made. Personally I had a good no-error link with 40 ft (12 m) cable made of Cat 5e. But it depends on quality/sensitivity of receivers on both ends of a link.

ADDITION: The above answer is valid only for overall USB HS communication protocol. However, there is another functional limitation on the maximum cable length in USB: it is related to high-speed disconnect function. The HS disconnect in USB is based on an idea that a disconnected cable would reflect the signal back, so the reflection adds up to the driven voltage leading to doubling of signal amplitude at the transmitter. As designed, the HS host sends micro-frame markers (called SOF) every 125 us. For the purpose of cable disconnect detection the SOF packet has an elongated end-of-packet, ~83 ns long (normal EOP is 16.6ns long).

If the USB cable is disconnected at host port, no problem. But if a device (with its termination) is disconnected at far end of a long cable, the reflection must come back within 83 ns, the amplitude will double up, and a special comparator in the PHY receiver will register the "HS disconnect" condition. This sets the cable limit of having 41.5 ns one-way propagation delay. Assuming 6" propagation speed per 1 ns, this requires the cable to be less than 250" long, or about 6.5m long.

This limitation takes place only if you want to sense a clean and fast disconnect. With longer cable the host port will be eventually disabled due to protocol error, so not much problem at the end.

Ale..chenski

Posted 2009-11-03T01:36:26.393

Reputation: 9 749

1How did you check the error rate on your setup? – ZAB – 2016-12-15T01:14:48.527

@Ali Chen, thanks for this incredibly informative information post! +1 – Sam – 2016-12-17T15:28:50.030

1@ZAB The experiment was done between two highly polished USB2514B hubs, with all care about traces and connectors and termination self tuning. The CATC USB Protocol Analyzer was between the host and first hub, and the cable was between the 1st hub and the second hub. There were no protocol errors, at all. The eye diagram was on the lower side of specifications, of course. – Ale..chenski – 2018-02-09T18:42:09.527

@AliChen Have you ever tried constructing a long USB 3.0 cable using Cat 5/6? – pseudosavant – 2018-06-13T16:49:57.793

@pseudosavant, no, I didn't try, at that time there was no USB3 yet. But the USB3, as a full-duplex bus, doesn't have the restrictions described above, transactions can be deferred and responses in different pipes can go out-of-order, and not limited by short timeout. The working cable length is solely determined by cable quality - uniformity, cross-talk, and high-frequency losses. – Ale..chenski – 2018-06-13T22:12:16.513

10

According to USB specifications, cables longer than 5 meters would cause a too large signal propagation delay to work.

But I've managed to build a 10 m/30 ft passive USB extension cable that worked just fine. All I did was to use an FTP Cat 5e AWG24 100 ohm cable with one twisted pair for data (D+ and D-; I used the green pair), and the other three twisted pairs for power (V+ and V-; in parallel solid to solid and stripe to stripe).

I've had no problem using any USB device over this cable.

Chris

Posted 2009-11-03T01:36:26.393

Reputation: 259

Others had success with 10m cables too: http://forum.cakewalk.com/UPDATED-USB-extension-cord-extra-long-to-connect-audio-interface-to-computer-m2704309.aspx

– inf3rno – 2018-02-13T07:23:09.670

9

If you want to go beyond 5 meters, use a booster.

Molly7244

Posted 2009-11-03T01:36:26.393

Reputation:

3This "booster" operates only at USB1.1 -full speed 12Mb/s. – Ale..chenski – 2016-07-26T15:07:26.003

3interesting. works by using CAT5/5e/6 instead of USB cabling for the long haul: "This plug-and-play device consists of a Base Unit and a Remote Unit connected together by a standard Cat5, Cat5E, or Cat6 network cable. Simply connect your cables to your device; then connect to your computer and USB peripheral and you're up and running. The Super Booster USB Extender has internal DC power conditioning circuits to maintain the proper voltage to the remote device so no external power is required for either the Base or Remote units." – quack quixote – 2009-11-03T01:44:39.503