# replace USB A plug with micro-B

I have a tablet case with a keyboard in it. It came with a large USB type A plug and a large Y-adapter to USB micro-B. It has always worked. The tablet has a micro-B type connector and it works fine. I wanted to replace the A plug and adapter with a micro B plug, so I bought one on e-Bay. I searched about to find the pinout, and confirmed the A plug is -, data+, data-, + with the data+ wire blue coming out of the keyboard. When I put the new micro-B plug in the tablet I could not measure the 5V. I soldered the wires on and it doesn't work. When I connect the power and gnd (+ & -) I still don't measure the 5V. The tablet USB port still works and I can charge the tablet. Any ideas? In the photo the wires are (left to right) -, n/c, data+, data-, +.

• the photo does not show any individual connections, so it is not possible to verify if you connected them correctly Apr 28, 2019 at 1:31
• trust me, they are connected left to right as described: -, n/c, data+, data-, + Apr 28, 2019 at 1:35
• Probably something is shorted? Apr 28, 2019 at 2:26
• When I disconnected the - I still did not measure any voltage. Apr 28, 2019 at 2:28

Your phone is an "OTG device", meaning that it can assume both roles - the role of USB host, and the role of USB device. You want it to be a USB host to drive your keyvoard.

Now notice that the u-USB plug has FIVE pins. These pins include the pin named ID:

If you need your tablet to act as host, the ID pin must be grounded. In all regular cables the ID pin is floating. The ID connection is buried under the plastic overmold, and it is usually a challenge to change it.

• That's the ticket. I've been reading a dozen websites but none bothered to make it clear - which is the receptacle, which is the plug, which is the host, etc. It is a tablet which means it would most likely be OTG. It works with the adapter because the ID pin must be shorted in there. If I plug a Flash drive in the adapter I can read the files in the tablet. Muchas gracias! Apr 28, 2019 at 4:35
• Note that the ID pin can take on a life of it's own, especially in older phone models, where it is used to detect car-kits, enabling debug modes or specify boot-loader behavior etc. This is done by connecting various resistances between the ID to either VCC or GND. Apr 28, 2019 at 11:58
• @not2qubit, yes, another ID-dependent mode is "accessory charger", with 125k to ground. All these modes are optional, and the ID floating and shorted to ground are the two basic ones, all OTG specifications use ID=true and ID=false exclusively. Apr 28, 2019 at 17:07

First solder a type A plug back on and confirm that the keyboard is still good.

Then plug the adaptor and keyboard into a micro socket break-out board and trace all the connections from the socket break-out to the keyboard cable.

Then plug the micro plug into the socket and copy those connections.

PS. perhaps you need to do something with the OTG pin?

• Yes, see the answer below about the OTG. I didn't have any type A plug, I didn't have any micro socket break-out-board, etc... Apr 28, 2019 at 4:37