Wednesday, July 18, 2012

Raspberry Pi USB Power Issues - Ultimate Solution

Update: This modification will probably void your warranty and comes with no guarantees. Use at your own risk.
I have been struggling with USB power issues with my Raspberry Pi for weeks now. I had issues getting USB Wi-Fi adapters and Bluetooth Adapters working. I would have issues when using non-powered USB hubs. The Wi-fi adapter would freeze and start producing USB errors when trying to download files.
The recommended solution from the Raspberry Pi foundation is to use a powered USB Hub. So I ended up buying the Gear Head 4-Port Powered USB Hub. It solved all my problems. This solution was frustrating because of its price ($20 = 50% of the Raspberry Pi price!), and how large it was. Here is a picture of my make-shift Lego Raspberry Pi case with powered USB Hub:
Eventually I stumbled upon a thread on the Raspberry Pi forums discussing USB power issues. There are a number of proposed solutions, but the the one that worked best for me was suggested by user mahjongg. The solution is to solder a 1 ohm 1/4Watt resistor in parallel to each of the F1 and F2 fuses.
To understand why this works, one must understand what causes the USB power issues. The Raspberry Pi has 2 fuses (F1, F2 on the board) which are used to limit the current supplied to the 2 USB ports on the board. The fuse resistance increases linearly with applied current up to a maximum of about 7 ohms. A 7 ohm resistance at 100mA causes a 0.7V drop. This will cause the voltage being supplied on the USB port to be 4.3V which is too low for most USB devices. The fuse is designed to limit USB current to 100mA. This is much less than what is needed by a Wi-fi adapter.
By attaching a 1Ohm resistor in parallel, we reduce the maximum voltage drop at 100mA to 0.1V only, and at 300mA to 0.3V. This will allow a voltage of 4.9V and 4.7V respectively to be seen by the USB device at those 2 currents. These voltages are okay for most USB devices. Below are a couple pictures of my modification.
After performing this mod, I no longer have any USB power issues. I can use a non-powered USB hub, wi-fi adapters, and bluetooth adapters with no problems. I can also hot-swap USB devices without reboots. I no longer require the powered USB hub. As a result, I re-configured my Lego case to be much smaller.
Please note that if you are using high power USB peripherals, your power supply for the Raspberry Pi itself should be up to snuff. The Raspbery Pi on its own uses 500mA. So if your USB peripheral is using 300mA, I would suggest using a 1A power supply at a minimum.
Thanks to mahjongg on the Raspberry Pi forums for this great tip!

13 comments:

  1. sorry for the noob question, but why are the two new resisters different sizes, though you state only 1 resister type? "1Ohm 1/4Watt"

    ReplyDelete
    Replies
    1. You are correct. The smaller one is definitely 1/4Watt. The larger one probably has a higher power rating (my guess would be 1/2Watt). These were the only 1Ohm resistors I had handy so I used what I had.

      Delete
  2. Those fuses were put there by someone who didn't know any better, it seems.

    The fuses make no sense. If you want power management, do power management. You know, use a chip that senses the current and can turn off loads that consume too much. Passive fuses don't cut it on USB supplies, I'd have hoped it's widely known...

    ReplyDelete
    Replies
    1. I am not sure why fuse was even used. But when you have to keep the cost low ($25), adding power management is out of the question.

      Delete
  3. Nice read!

    But I guess you could write "ohm" as "ohm" and not "Ohm". You see, it took me a couple of seconds to realise that you meant 1 ohm and not 10hm, which meant no sense if you read the 0 as an O. Why make it difficult for the readers? Besides, the rule is to write it in small letters as well. :-)

    Apart from that, good hack \m/

    ReplyDelete
    Replies
    1. Thanks. You're right, I updated the post to make the numbers more readable.

      Delete
  4. Thanks man you rock! This worked like a charm.

    ReplyDelete
  5. these fuses have been removed in board revision 2.0 .... However, there is still a 1A fuse near the 5V in, therefor total current for the pi and the USB devices cannot exceed 1A.

    ReplyDelete
  6. Hi I also got the gear head hub, it powers the pi and AirLink101 wifi adapter fine. However it seems to not have enough power when I connect a portable USB hard drive to it. I can heard the drive spin up and it would mount for a second and then it would stop and unmounted. Have you experienced similar issue?

    ReplyDelete
    Replies
    1. I've never tried using a USB hard drive so I can't really comment sorry. But I have used 2 wifi adapters, a wireless mouse and a keyboard all at once without issue.

      Delete
  7. Hi this is a nice hack. I would like to know if you think it is possible to connect two USB 2.0 Hubs with 7 ports to Raspberry Pi (14 usb ports). What I want to test is connecting several usb wireless adapters to use in the Raspberry; in fact 11 adapters.

    I have a powered USB hub with 7 ports but when I start the Raspberry Pi with 5 adapters the system become slow. I think the USB hub is not correctly supported by the card. I am using Debian Wheezy image on RPI.

    Best regards

    Antonio

    ReplyDelete
    Replies
    1. Hi Antonio,

      It may be possible to hook up 2 hubs to the Raspberry Pi. However, the bandwidth required to support 11 adapters may not be enough. Keep in mind that using a hub splits the available bandwidth of a single USB port between all additional ports. So a standard 480Mbps USB 2.0 port would be divided by 11 in your application. I'm not sure this would be enough bandwidth for each wireless adapter.

      Regards,
      Himesh

      Delete