Resistor value for LED with Sink Driver

Discussion in 'The Projects Forum' started by DirtyBits, Jul 30, 2011.

  1. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    Dear All,
    I would like to know that; Is resistor R10 required for following circuit.

    [​IMG]

    Conditions;
    the circuit has to be in a way such that;
    1. Each LED gets constant current of 20mA in ON state, irrespective of how many LEDs are ON (conducting) at any given time.
    2. Transistor's Collector current is 300mA and is supplied by constant Base current in Fully Saturated state (ON).

    This question is bugging my mind...
    Do I need an extra resistor(R10) in parallel to other LEDs to bypass excess current drawn by collector? Or is it not required?
    Considering Collector/emitter current is 300mA and 8 LED consumes 20mA x 8= 160mA so what will happen to the rest of 140mA?
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Resistors work OK for limiting LED current when the supply voltage is constant.
    The ULN2803 has a Vce(sat) of around 0.7v when there is 20mA of current flowing through it, so make sure you take that into account when calculating the values to use for R1-R8.
    The basic formula for calculating LED current limiting resistors is:
    Rlimit >= (Vsupply - Vf_LED) / Desired_Current
    In your case, you should add 0.7v to the Vf_LED.

    Now, Q1 is an NPN transistor being used on the high side of the LEDs. It really should be a PNP transistor, as the NPN is being used as an emitter follower, and the emitter will be 0.7v or more less than the voltage on the base, depending on the transistor gain and the load.

    If Q1 is changed to a PNP transistor, then it would operate in a saturated mode. You have 8 LEDs operating in parallel with 20mA current through each, so that means you will require 8*20mA = 160mA current maximum when all of the LEDs are on.

    You will need 1/10th that much current through the base, or 16mA. You will need a transistor like a 2N2907, and the base resistor will need to be about (5v-0.8v)/16mA = 262 Ohms; 270 Ohms would be close enough. This will reverse the logic; instead of sourcing current when the base goes high as with the NPN transistor, the PNP will source current when the base is pulled towards ground.

    Note that you should select a transistor that is rated for collector current (Ic) at least twice that of the current required. If you don't do that, your Vce(sat) will be higher than it could be, which wastes power and heats up the transistor.

    No, you will not need the extra resistor R10. While the transistor may be capable of sourcing up to 300mA, the current limiting resistors ensure that no more than 160mA will be required from it. There will be no "extra current".
     
  3. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    Thanks a lott for your reply,
    Really helpful.
     
  4. gopalyajur

    Active Member

    Jan 3, 2010
    93
    12
    What is the use of transistor Q1? ULN3803 is a darlington array, is it not possible to drive the LEDs directly?

    And are the polarities of LEDs correct???

    Thanks in advance.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I really don't know; I presume that it is a part of a larger circuit that was simply not shown. It might have been used for an enable/disable line; something like that.

    Absolutely.

    Yes.
    Just a matter of preference - I like to have the LEDs nearest to the 0v reference, except for the ground-side current sink. Electrically, it makes no difference at what point the resistors are placed in series, as current must flow from the + supply, through the LED, through the resistor, through the switching transistor etc.

    However, if the LED's anode is connected to the positive supply, and one accidentally shorts the cathode to ground, the LED will get burned up. If you have the resistor between the positive supply and the LED anode, and you happen to short either the LED anode or cathode to ground, nothing bad will happen.
     
    Last edited: Jul 31, 2011
  6. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    You are bang on target!
    It's a part of larger circuit not shown for simplicity to focus on the real question.
     
  7. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    Hi SgtWookie,
    If I use total 48 LEDs instead of 8 and if a PNP transistor is used to source the current of 960mA (1/8 Duty cycle) Then which Transistor do you recommend? What else do I need to take in to consideration as the circuit required about 1A current?
    [​IMG]
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Why don't you supply the details of your LEDs, and if their is a higher voltage that 5v available? If there is a higher voltage, you may be able to operate several LEDs in a series string, which would decrease the overall current requirement to operate the same number of LEDs.

    A single ULN2803 will not be able to sink nearly 1A. The capacity is limited to around 350mA for the entire IC; if you try to sink more than that, you will likely burn it up.
     
  9. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    Okay, here is the updated schematic.
    Need suggestion regarding PNP transistor and handling 960mA current at ground.
    And yes it has to be 5V. LEDs' forward voltage is 3.3V

    Each LED will operate at 20mA so for each row the max current will me 48x20 = 960mA
    However at a time only one row will be operating so it will be 1/8 duty cycle.
    But it will be max output current of 960mA at ground 100% duty cycle (provided all the LEDs are ON)

    [​IMG]
     
    Last edited: Aug 5, 2011
  10. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    updated...
    [​IMG]
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, it took me awhile but I found a datasheet for a TB62778 here:
    http://leds-led-drivers.com/pdfs/Toshiba/TB62778FNG-LED-Drivers.pdf
    To have the driver sink 20mA per channel, you will need a 904 Ohm resistor from R-EXT to ground. Since 904 Ohms is not a standard value, use 910 Ohms instead, which will sink 19.87mA instead. That's 99.35% of 20mA; you won't notice the difference. You will not need R1 through R8; the TB62778 is a constant current sink driver.

    You have Q1 through Q8 drawn upside-down; the collectors and emitters need to be exchanged, otherwise the transistors will not work. [eta] I see you have corrected this in post #10

    But instead of transistors, use P-ch logic level power MOSFETs instead.
    Here is a good one for you to use:
    http://parts.digikey.com/1/parts/1017711-mosfet-p-ch-20v-13-5a-8-soic-fds4465.html
    The FDS4465 are in an 8-pin SOIC package, have a very low Rds(on), a very low gate threshold, and are even specified for operation with Vgs as low as -1.8v. It has a fairly high gate charge, but you are going to be switching these MOSFETs at a fairly low frequency; probably well under 200Hz. You should use 240 Ohm or 270 Ohm resistors between the microcontroller I/O pin and each MOSFET gate.

    Standard transistors would require too much base current to be driven by a microcontroller. Darlington transistors would have too high of a Vce(sat) to be used at such a low voltage. So, you are left with using two transistors per channel, or MOSFETs.
     
  12. DirtyBits

    Thread Starter New Member

    Jul 30, 2011
    8
    0
    Sorry, I 'ld have attached it at first place.

    I was using R1 to R8 to drop-down voltage, as LED requires 3.3V forward voltage and not 5V. Am I missing something here? :confused:

    270Hz to be precise

    Hmmm..I need to learn about MOSFET, I've never used it before..let me check it out!

    :)
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes you are. You need to read the datasheet on the TB62778 to make certain that you understand how it works. It is very different from the ULN2803. It uses one resistor to set the current for all of the outputs. It uses serial input and clocks, etc, to shift data in rather than how the ULN2803 is a parallel input device.

    Why so fast? It's doubtful that anyone could tell the difference above 200Hz.
     
Loading...