1

I have this kind of trouble. I'm working on a project that implements several load (some relays, or motors, etc).

Or, more simple, I would light 6 LEDs in series, all togethers, with only a GPIO (let's say the PIN 0/11).

With only 1 led, ok, you use GPIO 0 + GND and all OK, current is very low. 6 Led can burn the PI.

So, I would connect an EXTERNAL power source to the breadboard. And not using the PI current.

How I need to link? Do I need a transistor (like the 2N2222) that acts as a switch?

So:

PI GPIO 0 --> RESISTOR --> TRANSISTOR BASE

and together

EXTERNAL POWER (9V in my case) --> TRANSISTOR EMETTITOR

and together

TRANSISTOR COLLECTOR --> POSITIVE for the LEDs (or other load) ?

Otherwise, If i connect the GPIO 0 to the same line of 9v of the external power, I imagine that PI burns in 3-2-1 boom! or btw the circuit is closed and the loads function... no PI control...

Thank you...

  • Hello and welcome. Do it like described here raspberrypi-spy.co.uk/2012/06/control-led-using-gpio-output-pin Mind that your description misses the essential resistor to limit the current through the LED. Putting the LED between collector and GND is also not advisable for a NPN transistor (despite the web buzzing with circuits doing that wrong for no good reason). – Ghanima Jul 17 '16 at 18:18
  • Lighting LEDs in series probably won't accomplish what you want to accomplish. They have a forward voltage drop. You want to wire them in parallel with an appropriate resistor for each led if necessary. – goldilocks Jul 17 '16 at 18:40
  • @goldilocks, if the LEDs are red it might work out with 9V just barely however. But you're right the OP has to consider the forward voltage of the LED (might be over 3V for white light). Still series connection is a good way to go (if the supply voltage is high enough). – Ghanima Jul 17 '16 at 19:01
  • @Ghanima Hmmm -- I guess I did have that wrong. I know I have done this before with identical leds and they got progressively dimmer, but probably that was insufficient supply voltage. I'll have to try this out now...I take it they are less sensitive to voltage than current, so you could actually start with 12V and the right resistor, and as long as you don't drop below 3V at the end of the circuit they should all be okay and equally bright? – goldilocks Jul 17 '16 at 20:01
  • 1
    @goldilocks, in series they all see the same current (which should equal the same brightness, within variations according the spec's). Given sufficient supply voltage and appropriately rated resistor that should work out just fine. – Ghanima Jul 17 '16 at 20:42

Your Answer

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

Browse other questions tagged or ask your own question.