For the Mini-USB connector.
|1||VCC +5V, up to 500 mA by USB 2.0 standard||1||Red|
|4||USBOTGID. Shorted to GND, N/C, or shorted to GND via resistor||4|
Colors do not mean anything - just make sure the colors match from end to end. Using the de-facto color is for industry types only.
The maximum length of a standard USB cable (for USB 2.0 or earlier) is 5.0 metres (16.4 ft). The primary reason for this limit is the maximum allowed round-trip delay of about 1,500 ns. If USB host commands are unanswered by the USB device within the allowed time, the host considers the command lost.
The data cables for USB 1.x and USB 2.x use a twisted pair to reduce noise and crosstalk. USB 3.0 cables are more complex and employ shielding for some of the added data lines (2 pairs); a shield is added around the pair sketched.