# Resistors on the RPI GPIO

I need to figure out what kind of resistors to get with the GPIO.

In total, I have 13 LEDS hooked up to the GPIO.

1 Red 5mm, 20mA, 2.4v

2 Yellow 5mm, 20mA, 2.4v

1 Green, 5mm, 20mA, 2.4v

1 Blue, 5mm, 3.2 Forward Voltage: 3.2V, 3.8V Max, Forward Current: 20.A, 30nm Tolerance

5 Blue, 5v max 6v, 30mA, 300mcd

3 White, 5mm, 3.6V Max, 20mA

Its a lot of LEDS, so I dont want to burn out the Pi with to much current draw.

• Also, can you use two resistors to "add" the amount of resistance? Commented Sep 17, 2016 at 21:56

Resistors are used in LED circuits to regulate current, so calculating their size is a matter of applying Ohm's law.

``````Resistor Ohms = (Supply voltage - LED forward drop) / desired current
``````

The right hand side units are volts and amps, so for example, to light your red LED to full brightness:

``````(3.3 - 2.4) V / 0.02 A = 45 Ohms
``````

So that's the smallest resistor you should use to prevent burning th LED out. However, you probably won't notice any difference in brightness if you use one twice as big, and you won't notice much at twice as big again.

You can experiment with that -- but do it one at at time, because what you don't want to do is

burn out the Pi with to much current draw

And I think you would be pushing the boundaries too much if you gave all those LEDs their max current at the same time. The GPIOs proper (by which I mean the actual GPIO pins, and not all 40 pins on the breakout, some of which are non-configurable power rail and ground pins) are intended for signalling and not supplying significant amounts of energy.

So, if you really want to drive that many LEDs at full current you should control them via transistors supplied by a 3.3V rail pin (integrated circuit darlington arrays like the ULN2xxx family are good for this).

If not, you want to plug in some numbers to keep the total current draw below ~120 mA. I.e., aim for 10 mA or less per LED. Go as low as you can as long as you are still happy with the brightness.

can you use two resistors to "add" the amount of resistance?

Yes.

It's impossible to properly answer. We don't know how efficient your LEDs are or how bright you want them.

I'd be looking at resistors in the range 300 to 1000 ohms.

If you do plan to have them all on at the same time then perhaps try resistors in the range 800 to 1000 ohms.

• Idk need them to be super bright, just visible enough. Also, at most 7 Leds will be on at the same time. Commented Sep 17, 2016 at 22:37