1
$\begingroup$

Please note: although this question involves a Raspberry Pi (hereafter RPi), it is really a pure robotics question at heart!


I am trying to connect my RPi 1 Model A to a breadboard with a single, simple LED on it. The LED is rated at 1.7V and 20mA. The RPi's GPIO pins are providing 3.3V of power and are not really meant to exceed 16mA. So my circuit needs a resistor, and I believe its calculation is as follows:

R = V differential / I
  = (3.3V - 1.7V) / .02A
  = 1.6V / .02A
  = 80 ohms

If I'm understanding this calculation correctly, that means that providing my LED circuit with 80 ohms or higher will safely limit the current on the circuit.

Problem is, I only have 47-ohm resistors available to me. So I'm wondering if I can daisy chain two 47-ohm resistors (for a total of 94 ohms, which is greater than the 80-ohm requirement) and not fry the RPi and/or the LED?

Here's my wiring:

enter image description here

In the pic above:

  • A red jumper connects a GPIO pin to a place on the breadboard; this feeds power to...
  • The first 47-ohm resistor; this then feeds power to...
  • The 2nd 47-ohm resistor; this then feeds power to...
  • The LED's anode; the LED is powered and power flows out of the cathode to...
  • A pair of jumpers (small yellow one and then a brown one) that lead back to the GND on the RPi

Here's a slightly better angle of the breadboard:

enter image description here

So I ask: will I fry my pi with this setup? Have I calculated resistance correctly (80 ohms)? Can I daisy chain two 47-ohm resistors together? Anything look "off" about my wiring setup in general? Thanks in advance!

$\endgroup$
1
$\begingroup$

Short answer: this will work unless you keep the LED on more than 94% of the time.

The diode will turn on at 1.7V and take as much current as the circuit can provide. Your equation is correct, if you want the circuit to pull current $I$, then your resistance is: $$R = (3.3-1.7)/I = 1.6/I$$

Using $R=80 \Omega$ will set your current to 20mA, but this is what your LED is rated for and exceeds the raspberry pi's specs. To stay below 16mA, you want $R\ge 100\Omega$.

In practice the limit for the raspberry pi will be based on average power rather than a maximum current. Using your $94\Omega$ resistor should be fine if you use a PWM signal with less than 94% duty cycle. Even with 100% duty cycle you're probably within the margins built into the specifications, but I would advise against it.

If you want to get really fancy, you can put two $47\Omega$ resistors in series with another 8 resistors in parallel to get a $99.875\Omega$ equivalent resistor.

Your wiring set-up looks good, assuming you connect the yellow wire to ground.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks @combo (+1 and green check!) - real quick: what happens when I leave my LED on 100% of the time? Will I fry my RPi or will it blow the LED? Or do something else thats weird?! $\endgroup$ – smeeb Sep 25 '17 at 13:41
  • 1
    $\begingroup$ You'll pull more than the pi is rated for. It's likely that the pi has enough margin that nothing weird will happen, otherwise I would expect it to cause a thermal shutdown. I don't think it will cause permanent damage. You should look into whether there are any PWM pins and use those with a 90% duty cycle - you won't notice the difference and this will keep everything within specs. $\endgroup$ – combo Sep 26 '17 at 16:21
  • $\begingroup$ Ahh I re-read your answer @combo...how about this: could I add a third 47-ohm resistor (instead of just daisy chaining two of them) to create the equivalent of a 141-ohm resistor? If I did that, then R > 100, and I believe I'd have enough resistance to keep the LED lit 100% of the time...do you mind confirming? Thanks again! $\endgroup$ – smeeb Sep 27 '17 at 14:56
  • 1
    $\begingroup$ Sure, if you put three resistors in series you'll have a 141-ohm equivalent and be able to keep it on the whole time. It might be dimmer than you like, in which case you would want to reduce the resistance by doing a parallel combination (or run to radioshack and get a 100 ohm resistor). $\endgroup$ – combo Sep 28 '17 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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