GPIO and LED with or without a resistor?


My son and I would like to play with the GPIO ports from within Scratch. Whatever tutorial you read on the internet it says that you should connect LEDS in serial with a resistor when connecting it to the GPIO header of the Raspberry Pi. However, in the Piper Minecraft episodes the LEDs are connected directly to the GPIO ports and no resistors come bundled with the Piper Computer Kit.

Question: Are the provided LEDs special (i.e., with a built-in resistor) or is it simply safe to connect a LED directly to a GPIO output port + GND and drive it without a resistor?


Discalimer: my electronics knowledge is 40 years old and I’m slowly getting some of it back.

The LEDs are just normal LEDs. My recommendation would be to follow the directions and use a resistor in series.

If you want in-depth information, google ‘raspberry pi led internal resistors and gpio’ you will find some technical discussions, examples both ways, but it won’t hurt to add the external resistor (even to the Piper circuits) and it just might prevent you from frying the Pi - which will make you sad, at least it made me sad when I fried one of mine. (I fried a Pi Hat circuit board too :sob:) but now I have one i can let people touch and see what it looks like and I don’t care if you dorp it or spill something on it etc)


Hi @Paul,

Thanks for helping.

I did what you suggested while waiting for a reply – just to be on the safe side. :slight_smile:

After googling for a while I could find no official docs stating that the GPIO ports are somehow short-circuit protected or current limited, so I added a 220 Ohm resistor in serial with the LED.