schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Wed Feb 01, 2012 9:31 pm

Hi,

I'm making a microcontroller breakout board for the Pi. I plan to connect a Lipo to the breakout board, regulate the voltage to 5v, then use that to power the Pi. Like this:

LiPo –> Regulator on breakout board –> Pi GPIO 5v pin

Will it be possible to power the Rasp Pi through the GPIO 5v pin (instead of the miniUSB connection)? The wiki hardware page is ambiguous:

"Power source: 5V via Micro USB or GPIO header"

Does this mean that the GPIO 5v pin will accept 5v input or will only output 5v?

Thanks,

Schlomo

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Can you power the Pi from GPIO?

Wed Feb 01, 2012 9:58 pm

In lieu of schematics, I am providing information that has been gleaned from various comments and subject to memory distortion.

The GPIO +5V pin is connected after the polyfuse and TVS diode, but is the same power bus that drives the rest of the board. Thus it will work, but you probably want to duplicate the protection components on your own board. And it might not be a good idea as, from what I've seen, there isn't a series diode on the main power input, so if a user connects the microUSB and your board badness might happen. At least it's something you will need to deal with sanely.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 1:23 am

Error404 (love the name by the way) is spot on!  The 5V pins hidden amongst the GPIO header can be either a 5V source or Sink (that is to say it's a positive and a negative and power will just as easily flow into it as it will out of it).  If you do use it to provide power to the board A) I'm speculating that you're voiding your warranty (again that's my person guess, not something I know directly from the R-pi team) and B) You need to make very certain to make a protection circuit of your own (I'd personally do exactly what the r-pi team has done at the micro-usb power jack, but tailor the specs to your own needs)
Dear forum: Play nice ;-)

User avatar
reiuyi
Posts: 165
Joined: Sun Oct 09, 2011 4:59 pm
Contact: Website

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 11:45 am

Yes, you can.

There's such drama on avoiding the usage of the fuse which only protects the micro-USB power port. When connecting 5v to the pin directly, you are providing unlimited power to the USB port. This is only a bad thing when you expect there to flow high currents. Such high currents (anything beyond 1a I guess) will heat up the tiny internal cabling of the raspberry circuit board (eventually damaging it).

Upon regular usage of the board through microUSB, the fuse should not trip. Upon regular usage of the board through gpio, the board should not catch fire

scubaguy
Posts: 11
Joined: Wed Jan 11, 2012 2:14 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 12:32 pm

As a separate question, can I power the processing side of the RasPi from the 3v3 pin on the GPIO?  I am aware that the power side of USB wouldn't work (but would the comms side?) however, if I can find a 12V or 6V input powered hub I already have a power supply in a dead (tuner not working) Humax 9200T which I am going to repurpose  for my project which supplies 3v3, 6v and 12v

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 1:22 pm

scubaguy said:

As a separate question, can I power the processing side of the RasPi from the 3v3 pin on the GPIO?

No. The 3v3 supply is derived from 5v using an onboard regulator which won't take kindly to having 3v3 connected to its output pin.

User avatar
Gert van Loo
Posts: 2485
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 1:32 pm

scubaguy said:


As a separate question, can I power the processing side of the RasPi from the 3v3 pin on the GPIO?  I am aware that the power side of USB wouldn't work (but would the comms side?) however, if I can find a 12V or 6V input powered hub I already have a power supply in a dead (tuner not working) Humax 9200T which I am going to repurpose  for my project which supplies 3v3, 6v and 12v



Not directly. You 3V3 regulator and the 3V3 regulator on the Raspberry-Pi board will start "fighting". So if you really, really want to do that (e.g. you 3V3 regulator is a SMPS so burns less power) you have to unsolder the 3V3 regulator from the Raspberry-Pi board.

scubaguy
Posts: 11
Joined: Wed Jan 11, 2012 2:14 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 1:47 pm

Thanks for that Gert, I suspected it wouldn't be quite so simple - back to a separate voltage regulator (http://www.maplin.co.uk/1a-low.....ator-46321) ) off the 6V or 12V rails and two smoothing Caps I can rob off the Humax mainboard on a bit of veroboard then - but it does mean I won't need the powered hub

