Author Topic: BJT current sink vs MOSFET switch: driving LEDs  (Read 895 times)

0 Members and 1 Guest are viewing this topic.

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
BJT current sink vs MOSFET switch: driving LEDs
« on: April 13, 2020, 07:50:04 am »
Hi.
Perhaps this is a stupid question, but I may learn something.
Many times recently I found myself in the need of switching some LEDs (let's say 3V drop) attached to a 12V power supply, from a 5V signal. Usually there are 1-4 of those leds in parallel, all of the same type/color.
My normal approach is to attach an appropriate resistor (to limit the current to ≈10mA) to each led, and then use a n-fet to switch them on and off.
Naturally the current won't be exactly the same in every led, since they can differ a bit, but more or less everything is uniform.

Now I'm thinking: putting a 40mA BJT current sink (turned on by the 5V signal) could be a viable solution. How should I approach the problem to find the best solution for my case? Is there a better solution a priori?

Thanks
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12881
Re: BJT current sink vs MOSFET switch: driving LEDs
« Reply #1 on: April 13, 2020, 08:47:23 am »
Try to avoid paralleling LEDs.  It is only somewhat acceptable when they are all from the same batch, selected for closely matching Vf and thermally coupled.   Even so you have to derate their max If considerably.

For your two and three LED cases a series string would be vastly preferable.  For your four LED case, two series strings of two LEDs each with its own current limiting resistor, the two strings in parallel would probably be the best option.

The simplest possible BJT current sink is a NPN transistor, base driven by your I/O with an emitter resistor to set the current.  With 5V logic levels, that would limit you to no more than two 3V LEDs in series from a 12V supply.  Anything that needs less headroom is considerably more complex, so unless your nominal 12V supply voltage varies widely (e.g. automotive applications), it isn't worth doing using discretes.   OTOH if you've got a lot of LEDs to drive from a MCU but don't want to mess with multiplexing, it can be worth using a dedicated constant current LED driver IC, which typically will be SPI controlled with a single resistor to set all its LED currents.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: BJT current sink vs MOSFET switch: driving LEDs
« Reply #2 on: April 13, 2020, 08:58:11 am »
Try to avoid paralleling LEDs.  It is only somewhat acceptable when they are all from the same batch, selected for closely matching Vf and thermally coupled.   Even so you have to derate their max If considerably.

For your two and three LED cases a series string would be vastly preferable.  For your four LED case, two series strings of two LEDs each with its own current limiting resistor, the two strings in parallel would probably be the best option.

The simplest possible BJT current sink is a NPN transistor, base driven by your I/O with an emitter resistor to set the current.  With 5V logic levels, that would limit you to no more than two 3V LEDs in series from a 12V supply.  Anything that needs less headroom is considerably more complex, so unless your nominal 12V supply voltage varies widely (e.g. automotive applications), it isn't worth doing using discretes.   OTOH if you've got a lot of LEDs to drive from a MCU but don't want to mess with multiplexing, it can be worth using a dedicated constant current LED driver IC, which typically will be SPI controlled with a single resistor to set all its LED currents.

Thanks for the suggestion. I usually do not have more to drive. So you think the sink si better than the switch?
 

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3078
  • Country: be
    • Freelance Hardware Engineer
Re: BJT current sink vs MOSFET switch: driving LEDs
« Reply #3 on: April 13, 2020, 09:00:51 am »
It's not 100% clear to me what you are asking. If you plan to parallel LEDs without individual current control: See Ian's answer. If you plan to have series resistors for all but are considering BJT over FETs: the big advantage of FETs is they don't require the logic source to provide any current. For BJTs, to ensure the transistor is properly saturated, you'll still need per example 1/2 mA per LED you're driving.
 
The following users thanked this post: Moriambar

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12881
Re: BJT current sink vs MOSFET switch: driving LEDs
« Reply #4 on: April 13, 2020, 09:21:16 am »
I didn't explain why parallel LEDs are a really bad idea:  Parallel LEDs are prone to current hogging - one has a slightly lower Vf so it draws more current, so dissipates more power.   Its Vf drops with increasing temperature so it draws even more current and gets even hotter.  If there's sufficient available current, the increasing hogging and thermal runaway will continue to LED failure, and if the LED goes open circuit as it fails (or if there is enough current to blow a shorted LED open circuit), you can easily get cascading failure of all the LEDs.

A MOSFET switch, + a current limiting resistor can handle up to three 3V LEDs in series from a 12V supply, and additional series strings, each with its own resistor can be paralleled and driven by the same MOSFET. 

The simplest possible BJT current sink (consisting of an NPN transistor with an emitter resistor) can only handle two 3V LEDs in series from a 12V supply, and you cant (or at least shouldn't) parallel additional LEDs.

Therefore the MOSFET switch has a clear parts count advantage any time you need to drive more than two LEDs, and is no worse than the BJT current sink for one or two LEDs
 
The following users thanked this post: Moriambar


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf