63

I want to start using the GPIO pins but I am worried about short circuits or using too much amperage and frying my raspi. What are the Min/Max Voltage and Current values rasppi can handle? What is the typical voltage and current? How sensitive is raspi to short circuits and things like that?


I have seen boards that are designed to 'protect' your raspi:

I don't really want to 'extend' the usefulness of my raspi I just want to protect it from getting fried by my GPIO pins. I'm intending on making a buffer circuit that will prevent my raspi from getting damaged from experimenting with the GPIO pins.

5
  • You will get a lot of wild speculation amongst the replies. While data on the pi's gpio's is limited, most modern ICs will tolerate temporary shorts between a driven output and ground, the supply rail powering it, or another output. What they often will not tolerate is even brief connection to a higher voltage supply, such as a 5v pin on the same connector. Commented Oct 16, 2012 at 4:20
  • To be safe, use a breakout board. If you don't want to buy one then it's trivial to create your own protection circuit
    – Jivings
    Commented Oct 16, 2012 at 6:59
  • Provided you aren't using extremely high speed protocols, just using 1K series resistors may be a good balance of protection and simplicity; any jury-rigged solution (especially if it has active devices requiring power) runs the risk of introducing additional places for accidental shorts... Commented Oct 16, 2012 at 16:08
  • You can refer this link elinux.org/RPi_Low-level_peripherals . this would help you. Commented Jan 11, 2013 at 6:55
  • Some additional discussion here: electronics.stackexchange.com/questions/397388/…
    – Sampo
    Commented Dec 22, 2018 at 21:19

1 Answer 1

62

TL;DR

  • This is a 3.3V device.
  • Output
    • Maximum total of all pins 50 mA.
    • Default 8 mA max per pin. (Returns to this configuration after reset.)
    • Software configurable from 2 mA to 16 mA. Do not source or sink more than what you've configured.
    • Don't drive capacitive loads.
  • Input
    • Threshold of 1.8V
    • Maximum 0.5 mA
    • Use a 6Kohm resistor to ensure that current from a 3.3V source cannot exceed 0.5 mA
      • ( 3.3V / 6000Ω = .00055A )

References

from: http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29

GPIO voltage levels are 3.3V and are not 5V tolerant. There is no over-voltage protection on the board - the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.

This is easily handled with a bidirectional logic level converter.

from: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications#rpi-gpio-input-voltage-and-output-current-limitations

GPIO pins set to input

These are 3.3 volt logic pins. A voltage near 3.3 V is interpreted as a logic one while a voltage near zero volts is a logic zero. A GPIO pin should never be connected to a voltage source greater than 3.3V or less than 0V, as prompt damage to the chip may occur as the input pin substrate diodes (shown as parasitic FETs in Figure 1) conduct. There may be times when you may need to connect them to out-of-range voltages – in those cases the input pin current must be limited by an external resistor to a value that prevents harm to the chip. I recommend that you never source or sink more than 0.5 mA into an input pin.

As @ AutomatedMike noted in the comments, you can insure this with a 2 Kohm resistor per volt. ( 3.3V / 6000Ω = .00055A )

GPIO pins set to output

The Raspberry Pi's GPIO pins are quite versatile, and you can modify many of their characteristics from software. You can turn on/off input pin hysteresis, limit output slew rate, and control source and sink current drive capability from 2 mA to 16 mA in 2 mA increments. These properties are set for the GPIO block as a whole, not on a pin-by-pin basis.


To prevent excessive power dissipation in the chip, you should not source/sink more current from the pin than its programmed limit. So, if you have set the current capability to 2 mA, do not draw more than 2 mA from the pin.


Source/sink current capability does not limit the current into or out of the pin, but only specifies the maximum current for which the output signal high/low voltage specifications will be met. If misused, output pins can be damaged by excessive current irrespective of the source/sink current programmed. After a reset, the RPi comes up with the GPIO outputs set to 8 mA drive capability.


Current sourced by the outputs is drawn from the 3.3 V supply, which can supply only 50 mA maximum. Consequently, the maximum you can source from all the GPIO outputs simultaneously is less than 50 mA. You may be able to draw transient currents beyond that limit as they are drawn from the bypass capacitors on the 3.3 V rail, but don't push the envelope!

Caution:

There are additional considerations for capacitive loads. You really should read the document that is heavily quoted here.

4
  • 5
    0.5mA seems overly conservative, and would make the RPi useless for interfacing with most sensors, which typically draw at least a couple mA. These docs say the RPi is configured by default to sink/source 8mA and can be configured to sink/source up to 16mA.
    – Cerin
    Commented Aug 31, 2015 at 16:08
  • 1
    @Cerin, you are correct that I quoted the conservative number. Did you notice that you linked to the same document that I quoted (but without the anchor)? If people want to push the envelope, they need to read that document and learn more than I am teaching here. I point them in that direction. I just don't want to be responsible if they source more than 50mA cumulatively. Commented Aug 31, 2015 at 23:14
  • 6
    The 8ma and 16ma figures refer to pins configured for output. 0.5ma is for pins configured for input. Just ensure that there's always at least (Vss * 2Kohm) resistance between Vss and the pin then no more than 0.5ma can ever flow in to the input. Commented Nov 6, 2015 at 12:05
  • What would be acceptable current limit if I connect voltage greater than 3.3V on a GPIO in output True state? (Zener diode solution in electronics.stackexchange.com/questions/353218/…) @AutomatedMike
    – Pygmalion
    Commented Feb 1, 2018 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.