Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

GPIO limits

Fri Jul 10, 2015 5:27 pm

Hello, I have some questions with gpio mA limits. I read that every digital GPIO have 16 mA limit, aren't I? 3,3V have 50 mA, yes?
And can I connecting LED (with a resistance of course) only to digital gpio?

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO limits

Fri Jul 10, 2015 5:30 pm

The overall limit for the 3V3 rail is not specified (for the A+/B+/Pi2). The limit for individual gpios is still 16mA.

What else would you want to connect a LED to?

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: GPIO limits

Fri Jul 10, 2015 5:35 pm

The combined total limit of all GPIO's is limited to 50mA. Each GPIO is limited to 15mA.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 5:39 pm

What else would you want to connect a LED to?
Else I want connect motor but it is designed for 5 volts... And speaker I think it can be connect via digital gpio too? Can I connect speaker directly (without anything)?

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 5:40 pm

The combined total limit of all GPIO's is limited to 50mA. Each GPIO is limited to 15mA.
If every led consumption 10 mA I can connect only five leds, yes?

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: GPIO limits

Fri Jul 10, 2015 6:03 pm

Ivan219 wrote:
What else would you want to connect a LED to?
Else I want connect motor but it is designed for 5 volts... And speaker I think it can be connect via digital gpio too? Can I connect speaker directly (without anything)?
There are very few motors which can do anything useful when run from 3.3 volts and not allowed to consume more than 15 mA. And any motor with brushes is liable to produce sparks which if they don't damage the SoC are likely to disrupt it.

Most speakers are low impedance, usually between 4 and 32 ohms. 32 ohms and 3.3 volts gives 100 mA.

So a motor or speaker is not suitable for direct connection to a GPIO.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 7:13 pm

And can I connect motor (from toy-car) to 5 volts gpio?
The limit in the amount of 50 mA applies to all pins gpio or for digital only?
I also had in mind the speaker of the toy car, small in size.
Last edited by Ivan219 on Fri Jul 10, 2015 7:17 pm, edited 1 time in total.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO limits

Fri Jul 10, 2015 7:15 pm

Ivan219 wrote:And can I connect motor (from toy-car) to 5 volts gpio?
The limit in the amount of 50 mA applies to all pins gpio or for digital only?
The Pi has no 5V gpios.

All Pi gpios are digital.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 7:21 pm

The second connector is not 5 volt? Can I connect motor to 5 volt and next to gpio?
Attachments
cb22d01a5de84cbaaad999919a8a04bf.jpg
Second connector
cb22d01a5de84cbaaad999919a8a04bf.jpg (18.88 KiB) Viewed 1801 times

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO limits

Fri Jul 10, 2015 7:25 pm

Ivan219 wrote:The second connector is not 5 volt? Can I connect motor to 5 volt and next to gpio?
It is 5V. It is NOT a gpio.

User avatar
jojopi
Posts: 3268
Joined: Tue Oct 11, 2011 8:38 pm

Re: GPIO limits

Fri Jul 10, 2015 7:28 pm

Ivan219 wrote:If every led consumption 10 mA I can connect only five leds, yes?
That is a correct calculation. However, you should find that modern LEDs are acceptably bright on a lot less than 10mA.

For red, yellow, and green LEDs try starting with a 1kΩ series resistor. Blue and white drop more voltage, so try 470Ω. This should keep the current below 2mA each, and then you can use as many LEDs as there are GPIOs.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 7:31 pm

jojopi wrote:
Ivan219 wrote:If every led consumption 10 mA I can connect only five leds, yes?
That is a correct calculation. However, you should find that modern LEDs are acceptably bright on a lot less than 10mA.

For red, yellow, and green LEDs try starting with a 1kΩ series resistor. Blue and white drop more voltage, so try 470Ω. This should keep the current below 2mA each, and then you can use as many LEDs as there are GPIOs.
Thank you for information!
Last edited by Ivan219 on Fri Jul 10, 2015 8:04 pm, edited 1 time in total.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 7:32 pm

It is 5V. It is NOT a gpio.
Ok, I realized. No ways connect 5volts-motor-gpio, yes?

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: GPIO limits

Fri Jul 10, 2015 8:42 pm

no, you cannot connect -anything- between the 5V power pin, and a GPIO, as this -will- leak 5V to the GPIO, and the PI does not tolerate 5V (more than 3.3V) on its GPO pins, as this will cause permeant damage to your PI to the level that the PI will be totally destroyed!

The correct way to control devices needing more than 3V3 or more than 15mA, is to use the GPIO to switch on a transistor, the transistor can then switch a 5V (or 12V) signal.

There are many examples in this forum and in books and magazines, like the free magpi magazine, for you to learn from.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 9:17 pm

Ok, I understand you. And the last question - I can't connect 5v to ground (NO gpio), yes?

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO limits

Fri Jul 10, 2015 9:58 pm

Ivan219 wrote:Ok, I understand you. And the last question - I can't connect 5v to ground (NO gpio), yes?
If you connect 5V0 to GND you'll create a short circuit across your power supply. The RPi will instantly shutdown (due to lack of power) and the power supply and cable will start to get hot. Do it for long enough and you'll cause serious damage to everything.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: GPIO limits

Fri Jul 10, 2015 10:05 pm

DougieLawson wrote:
Ivan219 wrote:Ok, I understand you. And the last question - I can't connect 5v to ground (NO gpio), yes?
If you connect 5V0 to GND you'll create a short circuit across your power supply. The RPi will instantly shutdown (due to lack of power) and the power supply and cable will start to get hot. Do it for long enough and you'll cause serious damage to everything.
Yes, I know. I mean connect 5v-motor-ground.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO limits

Fri Jul 10, 2015 10:12 pm

If you do that you'll risk destroying your RPi with the back EMF when the motor stops. You'll risk corrupting your SDCard if the motor draws more current than available and starves your RPi.

Use an entirely separate supply for the motor.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

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

Re: GPIO limits

Sat Jul 11, 2015 11:01 pm

Ivan , I suggest you get a book on simple basic electronics
in your language, and do some basic circuit building
You will then have a better understanding of of what
you want to do, You will learn how to apply Ohms Law.
Start with a bread board and a power supply.
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Return to “Beginners”