I was wondering if it is possible to connect an LED directly to one of the GPIO pins of the Pi? The reason I ask is that, I have read from many sources that if I am not using some sort of break out board, then I run the risk of breaking or frying the pi entirely. And do the GPIO pins provide enough current to power a single LED assuming that it is okay and safe to connect an LED directly to one of the GPIO pins directly?

2 Answers
2

You can connect an LED directly to the GPIO pins (it will provide enough current).

However, you probably shouldn't do this for a couple of reasons, You can fry the Pi as you state, and without a current limiting resistor you will signifcantly reduce the life of the LED. This does not mean you need to buy a breakout board to run a single LED. You can use a simple protection circuit to protect your PI. This article has a good discussion on protecting your Pi's GPIO from damage.

If you plan to experiment beyond a simple LED a breakout board that includes GPIO Protection can be a good investment and time saver.

Just in case: for 2.25V and 20mA LED, that works out at about 50 ohms, is that right?
–
BenjolDec 18 '12 at 12:46

The pin can only source or sink 16ma max, 8ma by default.. You will need a buffer if you truly want to drive the LED with 20ma. If it could supply the current then yes... You only need to drop 1.05 volt, so the dropping resistor should be 52 ohms or so.
–
BobTDec 18 '12 at 22:37

OK, thanks for that. So I need to be looking for some more reasonable LEDs. (What's a buffer?)
–
BenjolDec 19 '12 at 6:19

2

8ma will give you a pretty bright light from a small LED. As far as buffers go, in this case a buffer is a circuit that (for instance) takes a small current drive as an input and sources (or sinks) a much larger current on its output. They are used for driving relatively high current peripherals from low current outputs. An LED is one example, a relay might be another. See evilmadscientist.com/2012/basics-open-collector-outputs for an example of IC buffers. For a discussion of driving LED's with a RasPi see elinux.org/RPi_Tutorial_EGHS:LED_output
–
BobTDec 20 '12 at 3:26