Sie sind auf Seite 1von 7

18th May 2013

Fixing Raspberry Pi hotplugging

So the Raspberry Pi likes to restart when plugging in USB hard drives. That doesn't gel with my intended use of the
Raspberry PI: HTPC which would have various USB hard drives and memory sticks regularly being plugged in and
out.
(Crudely explained by a novice with an incomplete understanding,
The Raspberry Pi restarts when a USB device, like a USB hard drive, is connected because the USB device in
essence suck up the power from the USB for a very short while. The Raspberry Pi experiences something like
a brownout [http://en.wikipedia.org/wiki/Brownout_(electricity)] and restarts.
For a more exact explanation have a look at http://theiopage.blogspot.com.es/2012/06/increasing-raspberry-pisusb-host.html [http://theiopage.blogspot.com.es/2012/06/increasing-raspberry-pis-usb-host.html] where he explains
voltage droop and a mod applicable to the earlier versions of the Raspberry Pi (those with polyfuses limiting the
current on the USB ports). He also hints at how to properly fix the hotplugging problem of the Raspberry Pi.
David Sanz Kirbis describes how he fixed the hotplugging problem of the Raspberry Pi here:
http://therandomlab.blogspot.com/2013/01/raspberry-pi-mod-to-avoid-shutdown-on.html
[http://therandomlab.blogspot.com/2013/01/raspberry-pi-mod-to-avoid-shutdown-on.html] . I used his blog post as a
guide to do a similar mod on my own Raspberry Pi.
How the fix works is by increasing the capacitance of the Raspberry Pi, so that it can supply the USB devices with
the necessary power to fill the USB device's own capacitors without resulting voltage droop causing the Raspberry
Pi to restart. The capacitor C32 over the USB ports, as highlighted below, is a mere 47F.

[http://2.bp.blogspot.com/--nMQL0oUiBk/UZdNOB7jLKI/AAAAAAAAAB4/jeugqI-JeUw/s1600/Capacitor+C32.jpg]

Chapter 2.3.1 of the following white paper


(http://www.usb.org/developers/whitepapers/power_delivery_motherboards.pdf
[http://www.usb.org/developers/whitepapers/power_delivery_motherboards.pdf] ) recommends a minimum of 120F lowESR capacitance over the USB ports. The USB power delivery specification
[http://www.usb.org/developers/docs/usb_20_040413.zip] notes that the "sink bulk capacitance" should be 300 F (see
cSrcBulk and cSrcBulkShared). Whether the "sink bulk capacitance" refers to the same thing that the white paper
refers to, I am not sure. But from all of that and the opinions of the two blogs linked to above, it clearly shows that
the capacitance needs to be increased.
I chose to first increase the capacitance at C32, closest to the USB ports using a 10 V 220F low ESR electrolytic
capacitor. I guess any low ESR electrolytic capacitor with a voltage above 6V and 150F should work. Notice that
the capacitor has a positive and negative lead, as marked on the picture below. The coloured band with the
rectangular blocks inside the band indicated the negative lead, with the other being positive. Also note the positive
and negative terminal of capacitor C32 as shown in the image above.

[http://1.bp.blogspot.com/Y2Qw7Zv7Ass/UZdVM8v5u9I/AAAAAAAAACI/4rP9qzWMMHY/s1600/Capacitor+10V+220uF.jpg]
[http://3.bp.blogspot.com/-ULTT0WTIYLc/UZdVNObx3tI/AAAAAAAAACM/Vxuf0xRpkig/s1600/Capacitor+legs+bent.jpg]

I also cut and bent the leads so that I can solder the capacitor over the exiting C32 capacitor. Take note of the
length that you cut the leads, because if the capacitor stands out above the USB ports then it is likely that your case
won't close.
Below the soldered on capacitor is shown. If you look closely you can see that my solder of the positive lead isn't
very nicely done. The soldering is a bit delicate, so be careful.

[http://3.bp.blogspot.com/-1EE6u8XXVY0/UZdVWHD9-dI/AAAAAAAAACY/gvryXbx_AaM/s1600/IMG_3833.JPG]

[http://2.bp.blogspot.com/-jHMvFGdMQwg/UZdVfI_-3VI/AAAAAAAAACg/oTw5splkG6Q/s1600/IMG_3834.JPG]

I then tested the plugging in a multiple USB harddrives while the the Raspberry Pi was running and it didn't restart.
Success. It seems that the single capacitor is sufficient and the 2nd capacitor by the input power wasn't needed as
per therandomlab blog article.
Posted 18th May 2013 by Mynhardt Burger
9

View comments

Unknown October 19, 2013 at 4:26 AM


Make it even more robust by adding a 5V 2A power supply that connects through the GPIO connector.
Reply
Replies
Unknown October 19, 2013 at 4:27 AM
rpips.com
Reply

Piotr Kula November 14, 2013 at 11:12 PM

I did that on the original Pi. Still resets the darn thing. It really annoys me to death. I also removed the fuses for
each port. I got 2A connected via GPIO.
Reply

Anonymous November 23, 2013 at 10:45 AM


Does the capacitor placed over C32 have any high end limits? I know nothing of electronics but really want this
done so I can hot plug devices (I know a guy to do the soldering since I can't)
If I buy from a local store like Radio Shack I have limited choices and want to know if I have to be exact, for
example would 50v 470uf be a problem. I really can't buy online easy to get more exacting choices.
Reply

Anonymous March 7, 2014 at 3:14 AM


@Anon
A little higher on the values will be fine. What's important is that it is a low ESR capacitor and the amount of space
it takes up.
Reply

Anonymous May 15, 2014 at 10:21 PM


Could you get the +5V and the Ground directly to the USB Bus?
2 Ampere Max does not look much, but the PCB traces might not coop well with sudden current changes.
In combination with the larger capacitor, That mighrt just help.
Neovo.
Reply

Paul McElroy July 15, 2014 at 12:37 PM


This comment has been removed by the author.
Reply

Anonymous August 13, 2014 at 5:20 PM


I tried to solder parallel capacitor to C32 for 20 minutes already. The solder just don't stick to it. I tried rubbing
with alcohol, polishing with a knife. Still the new capacitor just falls off. (((
Reply

Anonymous September 21, 2014 at 5:55 AM


Use some flux
Reply

Enter your comment...

Comment as:

Publish

elgauchoandres (Google)

Sign out

Preview

Notify me