21 Replies Latest reply on Nov 13, 2014 3:48 AM by mikebolton

    Powering via the USB ports

    mikebolton

      Have just bought a B+. Reading all the previous documentation on the B indicated I could power the Pi via a USB port if I wanted. I tried this on my B+ and nothing happened !.

       

      My particular application has a USB module capable of supplying 2 amps at 5V and will be used for communication with the rest of my system. I do not want to use the micro-usb for power. The connector is inconveniently located and I have no 5V supply apart from the USB module. (This is for an embedded application).

       

      Can I use the USB ports for input power on the B+? If not, why not?  The very sparse schematic for the B+ is no help. Is there a more comprehensive one in preparation? It doesn't show the USB ports at all, unlike the one for the B. If there is some 'block' on the USB 5V, could I patch from the USB ports to the 5V pins on the GPIO? (I am a retired professional EE with a long experience of microprocessor systems and quite happy to solder to my Pi if needed). I did note that my mouse, also connected into a USB port, lit up when I connected the power to another USB port - but the Pi itself didn't !

       

      Also couldn't find how to send / receive data via a USB port using Python. How does the Pi allocate the USB ports? When booting, my Pi seems to recognise the external USB module  - without installing a driver, which is very surprising as it is a non-standard USB device. How do I check these ports? (Any 'device manager' like Windows?).  I have previously used USB ports as virtual COM ports in Windows. I need to be able to receive and send data (text strings) via a USB from a Python program (or maybe a C# and mono at some stage. Speed may be an issue for me)

       

      Regards

       

      Mike

        • Re: Powering via the USB ports
          John Beetem

          Mike Bolton wrote:

           

          Have just bought a B+. Reading all the previous documentation on the B indicated I could power the Pi via a USB port if I wanted. I tried this on my B+ and nothing happened !.

           

          My particular application has a USB module capable of supplying 2 amps at 5V and will be used for communication with the rest of my system. I do not want to use the micro-usb for power. The connector is inconveniently located and I have no 5V supply apart from the USB module. (This is for an embedded application).

           

          Can I use the USB ports for input power on the B+? If not, why not?  The very sparse schematic for the B+ is no help. Is there a more comprehensive one in preparation? It doesn't show the USB ports at all, unlike the one for the B. If there is some 'block' on the USB 5V, could I patch from the USB ports to the 5V pins on the GPIO? (I am a retired professional EE with a long experience of microprocessor systems and quite happy to solder to my Pi if needed). I did note that my mouse, also connected into a USB port, lit up when I connected the power to another USB port - but the Pi itself didn't !

          I haven't heard of a full schematic for Model B+, but I haven't been paying much attention.  The Model B had problems with hot-swapping USB devices, so when B+ improved hot-swapping it lost the back-powering "feature".

           

          There's a thread about lack of back-powering in an unmodifed B+ at the RasPi forum: http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=83014.  One of the moderators does suggest jumpering from USB +5V to GPIO +5V.  Doing this should work, but you lose fuse protection.  If it were my board, I'd solder from USB +5V to fuse F1 pin 1 so I still have fuse protection.  This is electrically equivalent to an external USB cable from a USB hub to RasPi's Micro USB power jack.

           

          Also, different USB hubs have different abilities to back-power.  Standard USB ports are limited to 500 mA, though cheap hubs just connect all the +5V lines together so you can get 2A.  The upstream connection for a hub may or may not be able to back-power.  They aren't supposed to, and some hubs have a diode to prevent it.

           

          Hope this helps!  Advice is offered without warranty - YMMV.

          1 of 1 people found this helpful
            • Re: Powering via the USB ports
              mikebolton

              John

               

              Thanks very much for this. I will give it a go.

               

              You suggest connecting the +5V from the USB connector to end 1 of the fuse, to give 'protection'. Although I don't have the schematic, it looks as if all the USB connectors have a common 5V. If I power the Pi from one of these, then all the others will have their 5V off my external supply? This is fine as it is a 2A supply so hot swapping should not be a problem, but, in that case, what is the fuse actually protecting? OK, it may be the GPIO 5V pins?

               

              If I connect the USB 5V to one end of the fuse, is the other end connected to the USB 5V line? In that case I will have shorted out the fuse?

               

              Regards

               

              Mike

                • Re: Powering via the USB ports
                  John Beetem

                  Mike Bolton wrote:

                   

                  You suggest connecting the +5V from the USB connector to end 1 of the fuse, to give 'protection'. Although I don't have the schematic, it looks as if all the USB connectors have a common 5V. If I power the Pi from one of these, then all the others will have their 5V off my external supply? This is fine as it is a 2A supply so hot swapping should not be a problem, but, in that case, what is the fuse actually protecting? OK, it may be the GPIO 5V pins?

                   

                  If I connect the USB 5V to one end of the fuse, is the other end connected to the USB 5V line? In that case I will have shorted out the fuse?

                  Just to be clear, I'm using the partial schematics published here at element14: http://www.element14.com/community/docs/DOC-68376/l/raspberry-pi-b-v12-schematic.

                   

                  The fuse is protecting RasPi's SoC, DRAM, and everything else powered from 5V (or lower voltages generated by U3).  The fuse is protecting them from an overvoltage condition on the power input.  For example, suppose a cheap external power supply connected to the Micro USB power input jack decided to lose regulation and instead of producing 5V +/- .25V it produced 8V.  Well, this would probably destroy U3 which could short out and supply that same 8V to the SoC and LAN9514 and destroy the chips on the board.

                   

                  What's supposed to happen instead is that Zener diode D5 prevents 5V from going above 5V (plus a safe margin).  However, that erroneous 8V supply could produce a lot of current and if D5 is dropping 5V with too much current it will heat up and destroy itself.  Polyfuse F1 prevents this from happening: if there's more than 2A going through F1, it heats up and becomes more resistive, so that the current drops to a safe level before D5 gets too hot.

                   

                  Similarly, if you hook up a 5V supply backwards, D5 conducts with a voltage drop less than 1V.  Again, if there's too much current F1 heats up and turns into a resistor.

                   

                  Now, if you hook up your USB +5V power supply to RasPi's 5V at the GPIO connector, if your supply misbehaves and turns on D5 there's nothing to protect D5 from overheating and starting a fire (or desoldering itself).  Hooking up USB +5V to the F1 fuse input allows F1 to do its job and product RasPi from a bad power supply.

                   

                  Addressing your other questions:

                   

                  1.  I suspect that all the USB +5V pins are connected.  You can verify that with an Ohmmeter.

                   

                  2.  If you add a jumper from USB +5V to F1 pin 1, you're not shorting out F1.  There must be a diode or "ideal diode" circuit between RasPi's main 5V rail and USB +5V.  Otherwise you'd be able to back-power.  So here's your current path: Your USB +5V goes to F1 pin 1, which goes through F1 and Q3 to power RasPi's 5V rail.  However, there will be a small voltage drop across F1 and Q3, so the 5V rail will be less than USB +5V.  This means the diode between the 5V rail and USB +5V won't turn on, and the 5V rail won't power the other USB ports.  Your USB +5V source will do that instead because it's a higher voltage than the 5V rail.

                  1 of 1 people found this helpful
                • Re: Powering via the USB ports
                  gdstew

                  According to the USB spec. hubs are not supposed to "back power" at all. They do supply power to the USB devices connected to them. That power is supplied to the

                  hub either through the computer USB interface (the Pi) or through and external power supply connected to the hub, but the hub is NOT supposed to supply power to the

                  computer USB interface ( the Pi) connected to it.

                    • Re: Powering via the USB ports
                      John Beetem

                      Gary Stewart wrote:

                       

                      According to the USB spec. hubs are not supposed to "back power" at all. They do supply power to the USB devices connected to them. That power is supplied to the hub either through the computer USB interface (the Pi) or through and external power supply connected to the hub, but the hub is NOT supposed to supply power to the

                      computer USB interface ( the Pi) connected to it.

                      This is true.  However, there are lots of cheap hubs out there that do back-power even though they're not supposed to.  And, there are devices like the Motorola Atrix Lapdock that deliberately back-power even through they otherwise behave like hubs.

                       

                      RasPi Model B rev 1.0 misbehaved in a strange way with a back-powering hub.  Rather than trying to explain to thousands of users that their hubs were misbehaving, RasPi Model B rev 2.0 eliminated the USB fuses that prevented back-powering.  Unfortunately, this made USB hot-swapping fail more often.  RasPi Model B+ fixes hot-swapping (how well I don't know), and as a side-effect loses back-powering.  It would be awfully nice if they'd release the schematics so we can understand exactly what's going on instead of having to guess.

                        • Re: Powering via the USB ports
                          mcb1

                          John

                          I managed to download the full schematic shortly after launch.

                           

                          Sadly I can't attach it, but I'll send it to you.

                           

                          Mark

                           

                          edit

                          I did find the B 'v2' RPi version here

                          the B ver1.0 seems to be here

                          It looks like the other B+ schematics have been removed, which begs the question WHY.

                          If they were not 100% accurate, then surely do an update, don't just delete them.

                            • Re: Powering via the USB ports
                              Problemchild

                              Do we have a set of Poly Fuses back in line preventing the back power scenario???

                                • Re: Powering via the USB ports
                                  gdstew

                                  John Alexander wrote:

                                   

                                  Do we have a set of Poly Fuses back in line preventing the back power scenario???

                                   

                                  Edited to:  How do they prevent back power from the USB hub ? As I understand it the USB interface(s) are are now allowed to supply enough current to run the Pi so any the poly fuse would have to allow for this

                                  and meet the USB host specification for 5V +- 5%. The switching power supply should be able to operate within this 5V range.

                                   

                                  Also I am more that a little miffed that full schematics of the B+ have not been released and I have no idea why anybody at the Raspberry Pi thinks this is a good idea. The ones that have been released do show

                                  most of the changes with the notable exception of any of new USB interface circuits, components or connectors. I have read one reference that says there is at least one more GPIO pin being used to control the

                                  amount of current the USB ports can provide but without schematics I can not verify this. There are several "new" components between the USB interface chip and the GPIO connector (U13, D3, Q4 among others)

                                  that are NOT documented and at least one connection to Q4 appears to go back to BCM2835 so supplying power through the USB port may not be a good idea.

                                   

                                  John,

                                   

                                  Yes there are cheap USB hubs that back power, however as a general rule to good engineering practices I would not use any device that blatantly disregards an important part of any universally recognized

                                  specification, especially one that could cause damage to the equipment it is connected to or to itself. None of the USB hubs I own do this and if one did I would throw it away (at least it would have been

                                  cheap ).

                            • Re: Powering via the USB ports
                              mikebolton

                              Gary

                               

                              Yes, I know the USB specs well. This is fine for 'ordinary' PC and powered hubs etc.

                              However, the reason I bought a Pi B+ is not as a 'computer' but a small, intelligent board suited to embedded applications. It is very easy to build  a Pi into to my system but I couldn't build in a laptop, notebook, tablet etc at all. I already have power for the 'system' and the 5V is most easily provided from my USB to system (CAN bus) module. Hence why I want to power the Pi off its USB connector. From the Forum discussion, I am not the only one.

                               

                              Still not worked out how to talk to my system via a USB port on my Pi.

                               

                              I know this is 'off topic' but why is the Pi so slow at basic tasks like connecting via its Ethernet port? With a 700MHz ARM core and plenty of fast RAM it should be no worse than a Pentium running XP at 1100MHz, but is is many times slower (tediously so) in my case.

                               

                              Would RISC-OS be better?

                               

                              Mike

                                • Re: Powering via the USB ports
                                  Problemchild

                                  Don't know why it's slower ...In fact what aspect is slow Mike ..Maybe because of it's USB implementation.

                                  I may say that many other ARM boards running Linux are indeed MUCH faster than the PI and drive GbE with no real problems  so I don't think the move to RiscOS will help much

                                    • Re: Powering via the USB ports
                                      mikebolton

                                      John

                                       

                                      I was just trying to set up a LAN connection using the Raspbian GUI web browser. Typed in the IP address of my LAN (actually a TP-LINK) and waited ages for an answer. I gave up in the end as it was all so slow.This has nothing to do with the USB as I wasn't using it - except for mouse and keyboard. Doing the same on my laptops, the response is effectively instant.

                                       

                                      If other boards running ARM and Linux are so much faster, then we need to ask why? Is this a Pi specific issue? The OS only takes up a bit of the available RAM so access to the SD is not an issue here. (or shouldn't be).

                                      This is getting off the original topic. Should I start another thread, or is it covered somewhere else? I am new to Pi and its Forums.

                                       

                                      Mike

                                        • Re: Powering via the USB ports
                                          Problemchild

                                          Yep I have the same problem and it seems to be very much a Pi issue as the other Arm boards I use do  not suffer from this.

                                          The Odroid U3 for example feels like a laptop in use!

                                           

                                          I do find the SDcard makes a difference so try that  see if that improves your problem.

                                           

                                          Also this is some what off your  original topic so you can create another discussion for this and probably get much more help.

                                           

                                          ...you even get more points for doing that

                                           

                                          John

                                  • Re: Powering via the USB ports
                                    mikebolton

                                    John

                                     

                                    Wiring back from the USB connectors to the 'input' end of F1 works a treat. Now powers from the USB side fine. However, the first USB cable I tried gave a voltage drop from the supply (at 5V) of 0.5V at as little as 1 amp and the red light went out. Using another (better) cable there was no measurable drop and the red light was fine. So beware of USB cables.

                                     

                                    Anyway, problem solved for me and thanks for your help.

                                     

                                    Mike

                                  • Re: Powering via the USB ports
                                    clem57

                                    Mike,   I happened to plug a Model B into a powered hub and voila the Raspberry Pi started booting. My hub is a 10 port generic USB 2.0 that I got for $11 at an electronics place. Do not know which revision B unless someone tells me how to tell... Clem

                                      • Re: Powering via the USB ports
                                        John Beetem

                                        Clem Martins wrote:

                                         

                                        Mike,   I happened to plug a Model B into a powered hub and voila the Raspberry Pi started booting. My hub is a 10 port generic USB 2.0 that I got for $11 at an electronics place. Do not know which revision B unless someone tells me how to tell... Clem

                                        You can see photos of RasPi Model B 1.0 and 2.0 at the RasPi Hardware Wiki: http://elinux.org/RPi_Hardware#Schematic_.2F_Layout

                                         

                                        The Model B 1.0 has two polyfuses F1 and F2 next to the USB connector.  They prevent the RasPi from booting reliably with back-powering.  Some users have replaced F1 and F2 with shorts or non-resettable 1A fuses, either of which allows back-powering.  There are a handful of Model B 1.0 PCBs out there manufactured with 0 Ohm jumpers replacing F1 and F2.

                                         

                                        The Model B 2.0 does not have polyfuses F1 and F2 and connects USB +5V directly to RasPi's 5V rail.  This allows back-powering, but there's no protection if USB +5V goes bad.

                                        • Re: Powering via the USB ports
                                          mikebolton

                                          Clem

                                           

                                          My problem, and original posting, was for the B+. This is significantly different to the B (any version) and doesn't allow back powering as it comes. However, adding the wire as John B suggested does solve the problem.

                                           

                                          Mike