What should be the best way to connect a led on GPIO pin to work as an indicator but also as GPIO for use in other things. Should I connect it in a serial way? but I think Ill have a voltage divider, or in parallel way?


Because the microcontroller output is a voltage source, you should connect the other item in parallel with the LED:


simulate this circuit – Schematic created using CircuitLab


  • The above presumes that you want the LED on when the other load is high. If you want the opposite behavior, flip the diode and connect the anode to the supply voltage.
  • Be careful to not exceed the maximum current rating for the pin.
  • The pin cannot simultaneously be an input and an output.
  • 1
    \$\begingroup\$ The pin can be an input if the external input can drive the LED and will not drive it in a different direction than the GPIO. Takes some work, but not impossible. \$\endgroup\$ – Wouter van Ooijen Sep 8 '15 at 23:12
  • \$\begingroup\$ @WoutervanOoijen Good point, one could add a buffer/transistor if needed. In an inverting configuration of needed. \$\endgroup\$ – Houston Fortney Sep 9 '15 at 0:44

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.