Raspberry Pi B+ has four USB ports. But pi cannot provide enough power required for USB devices like external hard disk. Now, if pi cannot provide power, what's the use of having more USB ports? What am I missing here?
The usb ports are able to provide enough power for many devices.
If you want to use a peripheral requiring more power than the rasperry is able to provide, then yes, you will need a usb hub with external supply (which can also power the raspberry itself). But as it's not always needed, it is useful to have more available ports.
For instance you may have:
- USB keyboard
- USB mouse
- USB Drive / hard disk
As you can see, we quickly exhaust thouse 4 ports. Of that list, the keyboard and mouse will draw a tiny fraction of power (but use a usb port). Some WiFi adapters are more greedy, but others have no problem with the current supplied by the raspberry pi. And for the hard disks there is much more variation: from some able to be powered just from the raspberry, to others that directly come with an external supply even though they are intended for desktop computers.
Not all USB devices are power hungry.
Large disks, even if connected via USB, will have their own power supply.
The B+ will supply up to 600mA to the USB ports by default. By writing 1 to gpio38 the B+ will supply up to 1200mA. This assumes that enough power is fed into the Pi.
External HDD (USB) are generally supported. I am running a 1TB HDD with 1200mA power supply to the Pi and there has been no glitch. I also added a wired mouse and a keyboard.
A HDD normally consume not more than 200mA and the Pi can support that.
If you use a lot of external HDD or a large HDD, you might need a powered USB hub.