Raspberry Pi USB Hotplugging

Posted on

The payload had a backup transmission using a USB 3G/SMS dongle (Second hand / 10€) to send SMS with coordinates in case of failure of the NTX2.

As it is useless (no signal in altitude) and waste of battery to power the USB dongle during all the flight, I used a script to power it (using a GPIO and a relay) only when the payload was back near the ground (altitude back bellow 2 Km).

But when testing my script and the “hot plugging”, I noticed the Raspberry PI A failed (freeze / reboot) everytime the USB 3G/SMS dongle was powered.

After some investigations, I found the folowing links explaining about the “inrush current” and the “Voltage Drop”

http://theiopage.blogspot.com.es/2012/06/increasing-raspberry-pis-usb-host.html
http://thestuffsido.blogspot.co.uk/2013/05/fixing-raspberry-pi-hotplugging.html
http://therandomlab.blogspot.fr/2013/01/raspberry-pi-mod-to-avoid-shutdown-on.html

The USB.org whitepaper explain:

In accordance to the USB Specification Revision 2.0, the VBUS power lines must be bypassed with no less than 120µF capacitance of low-ESR capacitance per USB port.

So I soldered a “Low ESR” 220uF and this fixed the issue!

Note: this problem was known by the RaspberryPi foundation as it seems to have been fixed with the new version B+ that have “better hotplug and overcurrent behaviour”.