Current Usage for a Raspberry Pi


#1

I’m designing a Raspberry Pi hat for a class that I am teaching, and am worried about power consumption. I’d built an earlier version of the hat without any problems AFAICT, but realize now that I need to take this into account. I’d called digit-key tech support, and they suggested I post this here to get a definitive answer. In case it’s not already evident, my expertise is not in EE, so I’d like someone to double-check or correct my reasoning/calculations.

First, I understand that each Raspberry Pi 3B pin should draw <16 mA, and in total < 100 mA.

My circuit has 4 LEDs with 220 ohm resistors, 2 switches, a DHT22 and a buzzer. The DHT22 draws 1.5 mA max, so it’s fine. I have a CEM1203 buzzer which draws a max current of 35 mA. Now I’d used this in an earlier class and AFAICT it didn’t do any damage … was I just lucky? I’m using the wiringPi library to drive it.

The switches have a large pulldown resistor, so I don’t think they’ll be a factor.

Finally, with the LEDs, if I have GPIO Pin >> 220 ohm Resistor >> LED >> Ground, I figure that with a total voltage drop of 3.3V, I = 3.3/220 = 15 mA mean that I’ll be OK (I might go for 330 just to make it 10 mA).

Thanks for any advice/suggestions.


#2

As I’ve been researching your question, it’s difficult to get a definitive answer to whether the overall GPIO pin current draw can be a max of 100mA or 50mA. Did you find documentation stating that it is indeed 100mA?

If it is 100mA, you should be fine. If it is 50mA, you may want to change some things.

If you haven’t looked already, take a look at the Hat requirements for the Raspberry Pi.


#3

Thanks for your reply, Curtis, I appreciate it!

I have the same problem, nobody seems to agree on the total current, which seems very odd. The consensus appears to be < 16 mA per pin, but as for overall …

  • In the “Raspberry Pi IoT in C” book, by Harry Fairhead, he says 100 mA overall for a Pi 2 or 3, 50 mA for a Pi 1,
  • In the Raspberry Pi org’s FAQs state “The GPIO pins can draw 50mA safely (note that that means 50mA distributed across all the pins: an individual GPIO pin can only safely draw 16mA)”.
  • This discussion on Stack Exchange seems to suggest that nobody knows :scream:

#4

@mprogers, from what i read, the total output current is 100mA for newer models (40 pin header) and 50mA for the older models (26 pin header)…

If only the Raspberry Pi foundation actually released a datasheet for these processors so we could actually figure it out. :wink:

Regards,


#5

PS, a lot of this is due to the 3v3 regulators on the Pi, if you isolate your io and just run your circuit off the 5v rail with your own regulator you can source a lot more current.

Regards,


#6

Thanks for your response, Robert. I think I’m just going to trust that 100mA will work … although I’m still concerned that the piezoelectric buzzer says max current is 35 mA. My students used it (a lot) last semester, and it never seemed to cause an issue.


#7

@mprogers, just to be safe, you should look at using a fet or relay to drive your piezoelectric buzzer like shown here:

https://elinux.org/RPi_GPIO_Interface_Circuits#Using_a_FET

Regards,


#8

Per-pin current limits can arise for different reasons, which typically involve temperature in some way; it’s one thing if a quoted current limit is based on meeting output voltage level specifications at temperature extremes, and another thing entirely if it’s based on the amount of current that causes the output drive circuit within the chip to reach maximum permissible temperature when the device case is at 25°C.

I suspect that the Pi leans more toward the former case; I’ve read reports of folks measuring short circuit currents at different drive strength settings, and they’re reporting numbers instead of saying that the pin or chip was rendered nonfunctional. It’d make sense for the I/O to be relatively robust, in that they’d probably not be so popular for education if they burnt out every time Johnny Q. Student made a bad connection or picked one up without ESD protection.

That the buzzer you’re using is a magnetic (and thus probably inductive) type is a possible issue; for kicks and giggles, you might want to 'scope the I/O pin in your existing direct-drive configuration and see if the voltage on it exceeds the supply rails during operation. If so, that would suggest that the inductance of the buzzer is exercising the ESD protection on the associated I/O pin, which is something preferably avoided.

At day’s end, if something works, it works. But absent an understanding of why it works, one cannot know if it will continue to do so, or what might precipitate such a change.