generalge
Posts: 6
Joined: Fri Sep 29, 2017 9:32 pm

Current draw from GPIO pins

Fri Sep 29, 2017 9:50 pm

Hi,
I'm currently building a smart mirror with an RPi and want to connect some different sensors to it. I connected one of them to the 5 volt power rail and mesured the currend, which was about 15mA (I want to connect 3 of these besides some others). I tryed to find out how much current can be savley drwan off the GPIO pins and found out that it's only 50mA total and 16mA per pin for the 3.3v rail. Is the 5v rail also bound to these values or can those pins deliver more power? And if they can how much in total and per pin? And are the 3.3v and the 5v rail related?

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Current draw from GPIO pins

Sat Sep 30, 2017 1:23 am

generalge wrote:
Fri Sep 29, 2017 9:50 pm
Hi,
I'm currently building a smart mirror with an RPi and want to connect some different sensors to it. I connected one of them to the 5 volt power rail and mesured the currend, which was about 15mA (I want to connect 3 of these besides some others). I tryed to find out how much current can be savley drwan off the GPIO pins and found out that it's only 50mA total and 16mA per pin for the 3.3v rail. Is the 5v rail also bound to these values or can those pins deliver more power? And if they can how much in total and per pin? And are the 3.3v and the 5v rail related?
Which RPi board?
If RPi 3B, then when powered by the micro USB port, the 'polyfuse' limits the total current draw to 2.6A

So:
2.6A - (Whatever the RPi uses + USB devices + whatever is connected to the other GPIO pins + camera if present) = available current

(Note that USB devices are limited to no more than 1.2A by USB control circuits)

You must not allow the system to draw more than 2.6A else the RPi 3B will become unstable.

The power supply needs to be able to provide 2.6A+ AND maintain 5.00V +- 5%

The 3V3 rail is directly powered from the 5V rail, so the current used by 3V3 is part of 'Whatever the RPi uses' in the above equation.

I have not seen any specs on the 3V3 rail and there have been many discussions about this... It appears that the 3V3 power supply rail is configured for 1A output. So available 3V3 currant = 1A - whatever on the RPi uses 3V3.

If RPi Zero then that board does not have a fuse so the only limit is the external power supply or when the board traces melt and burn up.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

generalge
Posts: 6
Joined: Fri Sep 29, 2017 9:32 pm

Re: Current draw from GPIO pins

Sat Sep 30, 2017 1:14 pm

Thanks,
yes I have an Pi3 model B, forgot to mention that. It's powered by a 2.1A 5,25V power supply.
I'm assuming that the Pi is not using more than 1A and that my senros are using about 100mA in total, so connecting them all in series to one 5V pin is fine? The downside of that would be that the sensors are always on even when the Pi is shut down.
Would connecting each of them to one 3.3v GPIO pin (~15mA per pin) would work safely aswell?
I don't think that the system will reach the capacety of the power supply, I'm more concerned to exeed the capacety of a single pin or the rail.

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Current draw from GPIO pins

Sat Sep 30, 2017 3:44 pm

generalge wrote:
Sat Sep 30, 2017 1:14 pm
Thanks,
yes I have an Pi3 model B, forgot to mention that. It's powered by a 2.1A 5,25V power supply.
I'm assuming that the Pi is not using more than 1A and that my senros are using about 100mA in total, so connecting them all in series to one 5V pin is fine? The downside of that would be that the sensors are always on even when the Pi is shut down.
Would connecting each of them to one 3.3v GPIO pin (~15mA per pin) would work safely aswell?
I don't think that the system will reach the capacety of the power supply, I'm more concerned to exeed the capacety of a single pin or the rail.
Please do not connect anything to your RPi GPIO until you know exactly what you are doing and how the sensors should be connected.
Post a link to the sensor datasheet or sellers web site.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

generalge
Posts: 6
Joined: Fri Sep 29, 2017 9:32 pm

Re: Current draw from GPIO pins

Sat Sep 30, 2017 6:44 pm

I have:

1x Motion detector
http://www.ebay.de/itm/10Pcs-HC-SR501-I ... SwA2hZx3UF

3x reflex photocell
http://www.ebay.de/itm/Infrarot-IR-Line ... Sw8w1X3DqV

1x temperature/humidity sensor
http://www.ebay.de/itm/DHT22-AM2302-Tem ... Swo-RZt8k5

1x Power Button with LED, I can't find the right one online but the LED drwas just 2mA and has a smart resisor circuit build in.

boyoh
Posts: 1342
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Current draw from GPIO pins

Sun Oct 01, 2017 3:32 pm

Advice If you think your project is going to take the Pi over It's power out/put capability
Just use the Pi to switch buffer stages, sutch as transistors and opto isolators as voltage
levelers and current amplifies, It is not advisable to drive the Pi over It's limits, as this
will create Instability in your project The more current the Pi uses, leaves less current
to drive your project,
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

generalge
Posts: 6
Joined: Fri Sep 29, 2017 9:32 pm

Re: Current draw from GPIO pins

Tue Oct 03, 2017 6:05 pm

I was thinking about somthing similar but that might just overcomplicate things. I'll hook the sensors up in parallel to the 5v power pin.
Is it possible to cut the load on a single pin when I connect the other 5v pin aswell (parallel) and two ground (instead of 1) pins?

User avatar
davidcoton
Posts: 4195
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Current draw from GPIO pins

Tue Oct 03, 2017 8:30 pm

generalge wrote:
Tue Oct 03, 2017 6:05 pm
I was thinking about somthing similar but that might just overcomplicate things. I'll hook the sensors up in parallel to the 5v power pin.
Is it possible to cut the load on a single pin when I connect the other 5v pin aswell (parallel) and two ground (instead of 1) pins?
The 5V supply pins are well able to supply the current you need -- whether from one pin or two pairs is largely a matter of convenience. Some people manage to power their Pis using a single pair of pins for voltage input (which bypasses the polyfuse, so counts as poor practice in my book, unless alternative protection is provided).
The GPIO pins (at 3V3) are not intended for powering sensors, nor is the 3V3 supply really suitable (amongst other reasons, you could introduce noise on the 3V3 rail).
But you must make sure that the signals from sensors powered at 5V are not going to put more than 3V3 on your Pi GPIO inputs.
If you do want to switch the sensors off (whether the Pi is powered, running or not) then use a relay or possibly a MOSFET in the supply to them, controlled by a GPIO preferably via an opto-isolator.
Signature retired

piras77
Posts: 148
Joined: Mon Jun 13, 2016 11:39 am

Re: Current draw from GPIO pins

Wed Oct 04, 2017 6:13 am

davidcoton wrote:
Tue Oct 03, 2017 8:30 pm
The GPIO pins (at 3V3) are not intended for powering sensors, nor is the 3V3 supply really suitable (amongst other reasons, you could introduce noise on the 3V3 rail).
What do you mean by "intended"? Do you mean your personal opinion? Insofar as I see it, you can do whatever you want as long as you meet the device's capabilities. If someone would like to power a sensor from a GPIO pin (for whatever reasons), don't do it because it is not "intended"?!

Unfortunately, the RPF is very shy providing related datasheets. The (unofficial) pad-control datasheet says you can draw up to 16mA from a GPIO pin. This datasheet was published in 2012, so it relates to the earliest Pi models, with a weak 3v3 power supply. Hence it also states: "If you load each pin with 16mA the total current is 272mA. The 3V3 supply will collapse under that!". This seems to be no longer true for the B+ models.
klricks wrote:
Sat Sep 30, 2017 1:23 am
I have not seen any specs on the 3V3 rail and there have been many discussions about this... It appears that the 3V3 power supply rail is configured for 1A output. So available 3V3 currant = 1A - whatever on the RPi uses 3V3.
...exactly. Which also means, in my experience, that your are safe by diverting, let's say 500mA. And there are so many projects you find on the Internet that do so.

Still, I don't disagree with anything you said. There are many ways to make the Pi safer (e.g. by using a dedicated power supply for your attached devices). However, since the RPF provides so little data, I think they "intend" to let the user check the Pi's limits. ;-) /SCNR

User avatar
rpdom
Posts: 15411
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 6:31 am

piras77 wrote:
Wed Oct 04, 2017 6:13 am
davidcoton wrote:
Tue Oct 03, 2017 8:30 pm
The GPIO pins (at 3V3) are not intended for powering sensors, nor is the 3V3 supply really suitable (amongst other reasons, you could introduce noise on the 3V3 rail).
What do you mean by "intended"? Do you mean your personal opinion? Insofar as I see it, you can do whatever you want as long as you meet the device's capabilities. If someone would like to power a sensor from a GPIO pin (for whatever reasons), don't do it because it is not "intended"?!
The 3.3V power pins on the GPIO connector can provide a lot more than 16mA, if that is what you are talking about. The actual GPIO pins can't.

piras77
Posts: 148
Joined: Mon Jun 13, 2016 11:39 am

Re: Current draw from GPIO pins

Wed Oct 04, 2017 6:38 am

The reference to the pad-control datasheet should have made it clear (by context).

However, if you like, you may want to make a future reference: GPIO Pin = BCM's SOC GPIO Pin on the Pin Header; Power Pin = Power Supply on the Pin Header

User avatar
rpdom
Posts: 15411
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 6:55 am

piras77 wrote:
Wed Oct 04, 2017 6:38 am
The reference to the pad-control datasheet should have made it clear (by context).

However, if you like, you may want to make a future reference: GPIO Pin = BCM's SOC GPIO Pin on the Pin Header; Power Pin = Power Supply on the Pin Header
I am fully aware of that. Quite a few people aren't and your reference to power supplies implied that you don't understand the relationship.

However, the pad control (semi-official) datasheet has nothing to do with the (weak) power supplies. It is to do with what the interface on the SoC is designed to handle. That hasn't changed. The GPIO circuitry is the same in all Pi models.

User avatar
davidcoton
Posts: 4195
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 5:13 pm

piras77 wrote:
Wed Oct 04, 2017 6:13 am
davidcoton wrote:
Tue Oct 03, 2017 8:30 pm
The GPIO pins (at 3V3) are not intended for powering sensors, nor is the 3V3 supply really suitable (amongst other reasons, you could introduce noise on the 3V3 rail).
What do you mean by "intended"? Do you mean your personal opinion? Insofar as I see it, you can do whatever you want as long as you meet the device's capabilities. If someone would like to power a sensor from a GPIO pin (for whatever reasons), don't do it because it is not "intended"?!
GPIO =General Purpose Input Output. That implies a particular use. Powering sensors is not normally part of the role of input/output. Of course, you can draw 16mA from one or more pins, up to the recommended maximum of 50mA (The 3V3 PSU may have been improved, the current path through the SOC hasn't. Exceed 50mA total friom GPIO pins at your Pi's peril).
Yes, my personal opinion, informed by many years of engineering design -- interpreting specs, and finding the pitfalls of doing something "unconventional". Sometimes it works, sometimes it doesn't, for reasons that published data sheets may or may not make clear. I gave you one reason for that opinion. Please feel free to ignore me, that is your privilege.
Signature retired

piras77
Posts: 148
Joined: Mon Jun 13, 2016 11:39 am

Re: Current draw from GPIO pins

Wed Oct 04, 2017 5:28 pm

All I said was 16mA from a GPIO pin and 500mA from the power supply pins.
davidcoton wrote:
Wed Oct 04, 2017 5:13 pm
you can draw ... from one or more pins, up to the recommended maximum of 50mA ... through the SOC
That would be quite interesting. Do you have a source for that?

User avatar
davidcoton
Posts: 4195
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 5:34 pm

Memory.
Signature retired

gordon77
Posts: 4226
Joined: Sun Aug 05, 2012 3:12 pm

Re: Current draw from GPIO pins

Wed Oct 04, 2017 5:37 pm

piras77 wrote:
Wed Oct 04, 2017 5:28 pm
All I said was 16mA from a GPIO pin and 500mA from the power supply pins.
davidcoton wrote:
Wed Oct 04, 2017 5:13 pm
you can draw ... from one or more pins, up to the recommended maximum of 50mA ... through the SOC
That would be quite interesting. Do you have a source for that?

This seems to be unclear, this link shows the 50mA limit on the 3.3v supply BUT this may only apply to early Pi models?


https://elinux.org/RPi_Low-level_peripherals#Power_pins


https://raspberrypi.stackexchange.com/q ... imitations

There appears to still be a limit of 16mA per pin.
Last edited by gordon77 on Wed Oct 04, 2017 5:44 pm, edited 1 time in total.

User avatar
Burngate
Posts: 6059
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Current draw from GPIO pins

Wed Oct 04, 2017 5:42 pm

davidcoton wrote:
Wed Oct 04, 2017 5:13 pm
GPIO =General Purpose Input Output. That implies a particular use.
I would disagree. General purpose means, to me, no particular use at all, do what you want.
Powering sensors is not normally part of the role of input/output. Of course, you can draw 16mA from one or more pins, up to the recommended maximum of 50mA (The 3V3 PSU may have been improved, the current path through the SOC hasn't. Exceed 50mA total friom GPIO pins at your Pi's peril).
Yes, my personal opinion, informed by many years of engineering design -- interpreting specs, and finding the pitfalls of doing something "unconventional". Sometimes it works, sometimes it doesn't, for reasons that published data sheets may or may not make clear. I gave you one reason for that opinion. Please feel free to ignore me, that is your privilege.
The GPIOs have limitations as to what they can supply or receive, because the real world has shortcomings, and so the Pi has been designed with power supplies that can provide a bit more. But they're still limited.
It's up to the user to take those limitations into account, or live with the consequences.

The user can attempt to drive a 3W LED or a hair dryer from a GPIO, and will fail.
Or the user can use a GPIO to control a 3W LED using the 5v rail, and succeed. But doing the same with a hair dryer will still fail.

But it's still up to the user, and the GPIO is still general purpose.

User avatar
davidcoton
Posts: 4195
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 7:06 pm

Burngate wrote:
Wed Oct 04, 2017 5:42 pm
But it's still up to the user, and the GPIO is still general purpose.
The important bit is "input output" That implies signals, data, etc. Not power. If they were intended to supply power, they should be called GPP -- "General Purpose Power".
A family car might be described as "General Purpose" in that it does a range of things, but specialises in none. That doesn't mean it's good for driving across the Channel without a boat underneath it.
Signature retired

boyoh
Posts: 1342
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Current draw from GPIO pins

Wed Oct 04, 2017 7:22 pm

" GENERALGE" ORIGINAL POSTER

From all the answers to your post Are you any wiser about the Out put current capability of the Raspberry Pi
There are to many IFF's and Butts no clear answers.

Just take my advice and just use the Pi to switch buffer stages to switch transistors / Opto Isolators/ Relays from
a secondary power supply, Just make sure any feed back from your project to the Pi IN/Puts are through opto Isolators,

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
Burngate
Posts: 6059
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Current draw from GPIO pins

Thu Oct 05, 2017 9:20 am

davidcoton wrote:
Wed Oct 04, 2017 7:06 pm
Burngate wrote:
Wed Oct 04, 2017 5:42 pm
But it's still up to the user, and the GPIO is still general purpose.
The important bit is "input output" That implies signals, data, etc. Not power. If they were intended to supply power, they should be called GPP -- "General Purpose Power".
A family car might be described as "General Purpose" in that it does a range of things, but specialises in none. That doesn't mean it's good for driving across the Channel without a boat underneath it.
I take your point.
I suppose we're arguing about the number of angels when we should be considering the size of the pin-head. Or something similar.

boyoh
Posts: 1342
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Current draw from GPIO pins

Thu Oct 05, 2017 7:56 pm

Burngate wrote:
Thu Oct 05, 2017 9:20 am
davidcoton wrote:
Wed Oct 04, 2017 7:06 pm
Burngate wrote:
Wed Oct 04, 2017 5:42 pm
But it's still up to the user, and the GPIO is still general purpose.
The important bit is "input output" That implies signals, data, etc. Not power. If they were intended to supply power, they should be called GPP -- "General Purpose Power".
A family car might be described as "General Purpose" in that it does a range of things, but specialises in none. That doesn't mean it's good for driving across the Channel without a boat underneath it.
I take your point.
I suppose we're arguing about the number of angels when we should be considering the size of the pin-head. Or something similar.
general-purpose Synonyms
Synonyms
all-around (also all-round), all-purpose, catholic, general-purpose, unlimited, unqualified, unrestricted, unspecialized
Antonyms
limited, restricted, specialized, technical
Related Words
mixed-use, multipurpose; broad, wide; nonspecific, unspecified, vague
Near Antonyms
bounded, circumscribed, confined, definite, demarcated, determinate, finite, qualified; dedicated
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

Re: Current draw from GPIO pins

Thu Oct 05, 2017 8:26 pm


generalge
Posts: 6
Joined: Fri Sep 29, 2017 9:32 pm

Re: Current draw from GPIO pins

Thu Oct 05, 2017 8:58 pm

Well that's been a lot of discussion :D
I ended up just connecting all the sensors in parallel to one 5v pin and one ground pin and nothing cought fire yet, so I'm might be on a good way.
I'll add a relais later on to cut power when the pi is shut down.

Thx for all the replys, it helped a lot! :)

gordon77
Posts: 4226
Joined: Sun Aug 05, 2012 3:12 pm

Re: Current draw from GPIO pins

Fri Oct 06, 2017 2:56 pm

mad-hatter wrote:
Thu Oct 05, 2017 8:26 pm
This site explains a lot!

https://www.scribd.com/doc/101830961/GPIO-Pads-Control2
Is " The raspberry-Pi 3V3 supply was designed with a maximum current of ~3mA per GPIO pin. If you load each pin with 16mA the total current is 272mA. The 3V3supply will collapse under that " still True on the latest Pi's? Hasn't a larger regulator been added?

User avatar
rpdom
Posts: 15411
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Current draw from GPIO pins

Fri Oct 06, 2017 3:26 pm

Not just a larger (and more efficient) regulator, but the fuse rating and the power supply recommendation have been increased as well.

Return to “Beginners”