Wiring Micro USB
Micro USB pin Description.
Why do we need a switch?
We are adding the switch to confuse the device and make it think that it is in charging mode whilst in OTG.
Any other readymade device that you may find in sites like banggood, aliexpress or ebay also will have a switch. https://goo.gl/MMUFDC https://goo.gl/xNcBRx
Does it work in all devices?
I have tested this with one android and one windows tablet and it worked. Based on the device you are using, you may have to add a resistor between ID and GRND pin of the micro USB male A. I would suggest adding a 10K pot set to maximum value whose resistance you can keep bringing down untill OTG gets detected.
CAUTION: Do not reduce resistance below 330ohms.