2 added 187 characters in body edited Aug 22 '13 at 11:06 John La Rooy 9,72599 gold badges4242 silver badges7070 bronze badges The GPIO pins will be damaged by 20mA. You need a transistor or driver IC to drive the LED at full brightness. A resistor will always cause a voltage drop, so the green and blue will only light dimly from 3.3V To calculate the resistor, you need to understand that the current through the resistor will be the same as the current through the LED. So if the LED current is 20mA and the forward voltage is 3.5V. With a 5V supply you would have 1.5V across the resistor (at 20mA) Ohms law says `V = I * R` substituting gives ``````1.5 = 0.02 * R `````` solve for R ``````R = 1.5 / 0.02 R = 75ohm `````` For the red led, you have 2V across the LED and 3V across the resistor (5V supply) ``````R = 3 / 0.02 R = 150ohm `````` Those are the minimum values you should use for the resistors The GPIO pins will be damaged by 20mA. You need a transistor or driver IC to drive the LED at full brightness. A resistor will always cause a voltage drop, so the green and blue will only light dimly from 3.3V To calculate the resistor, you need to understand that the current through the resistor will be the same as the current through the LED. So if the LED current is 20mA and the forward voltage is 3.5V. With a 5V supply you would have 1.5V across the resistor (at 20mA) Ohms law says `V = I * R` substituting gives ``````1.5 = 0.02 * R `````` solve for R ``````R = 1.5 / 0.02 R = 75ohm `````` The GPIO pins will be damaged by 20mA. You need a transistor or driver IC to drive the LED at full brightness. A resistor will always cause a voltage drop, so the green and blue will only light dimly from 3.3V To calculate the resistor, you need to understand that the current through the resistor will be the same as the current through the LED. So if the LED current is 20mA and the forward voltage is 3.5V. With a 5V supply you would have 1.5V across the resistor (at 20mA) Ohms law says `V = I * R` substituting gives ``````1.5 = 0.02 * R `````` solve for R ``````R = 1.5 / 0.02 R = 75ohm `````` For the red led, you have 2V across the LED and 3V across the resistor (5V supply) ``````R = 3 / 0.02 R = 150ohm `````` Those are the minimum values you should use for the resistors 1 answered Aug 22 '13 at 11:00 John La Rooy 9,72599 gold badges4242 silver badges7070 bronze badges The GPIO pins will be damaged by 20mA. You need a transistor or driver IC to drive the LED at full brightness. A resistor will always cause a voltage drop, so the green and blue will only light dimly from 3.3V To calculate the resistor, you need to understand that the current through the resistor will be the same as the current through the LED. So if the LED current is 20mA and the forward voltage is 3.5V. With a 5V supply you would have 1.5V across the resistor (at 20mA) Ohms law says `V = I * R` substituting gives ``````1.5 = 0.02 * R `````` solve for R ``````R = 1.5 / 0.02 R = 75ohm ``````