scubaguy
Posts: 11
Joined: Wed Jan 11, 2012 2:14 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 2:21 pm

Allan/Gert,

Thinking about it, why would the 3v3 regulator have issues as it wouldn't have 5v on its input side?  I only intended supplying 3v3 - or are you suggesting the 5V would come in on the output USB from the powered hub?

User avatar
Gert van Loo
Posts: 2485
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 2:27 pm

Because you can't supply only 3V3 as there is still a part of the board running of 5V!

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 2:48 pm

scubaguy said:


Allan/Gert,

Thinking about it, why would the 3v3 regulator have issues as it wouldn't have 5v on its input side?  I only intended supplying 3v3 - or are you suggesting the 5V would come in on the output USB from the powered hub?



The pass transistor used in most modern voltage regulators has an inbuilt diode between output and input. Applying a voltage to the output of the device will forward bias the diode which can lead to very high dissipation and possibly death (of the regulator, not you). In older bipolar regulators, connecting a supply to the output will reverse bias the base-emitter junction of the pass transistor which it isn't designed to handle.

Whether you get away with it or not will depend in the design of the regulator used on the board but it's generally a Bad Idea to try.

schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 3:15 pm

Ah, okay. Thanks for the clarification from error404, Abishur, and Gert.

I'm planning to use a 1.5A (3A trip) polyfuse and a 5v LDO (something like this) to convert a 3-cell LiPo input voltage (max around 11.1v) to a regulated 5v signal to power both an ATmega1284P and the Rasp Pi. Is this all the regulation needed, or would it be good to add something else?

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 3:40 pm

schlomo said:


Ah, okay. Thanks for the clarification from error404, Abishur, and Gert.

I'm planning to use a 1.5A (3A trip) polyfuse and a 5v LDO (something like this) to convert a 3-cell LiPo input voltage (max around 11.1v) to a regulated 5v signal to power both an ATmega1284P and the Rasp Pi. Is this all the regulation needed, or would it be good to add something else?



Watch the power dissipation in that regulator. With the Rasp Pi running flat out and a bit extra for the Atmel device the current consumption could be around 1A or more if you have USB peripherals connected. At 1A the regulator will need to dissipate 6W from your fully charged batteries. It will need to be mounted on a heatsink of some sort. I'd suggest you bought the 'old style' 7805 regulator with mounting hole rather than the surface mount version you linked to. Search Digikey for LM7805CT.

It's also good practice to have decoupling capacitors connected between input and ground and between output and ground close to the device to avoid the possibility of oscillation.

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 3:45 pm

There have been threads on this in the past.

I, for one, plan on desoldering/disabling the 3v3 regulator in some way and then feeding it from the GPIO port with a buck type regulator.

I believe liz posted the all or part of the power supple schematic a while ago, but I don't think it was in it's own thread and I am having trouble finding it.

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 3:48 pm

schlomo said:


Ah, okay. Thanks for the clarification from error404, Abishur, and Gert.

I'm planning to use a 1.5A (3A trip) polyfuse and a 5v LDO (something like this) to convert a 3-cell LiPo input voltage (max around 11.1v) to a regulated 5v signal to power both an ATmega1284P and the Rasp Pi. Is this all the regulation needed, or would it be good to add something else?



What you want is a switch-mode or buck regulator. They are a bit more expensive, but well worth it.

If you use that LDO to regulate a 11.1V signal, you'll be dissipating more power on the LDO than the entire RPI will be using. In fact, you'll have the same battery life that you would if you only had a 2-cell source.

schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 4:05 pm

nullstring said:


schlomo said:


Ah, okay. Thanks for the clarification from error404, Abishur, and Gert.

I'm planning to use a 1.5A (3A trip) polyfuse and a 5v LDO (something like this) to convert a 3-cell LiPo input voltage (max around 11.1v) to a regulated 5v signal to power both an ATmega1284P and the Rasp Pi. Is this all the regulation needed, or would it be good to add something else?


What you want is a switch-mode or buck regulator. They are a bit more expensive, but well worth it.

If you use that LDO to regulate a 11.1V signal, you'll be dissipating more power on the LDO than the entire RPI will be using. In fact, you'll have the same battery life that you would if you only had a 2-cell source.


Will this buck regulator work? (it doesn't have a metal heatsink tab though...)

Is there a difference between switch-mode and buck?

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 4:33 pm

schlomo said:


Will this buck regulator work? (it doesn't have a metal heatsink tab though...)

Is there a difference between switch-mode and buck?


Looks like it would. I don't typically get them in the DIP "package", but it seems fine.

http://en.wikipedia.org/wiki/B....._converter

http://en.wikipedia.org/wiki/S.....wer_supply

Buck regulators are just a subset of switch-mode regulators.

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 4:34 pm

Nullstring is right, using a linear regulator is a waste of power. A switch mode regulator like the one you linked to is way more efficient and won't need the heatsink so the lack of a tab isn't an issue.

But they are more complicated to use. Look at the data sheet - you need a handful of components as well as the regulator itself.

Something to consider if you're new to electronics.

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 4:57 pm

For what it's worth, this one looks interesting to me:

http://search.digikey.com/us/e.....ND/1816645

I wouldn't spend much more than $4.

schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Thu Feb 02, 2012 10:52 pm

This looks like the ultimate switching regulator IC:

http://www.linear.com/product/LTM8032

It's a completely integrated, 3.6-36V input, 0.8-10V/2A output, low noise regulator. No other inductors, diodes, etc are required. The only problem: costs $15 per chip! (And only available as a BGA)

User avatar
reiuyi
Posts: 165
Joined: Sun Oct 09, 2011 4:59 pm
Contact: Website

Re: Can you power the Pi from GPIO?

Fri Feb 03, 2012 12:45 am

nullstring said:


For what it's worth, this one looks interesting to me:

http://search.digikey.com/us/e.....ND/1816645

I wouldn't spend much more than $4.


Excuse me for barging in the topic once more; if you were just looking for a cheap dc-dc converter; there are plenty of ready-made circuits being sold on the internet with free shipping. Take a look at this: http://www.dealextreme.com/p/8.....ubec-45214 (dx is pretty bad, but alas) . Search for "dc converter 5v" on ebay and tick on "free shipping" (the hrd converter is a very popular design, though a bit bulky).  It makes absolutely NO sense to pay $3.41 , $6.89 or even $15 for a single component, which might need several additional components and a circuit board to put them all on. (components are really expensive when bought as a single unit).

If you were instead just learning about how a DC-DC step-up/down converter works, then my sincerest apologies for almost advertising ready-made diy products. I also still want to learn how an SMPS actually works, though the concepts are a bit difficult to grasp. Hopefully, I'll get around to it at some point

schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Fri Feb 03, 2012 1:09 am

DeliciousRaspberryCake said:


nullstring said:


For what it's worth, this one looks interesting to me:

http://search.digikey.com/us/e.....ND/1816645

I wouldn't spend much more than $4.


Excuse me for barging in the topic once more; if you were just looking for a cheap dc-dc converter; there are plenty of ready-made circuits being sold on the internet with free shipping. Take a look at this: http://www.dealextreme.com/p/8.....ubec-45214 (dx is pretty bad, but alas) . Search for "dc converter 5v" on ebay and tick on "free shipping" (the hrd converter is a very popular design, though a bit bulky).  It makes absolutely NO sense to pay $3.41 , $6.89 or even $15 for a single component, which might need several additional components and a circuit board to put them all on. (components are really expensive when bought as a single unit).


DeliciousRaspberryCake (now you're making me hungry... ), you're completely right. I was browsing around for some pre-made conversion circuits, and it seems like I'll want to use them instead of engineering my own solution on a PCB. A UBEC seems like the perfect device: it's cheap, efficient, and replaceable. I was looking at this one on Pololu (pretty much the same thing as the DX link but it looks better made):

http://www.pololu.com/catalog/.....oduct/2177

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Can you power the Pi from GPIO?

Fri Feb 03, 2012 1:16 am

DeliciousRaspberryCake said:

It makes absolutely NO sense to pay $3.41 , $6.89 or even $15 for a single component, which might need several additional components and a circuit board to put them all on. (components are really expensive when bought as a single unit).




You're advocating buying cheap, 'optimistically' specified (5A out of a 3A regulator with a weedy little pass diode? yeah right), under-engineered components from unscrupulous counterfeiters, or at least relentless corner-cutters, and bringing allcaps into your argument as if anyone that disagrees is an idiot?
OP is already designing a board. They don't want another board to attach to their own board, they want an integrated solution. Maybe you missed that.
Most of these designs are bottom-dollar, they will be inefficient, which is not something you want in a battery supply.
It takes weeks and weeks to get stuff from Asia. I can have parts from DigiKey or Future in my hands in 24 hours, along with everything else I need to prototype my breakout project.
And really it's not very much more expensive at all. You can do a proper 90+% efficiency SMPS for this application with about $5 worth of parts.

schlomo
Posts: 19
Joined: Tue Jan 31, 2012 3:14 am

Re: Can you power the Pi from GPIO?

Fri Feb 03, 2012 1:25 am

error404 said:


DeliciousRaspberryCake said:


It makes absolutely NO sense to pay $3.41 , $6.89 or even $15 for a single component, which might need several additional components and a circuit board to put them all on. (components are really expensive when bought as a single unit).






You're advocating buying cheap, 'optimistically' specified (5A out of a 3A regulator with a weedy little pass diode? yeah right), under-engineered components from unscrupulous counterfeiters, or at least relentless corner-cutters, and bringing allcaps into your argument as if anyone that disagrees is an idiot?
OP is already designing a board. They don't want another board to attach to their own board, they want an integrated solution. Maybe you missed that.
Most of these designs are bottom-dollar, they will be inefficient, which is not something you want in a battery supply.
It takes weeks and weeks to get stuff from Asia. I can have parts from DigiKey or Future in my hands in 24 hours, along with everything else I need to prototype my breakout project.
And really it's not very much more expensive at all. You can do a proper 90+% efficiency SMPS for this application with about $5 worth of parts.


You're right… I am looking for an integrated solution that is efficient. But would it be better to regulate the ~12 volt/2A power directly on the board, or would that generate too much heat/electrical noise? I like the UBEC idea because the regulator is replaceable, so it something burns out, you can easily get a new one. To make sure the output voltage is 5 volts from such cheap regulators, I would probably want to put another regulation circuit on the microcontroller PCB itself (maybe something like a zener diode or a LDO?). But if you get a more expensive UBEC regulator (like the one at Pololu) with 80+% efficiency, that should be good enough, right?

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Can you power the Pi from GPIO?

Fri Feb 03, 2012 2:29 am

If you properly design an efficient regulator, there is no problem putting it on the board with everything else; after all this is what pretty much every bit of consumer electronics built in the last 10 years does.

It's pretty hard to destroy a modern switchmode power supply; they pretty much all have short-circuit and cycle-by-cycle current limiting built in. It's not just going to randomly die, and these things can take a fair amount of abuse. I wouldn't worry too much about that, probably the only likely way to kill a decent SMPS is to backfeed a higher voltage into the output. Avoid doing that - also pretty easy to protect against, use a TVS, polyfuse and series diode for any power outputs.

For powering your microcontroller you're probably going to want to use 3.3V anyway so that it's compatible with the Pi's GPIO. Just use an LDO for that. Run the Pi directly from the SMPS though.

Just to prove I'm not crazy, I spent a few minutes poking around at WeBench and some parts suppliers and came up with a design based around LM3150, 7-14Vin 5Vout @ 1.7A. Efficiency > 90% for all loads > 350mA and > 94% at > 1A. Total BOM cost for a single copy of this circuit is $5.45 (however you won't save a huge amount in quantity, it's still $4.95 at qty 100). This is all surface-mount, but accessible packages like SO8 and 0805 that anyone can do easily by hand.

Return to “General discussion”