Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently started doing basic diode connections (red and green diodes). I've also got blue diodes, but there's one thing that prevented me from connecting them already, namely - the specs say they're 3.3V.

While calculating resistor value, I'm doing simple: 3.3V - ULed / 2mA to obtain resistor value needed to draw default 2mA.

But if the forward voltage of blue diode is said to be same as supply voltage of my GPIO pins, how would then things work? Will the rpi be just 'unable' to power up the led? And if it will (and diode will do just fine with lower voltage), how should I calculate resistor value?

share|improve this question
up vote 3 down vote accepted

The 3.3v forward voltage drop that you talk about, is specified at a certain forward current. This is just a point on a Forward Voltage Drop / Forward Current curve. In the datasheet of the LED you should also have the total curve. You can use this curve to select a different point for a different drop voltage / current, this implies you will not be using the LED at it's brightest. A good example of how to do this can be found here.

share|improve this answer
Many thanks! surprisingly, I was looking for something like 'electronics' stackexchange (as I predicted it might be a better place to look for an answer), but only on the footer here, so I just didn't find it. – Bartosz Dec 17 '12 at 12:00

You can connect the anode of the LED to the +5v and pull the cathode to GND with the GPIO pin. This gives you 850 ohm for 2mA. 820 ohm should work fine too.

     > 820 ohm
     V LED

share|improve this answer
Yeah, that would work if I didn't want to control them (I didn't state it in my question). – Bartosz Dec 17 '12 at 12:18
@Bartosz, You can control it. When the GPIO is low, the LED will be on. When the GPIO is high (3.3V) the LED will only have 1.7V across it, so won't light up. – John La Rooy Dec 17 '12 at 12:24
Oh damn, care to elaborate 'pull the cathode to GND with the GPIO pin'? The diagram could be also nice:) – Bartosz Dec 17 '12 at 12:27
Thanks, needed to refresh my knowledge about potential difference a bit, I think I was missing quite big chunk of the overall picture:) – Bartosz Dec 17 '12 at 14:00
I'd be wary of connecting a voltage over +v of the chip to a gpio, although the led threshold should not allow any current into logic high at +5V. Investing in a few transistors would be cleaner, like in blog.jacobean.net/?p=158 – XTL Dec 19 '12 at 7:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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