I have bought a Raspberry Pi zero and I need a Raspberry Pi hub. The hub is not available in Pakistan. How can i create my own Raspberry Pi hub?
What have I tried?
and connected the pin to Raspberry Pi zero but it did not work.
I have bought a Raspberry Pi zero and I need a Raspberry Pi hub. The hub is not available in Pakistan. How can i create my own Raspberry Pi hub?
and connected the pin to Raspberry Pi zero but it did not work.
You should be able to, although as per my comments it probably is not necessary; all you need is a commonplace OTG adapter. Based on the wikipedia description, however, you could make one yourself using one end of a normal microUSB cable and a female USB jack from somewhere (here's someone who has), since that is the context: You need to insert the male end of whatever you are connecting to.
There are five lines in a micro-B plug, but only four of them connect to the female jack. The extra one on the male end is simply pulled low by attaching it together with the ground.
Notice the pin ordering on the receptacle (female, here the big type A) is the same as it is looking face on at the plug (male), meaning the lines cross over in the cable. By number they are:
Based on that, you could also snip the cord from the hub you have (or open the case and desolder it, probably a better idea) and attach a micro-B plug.
The sheilding on the small wires inside a USB cable is usually color coded, those should be red for 5V power, black for ground, white for D+, green for D-.
Note that the very same hub you have bought exists in OTG variant as well:
This one should work with RPi Zero just fine. Check out the shop you got your hub from: perhaps they have the OTG model as well and are willing to exchange the hub you have bought for the one you actually need. Or just keep the hub you got for your laptop, and buy a new one for the RPi.
Another solution is to buy an OTG cable which will enable you to use the hub you have:
As a final note, if you want to connect something more power-hungry than a mouse and a keyboard, you should really consider buying an externally powered hub.