Author Topic: Parallel LEDs with common ground/resistor, different source?  (Read 640 times)

0 Members and 1 Guest are viewing this topic.

Offline MpeggerTopic starter

  • Contributor
  • Posts: 31
  • Country: us
Parallel LEDs with common ground/resistor, different source?
« on: December 07, 2022, 11:21:19 am »
I'm wiring 4 LEDs to a Raspberry Pi that turn on individually when there's activity on a assigned cpu core. I want to keep the module as small as possible so I wanted to wire the LEDs in a parallel fashion with a common resistor and ground, even though each LED is an individually powered circuit. Is this mixed series/parallel circuit even possible? How would I calculate what size resistor I would need to use if it is possible?
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5907
  • Country: es
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #1 on: December 07, 2022, 12:04:01 pm »
Unless only one led is lit at a given time, you can't, current will be shared between leds, so they get dimmer as you Enable more leds.
You can't overcome this by lowering the resistor, then enabling only one led would burn it.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #2 on: December 07, 2022, 12:07:06 pm »
Possible, yes, advisable no, as David just commented.

You'd have to choose the resistor to suit the case when only one LED is on so that the lesser of the max currents for a Pi  I/O pin and for the LED is not exceeded.  Then when more LEDs turn on the available current would roughly share between them, all becoming dimmer.  However the one with the lowest Vf will hog more of the current, and as Vf is temperature dependent, even if you carefully select LEDs from a larger batch for closely matched Vf, the one that's been on the most will be warmer, so will draw more current and stay warmer and brighter.  TLDR: Its a mess!

However, as you can get an array of four SMD resistors in a package as small as 1.4mm x 0.6mm (Panasonic EXB resistor array series), bite the bullet and give each LED its own series resistor.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #3 on: December 07, 2022, 02:59:51 pm »
There are LEDs that have internal resistors like:

https://www.sparkfun.com/products/14563
 

Online Peabody

  • Super Contributor
  • ***
  • Posts: 2007
  • Country: us
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #4 on: December 07, 2022, 03:30:53 pm »
Or, you could have only one LED turned on at a time, and multiplex if multiple LEDs must *appear* to be on at the same time.
 
The following users thanked this post: Ian.M

Offline MpeggerTopic starter

  • Contributor
  • Posts: 31
  • Country: us
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #5 on: December 09, 2022, 05:53:04 am »
I figured as much. I was hopeing that maybe there was some secrect sauce that would allow such a circuit to be possible, but I guess I'll have to use more resistors in the mix. Thanks for the confirmation of what I had hoped I was wrong in my thinking.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #6 on: December 09, 2022, 02:57:43 pm »
Given that resistors cost about the same as thin air, put one in each leg.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Parallel LEDs with common ground/resistor, different source?
« Reply #7 on: December 09, 2022, 03:41:30 pm »
As Peabody noted, its possible to get good results and uniform brightness with only a single resistor if you multiplex the LEDs.  Additionally you can save a GPIO pin by charlieplexing them.  As three GPIOs can support six charlieplexed LEDs and you only need four, if you omit the LEDs between two of the GPIOs you can get away with a single current limiting resistor in series with the common GPIO, chosen not to exceed the pin's max. continuous current.   Use high brightness LEDs as their max. duty cycle will only be 25%.   Sequencing the GPIOs to light the desired LEDs will require a high priority background or interrupt driven task.  If you don't want to write that yourself, I'd lay good odds that the pigpio daemon controlled by the wave functions in the pigpio library could handle the sequencing for you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf