Author Topic: Confused about LED driving and pricing  (Read 869 times)

0 Members and 1 Guest are viewing this topic.

Offline c--Topic starter

  • Newbie
  • Posts: 5
  • Country: fr
Confused about LED driving and pricing
« on: December 22, 2024, 01:44:38 am »
Hi everyone,

For a hobby project I am looking into solutions for driving low power LED (5mm, 3mm, 1206 SMD, ...) from a 5V signal coming from CMOS ICs and a 12V power source, using a jelly bean transistor. I'd appreciate some help to clear up soem confusion I have regarding possible implementations.

If I wanted to go the MOSFET route, that would be pretty easy. Any N-channel E mode device with a 1kΩ resistor would do the trick. [ Specified attachment is not available ]

However, it seems BJTs are even cheaper, but their usage confuse me. From what I can see online for that usage, everyone seems to use them in saturation mode, effectively turning them into closed switches. In that case, you need a resistor on the base to control the BE current and also one to limit the LED current.

But I don't get the point in that. If I'm not mistaken, used in linear mode, BJTs are essentially a glorified resistors.
So shouldn't it be more economical, both in cost and in space saved on PCB to use the NPN in linear mode in order to limit the current flowing through the LED and getting rid of R2 in tat case?
Otherwise I don't see the benefits of using a cheap BJT over a MOSFET in that use case as you would have to give up on the isolation, consume more current and use an extra resistor.
 

Offline Konkedout

  • Regular Contributor
  • *
  • Posts: 200
  • Country: us
Re: Confused about LED driving and pricing
« Reply #1 on: December 22, 2024, 02:01:24 am »
One resistor versus two is not generally a big deal.  But a transistor operating in constant current mode does not act like a resistor, because the collector current will be relatively constant as the collector voltage varies.

It may well be that using the bjt in constant current mode will work well enough, but possible issues are transistor heating and also oscillation.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1441
  • Country: pl
Re: Confused about LED driving and pricing
« Reply #2 on: December 22, 2024, 03:56:09 am »
For a hobby project I am looking into solutions for driving low power LED (5mm, 3mm, 1206 SMD, ...) from a 5V signal coming from CMOS ICs and a 12V power source, using a jelly bean transistor. I'd appreciate some help to clear up soem confusion I have regarding possible implementations.
It’s good to be curious, but also try to not overthink it.

So shouldn't it be more economical, both in cost and in space saved on PCB to use the NPN in linear mode in order to limit the current flowing through the LED and getting rid of R2 in tat case?
Yes, that makes perfect sense, but only under one condition. That you can set current through the BJT. You can’t with just a single BJT and a resistor.

Try proposing a circuit that, in your opinion, could do that: you’ll see why not.

Otherwise I don't see the benefits of using a cheap BJT over a MOSFET in that use case as you would have to give up on the isolation, consume more current and use an extra resistor.
As noted above, the cost is negligible in either case. In practice this isn’t even a problem: usually such a small LED is driven directly without an additional amplifier. The benefits are also not there. The current to drive the BJT is over two orders of magnitude lower than that through LED itself. There is also no isolation to give up.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline lakis70

  • Contributor
  • Posts: 11
  • Country: gr
Re: Confused about LED driving and pricing
« Reply #3 on: December 22, 2024, 04:15:29 am »
iam not specialist but
i think you have to use a PNP transistor as you wired them to work. Calculate the leds resistor for 15mA or how much current it needs and the base resistor for 1/10 the current you calculate.
If you want NPN transistor connect the led and its resistor between emitter and ground.
They prefer mosfet because they have less on resistance but for low power like this and transistors at saturation are good.  Look at some datasheets for transistors saturation Vce for the current you want and choose one with the smaller.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
Re: Confused about LED driving and pricing
« Reply #4 on: December 22, 2024, 04:31:01 am »
You didn't ask about this, but is there a reason why you're using a 12V supply?  About 80% of the power consumed will be dissipated as heat in the current-limiting resistor.  And if it's just a few milliamps of LED current, the CMOS gates can probably drive the LEDs directly (through a resistor of course) without needing a transistor.
 

Offline lakis70

  • Contributor
  • Posts: 11
  • Country: gr
Re: Confused about LED driving and pricing
« Reply #5 on: December 22, 2024, 04:44:54 am »
i saw only the 5V at base. Use the same voltage for both with PNP transistor, because PNP will output 12V from its base and will destroy something in the vicinity.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 8881
  • Country: us
  • Retired, now restoring antique test equipment
Re: Confused about LED driving and pricing
« Reply #6 on: December 22, 2024, 04:45:06 am »
Yes, the base resistor determines the base current, but you can't design the BJT to output a known current from merely the base current and beta, since beta for an individual unit of a given part number has a wide variation.
The resistor in series with the collector and LED will determine the LED current in a saturated BJT circuit, and the base resistor and current are designed so that with the minimum beta value for that part number the base current is more than required to force that collector current.
 

Offline Konkedout

  • Regular Contributor
  • *
  • Posts: 200
  • Country: us
Re: Confused about LED driving and pricing
« Reply #7 on: December 22, 2024, 05:03:46 am »
I am not particularly recommending the current source approach.  But by switching 5V to the base on an NPN, you can use only one emitter resistor to ground to set current.  Connect the collector to the LED cathode, and the LED anode to +12.  I would normally use the NPN with a saturated switch, so have one each current limiting resistor in series with the collector and the base.  Yup.  Two resistors instead of one.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8504
Re: Confused about LED driving and pricing
« Reply #8 on: December 22, 2024, 05:56:53 am »
You can connect the LED and its resistor between the emitter and ground, and the signal to the base, which won't require a resistor in that configuration.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9219
  • Country: fi
Re: Confused about LED driving and pricing
« Reply #9 on: December 22, 2024, 09:43:57 am »
As others have pointed out: see the difference beween MIN/TYP/MAX of the Beta value of a transistor datasheet. Calculate the resulting LED current at MIN and MAX, and you will see the problem.
 
The following users thanked this post: tooki

Offline c--Topic starter

  • Newbie
  • Posts: 5
  • Country: fr
Re: Confused about LED driving and pricing
« Reply #10 on: December 22, 2024, 03:54:55 pm »
There is also no isolation to give up.

But a gate is isolated though? Unlike a base.

You didn't ask about this, but is there a reason why you're using a 12V supply?  About 80% of the power consumed will be dissipated as heat in the current-limiting resistor.  And if it's just a few milliamps of LED current, the CMOS gates can probably drive the LEDs directly (through a resistor of course) without needing a transistor.


Essentially because I am using an ATX power supply and these units deliver much power on 12V than on 5V and 3.3V. So the idea is to unload the maximum of load on 12V.

Actually you don't even need a resistor at all to lit up an LED from a 5V CMOS output. In my current use case I'm using an ATF16V8B as a 7 segment display controller with LEDs connected directly between the outputs of that chip and GND. It works fine I guess but the chip is rather warm and I'm pretty uncomfortable putting 7 LEDs directly on the inputs. That's what? 15 to 20 mA? That's way over the max power supply current value from the datasheet.

You can connect the LED and its resistor between the emitter and ground, and the signal to the base, which won't require a resistor in that configuration.

But isn't omitting a resistor to control the base emitter current how you blow up your NPN?
« Last Edit: December 22, 2024, 05:53:08 pm by c-- »
 

Online PGPG

  • Frequent Contributor
  • **
  • Posts: 385
  • Country: pl
Re: Confused about LED driving and pricing
« Reply #11 on: December 22, 2024, 05:42:29 pm »
But isn't using a resistor to control the base emitter current how you blow up your NPN?

According to how I understand English (can be that wrongly) this sentence suggests that with resistor you can blow NPN while without not. I don't understand this sentence.

You need not to use resistor in base to control base current. Base current can be self-controlled by negative feedback (emitter resistor in current source configuration).
 
The following users thanked this post: amyk

Offline c--Topic starter

  • Newbie
  • Posts: 5
  • Country: fr
Re: Confused about LED driving and pricing
« Reply #12 on: December 22, 2024, 05:54:13 pm »
But isn't using a resistor to control the base emitter current how you blow up your NPN?

According to how I understand English (can be that wrongly) this sentence suggests that with resistor you can blow NPN while without not. I don't understand this sentence.

My mistake I corrected.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1441
  • Country: pl
Re: Confused about LED driving and pricing
« Reply #13 on: December 23, 2024, 12:07:59 am »
There is also no isolation to give up.

But a gate is isolated though? Unlike a base.
For some meaning of word “isolation”, perhaps. In exactly the same way a capacitor is isolated. Or a reverse-polarized P-N junction, including those in a BJT. But seeing that as beneficial calls for a different meaning of “isolated.” None that I see here.

People imagine AI as T1000. What we got so far is glorified T9.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2104
  • Country: au
    • Halestrom
Re: Confused about LED driving and pricing
« Reply #14 on: December 23, 2024, 12:30:42 am »
Yes you can use just a resistor + BJT as a constant current source to drive an LED, but:

(1) You will have to tune the resistor to match your individual transistor (as others have mentioned: the beta/hfe varies a lot between each one, unless you spend more for some tightly controlled transistors)

(2) The gain/hfe depends on the temperature of the transistor and the load of the LED (which also changes depending on temperature).  This may lead to thermal runaway or other unstable behaviours (the transistor self-heats).  Also it might not be safe across all common ambient temperatures in your locale.

Resistors are nice and stable across temperature and guaranteed identical to within a few percent, which is why we like to use them everywhere :)  Compared to transistors they're almost perfect.

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2104
  • Country: au
    • Halestrom
Re: Confused about LED driving and pricing
« Reply #15 on: December 23, 2024, 12:35:32 am »
"the addition of resistors will continue until the circuit fucking behaves"

 -- previous designer


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf