I'm planning to connect 2 LEDs directly to my Pi 3's GPIO pins using only the LEDs and a 330 Ohm resistor. Can I accomplish this task without damaging my Pi?

I don't want to use a breadboard or any other PCB for this simple circuit.

  • 4
    The Pi doesn't have any 5 Volt GPIO pins - they are 3.3 Volt ! – CoderMike Nov 29 '17 at 7:40
  • You can do this using @MrChips excellent answer below, IF (and only if) you are planning on using 2 GPIOs. 1 GPIO can only reach 3.3V, which would not be enough to drive 2 LEDs in series. Your question wasn't clear on whether you were hoping for 2 in series, 2 in parallel, or 2 LEDs on 2 GPIOs. And do watch the overall current limits: "A maximum of 16mA per pin with the total current from all pins not exceeding 51mA" according to the Pi Foundation. – Tai Viinikka Nov 29 '17 at 15:13
  • Good Clarification Tai! I have updated my answer below to make it a bit clearer that you would need to do it "for each LED". Thanks! – MrChips Nov 30 '17 at 4:38

Yes, you can connect the LED safely between any GPIO pin that is set for output and the ground pin. For something like this I recommend a setup where you do this for each LED you are adding:

  • Solder one lead of the resistor to the ground-side pin of the LED (the shorter one).
  • Solder one wire (preferably black -) to the resistor's other lead.
  • Solder another wire (preferably red +) to the positive (longer) lead of the LED.
  • Slip a small piece of heat-shrink tubing up the bottom of the resistor lead wire that is long enough to cover the bare leads of both the resistor and the LED ground wire, then shrink it.
  • Slip a fatter piece of heat-shrink tubing over the whole assembly from the bottom of the LED down far enough to cover the remaining bare positive lead wire. Shrink that.

You now have an LED that is short-hardened with two wires coming off the bottom. A nice neat package.

  • Connect the positive (red+) LED lead wire to the output 3.3v GPIO pin.
  • Connect the negative (black-) wire to a ground pin on the GPIO header.

Use whatever app you want to set/unset the GPIO output voltage high/low to switch on/off the LED.

Good luck! I hope this helps!

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.