Raspberry PI:- USB, Ethernet, crashing and other problems
Do you have frustrating issues with your Raspberry PI
Are you experiencing problems with your PI, you can’t explain or figure out why? You bought what you thought where good accessories (Keyboard, Mouse, WIFI adapter and cables), well read on, you may discover your problem is simply the USB cable between the power adapter and the PI. Don’t rush out and blow money on the 5.25V fix everything power adapter because you may end up no further ahead and if you’re really unlucky damage the PI.
Raspberry PI common problems or questions
· Raspberry PI reboots randomly
· Raspberry PI keyboard stutter
· Raspberry PI Crashes Randomly
· PI Ethernet stops working after a few hours or less
· Forums tell me I need to get a 5.25V power supply for my PI, or 5.5V even…?
· Whenever I plug in my WIFI adapter or other USB device it reboots the PI
· Are all USB A to micro B cables the same just different lengths?
· Back feeding USB power to the PI
Why am I doing this article
My son is at university, he has to use a PI for assignments in computer science classes, in order to better help with coaching him I bought one of my own to use at home (In a hope to be one step ahead of him ) I very quickly discovered issues with repeating keys and un expected restarts, I diagnosed the problem to the USB cable quite quickly but read up on the issue online anyway(Just in case). After reading through many forums on the issues it became very clear to me that people were being directed in the wrong direction to resolve their problem. Mostly shorting out fuses or replacing the correct 5V adapter with a 5.25V one. Did these fix the problems… in some cases yes but at the risk or voiding warranty or worse breaking the PI or simply deferring the problem until the day an additional device gets added where the problems start all over again
Description of the working of the PI power grid.
NOTE: I am deliberately simplifying the description below by not using all the formal electronics engineering terms in order to be more understood by people who do not know them. Please do not flame me for this, I am trying to help a larger audience and apologize to those who do know the correct terms.
Input Power from Wall adapter to the PI
Ignoring Power stations, distribution to your home etc., we start at the wall outlet, here we plug in the power adapter, this is recommended to be an adapter rated at an output of 5.0 Volts at 1000mA (1Amp)
This then has a USB cable that plugs into the adapter at one end and the PI at the other. The cable can come in lengths of a few inches to well over 6 feet. You will see later, longer is not always better, but then again nether is shorter in some cases.
The PI micro USB power connector
This connector is ONLY used to provide power to the PI, it cannot be used to transfer data
The diagram below shows that the power from the wall adapter (Direction of the Arrow) goes into the micro USB connector (VBUS – VIN) and then through an 1100mA fuse (F3 in the diagram).
Also note in the diagram “TP1” and “TP2”, this is the test points on the PI circuit board used to measure the voltage level on the board. When connecting a test meter to these pins it should read +5V0 (5 Volts) as indicated on the label top right of the diagram. We will use these pins later when we run some real tests.
Regulators that supply the PI internal circuits and the GPIO devices (If any)
If you don’t understand the diagram, don’t worry, the description should be enough for you to understand what is happening.
The 3v3 regulator (top) feeds (From pin 3) all the internal circuits and the GPIO connector as well as supplying the 2V5 (middle) and 1V8 (bottom) regulators, this 3V3 regulator must be supplied with power that is at least 1.2V above the output power which works out to be 4.5V (3.3V + 1.2V). This means that if the input power goes lower than 4.5V the output of the 3v3 regulator can start to go unstable affecting the Ethernet and other parts of the PI. Oh and a note to a few people that provide advice on the various forums, there is NO 5V regulator on the PI, it relies on the wall adapter for this.
USB Output connectors
In earlier PI revisions, there used to be fuses just before the USB connectors limiting the output power to connected devices, this was causing many issues with users who connected anything other than the simplest of devices, as a result the makers of the PI removed them thereby limiting the total power protection to the first fuse mentioned above (F3). You will note that the same +5V0 label from the above diagrams is also on the top left of this diagram. They are all connected together meaning the only thing between the devices connected to the output USB and the input USB power adapter is the F3 fuse.
Don’t be fooled into thinking you can happily connect devices to the GPIO and USB ports that add up to 1100mA (Including the power the PI takes), you can’t. The rating of this fuse is the point at which it will “Blow”, the sustainable current is only 700mA above which the fuse will start heating and increasing its resistance causing the power on the other side to slowly fail and eventually the PI will reset or start behaving erratically, this could be minutes or even hours after the initial power up.
This is not a permanent problem, the fuse is resettable and if disconnected from power for a while it will heal itself and start to allow power to flow correctly again. It may take several hours or even days to fully recover which means if you use the PI too soon after blowing it may not work correctly even if you now unplug those extra devices. You need to give the fuse time to heal.
In order to be able to measure the power being drawn through the USB cable, I will have to cut into the wires carrying the power, rather than damage the test wires I have modified one of my older but good quality extender cables. It contains thicker wires for the power than most modern cables and therefor will have little impact on the results and in addition I shortened it considerably.
In order to simplify the connections, I completely cut the extender cable, soldered the ends onto a breadboard either side of pin headers so I can add jumpers to create a pass through or remove one or more to be able to perform measurements, in addition I added a very low value resistor (0.010Ω) to allow measuring the mA flowing through the wires. This will have little effect on the measurements, I could have used the meter to measure the mA directly but this would have also added several feet of addition wire.
You can see in the pictures below the results of this as well as the markings on the outside of the cable indicating the gauge of the wires within, later you will see how much thicker the actual wire is compared to the test cables.
Keyboard, Mouse (Plugged into the Keyboard), WIFI module, HDMI connected screen, breakout cable connected at the power adapter end of the USB cable under test, Agilent U1272A (Orange) 4 1/2 digit meter and my old but trusty Master Craft (Grey) 3 1/2 digit meter
The orange meter was connected across the terminals on the break out board where the black jumper was installed in the previous pictures, this will monitor the mA flowing but still allow me to disconnect the meter for other measurements without shutting down the PI, the master craft meter was used to measure the voltage across TP1 and TP2 on the PI board itself.
I will use averaging on the Agilent meter to measure the power flow once the PI has booted, this will give a better reading for our calculations later, once I have performed the initial power measurements I will repeat with my oscilloscope and graph the voltage on the GPIO header from initial power on through to the PI being stable at the main screen (About 60Seconds duration), this will allow us to see how the power dips and jumps around during the startup and show any spikes that the meters can easily miss
USB cables to test
I found five different makes and sizes of cable, nothing bought specifically for this test and all supposed to be quality cables. Only three had markings indicating their “Claimed” internal wire gauges. The other two had no markings at all. I numbered each one with tape and a sharpie and used a white board to keep track of measurements. Each cable was measured in order to allow me to calculate the resistance per foot after we have taken the readings.
I used the power adapter that was provided by the store I purchased the PI from, this is a regular 5V 1100mA wall wart and should be sufficient for most things you should connect to the PI.
In order to have full set of measurements I started out with simply measuring the output of the adapter with nothing connected , then with only the PI and HDMI screen attached and finally added the Keyboard, mouse and WIFI adapter. I also decided to see how much current would be drawn if I connected a USB hub un-powered to the PI (It took almost as much as the PI on its own… wow!)
The results are below. These results are not part of the USB cable test but I was curious, you can see that adding USB devices adds significant load to the PI (Don’t forget the fuse on the board starts to blow above 700mA)
|Power Supply only||5.212V||Measured on the breakout cable|
|PI with HDMI attached||332mA|
|HUB + KBD, Mouse, WIFI||960mA|
|USB Hub with no devices||626mA||HDMI + HUB but no keyboard, mouse or WIFI adapter|
|Powered USB Hub||340mA||Now power the hub to see what’s left powering the PI|
The actual test procedure is simple, connect each USB lead in turn, power up the PI and wait for it to boot up, measure the current and the voltage at the breakout board and the voltage across TP1 and TP2, rinse and repeat for each cable noting the readings as I go, subtracting the two voltage readings gives me the drop across the length of the test cable. When I calculated the resistance in ohms per foot, I doubled the length of the cable as it contains two wires involved with powering the PI, one for the positive supply coming from the power adapter and one for the ground going back to the adapter.
For more detail: Raspberry PI:- USB, Ethernet, crashing and other problems