+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Member level 1
    Points: 1,374, Level: 8

    Join Date
    May 2009
    Posts
    32
    Helped
    0 / 0
    Points
    1,374
    Level
    8

    Switch a LED using a NPN Transistor

    This seems to be a very basic question, but I'm having certain doubts.

    Click image for larger version. 

Name:	NPN_LED.PNG 
Views:	22 
Size:	62.7 KB 
ID:	87926

    From the picture above you can see 2 configurations to turn on/off a LED.

    I would like to know what is the correct/best design, or what is the difference between them, in except of the inversion of the signal...

    I'm not sure how I should use, or if both are ok.

    I'll use this to drive a LED from an optocoupler at 20Khz.
    Which one should I choose for best performance ?

  2. #2
    Full Member level 5
    Points: 3,162, Level: 13
    Achievements:
    Created Blog entry 7 years registered
    udhay_cit's Avatar
    Join Date
    May 2008
    Posts
    313
    Helped
    35 / 35
    Points
    3,162
    Level
    13
    Blog Entries
    1

    Re: Switch a LED using a NPN Transistor

    I suggest you to go with Fig:2 because of the open collector configuration. The first circuit will be preferred for logical output. The first circuit will also works, but unnecessary power dissipation will happen across the resistor even if the LED turn off...



    •   Alt12th March 2013, 08:38

      advertising

        
       

  3. #3
    Member level 1
    Points: 1,374, Level: 8

    Join Date
    May 2009
    Posts
    32
    Helped
    0 / 0
    Points
    1,374
    Level
    8

    Re: Switch a LED using a NPN Transistor

    hmm, yeah I see, there is a current flowing always on the circuit 1.
    But, why do you think that it is a better choice for logical output ?
    Also, in the case of a digital output, should I be concerned with the voltage drop on the BJT transistor ?



  4. #4
    Advanced Member level 5
    Points: 17,327, Level: 31
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,411
    Helped
    793 / 793
    Points
    17,327
    Level
    31

    Re: Switch a LED using a NPN Transistor

    You are driving the transistor base with about 1/10 of the collector current for a forced beta of 10 (the typical recommended value) which will give good turn-on of the transistor well into saturation. For that, the output Vce drop of the transistor when ON should be less than a tenth of a volt.
    Zapper
    Curmudgeon Elektroniker



    •   Alt12th March 2013, 17:50

      advertising

        
       

  5. #5
    Member level 1
    Points: 1,374, Level: 8

    Join Date
    May 2009
    Posts
    32
    Helped
    0 / 0
    Points
    1,374
    Level
    8

    Re: Switch a LED using a NPN Transistor

    Quote Originally Posted by crutschow View Post
    You are driving the transistor base with about 1/10 of the collector current for a forced beta of 10 (the typical recommended value) which will give good turn-on of the transistor well into saturation. For that, the output Vce drop of the transistor when ON should be less than a tenth of a volt.

    Ok, I see, so the drop is basically dependent of the BETA.
    Do you have a pratical way to calculate this drop ?

    I mean, if I put 12V on the collector, with 1mA as I(be) what should be the drop expected on the transistor ?

    Thanks.



  6. #6
    Advanced Member level 5
    Points: 17,327, Level: 31
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,411
    Helped
    793 / 793
    Points
    17,327
    Level
    31

    Re: Switch a LED using a NPN Transistor

    The beta used to insure saturation is a forced beta (beta lower than the data sheet values). A typical value used for this is 10.

    You can determine the drop by estimating from the data sheet saturation voltage values or use a Spice simulator such as LTspice.


    Edit: If you put 12V on the collector with no load, then the transistor will never saturate, by definition.
    Zapper
    Curmudgeon Elektroniker



  7. #7
    Member level 1
    Points: 1,374, Level: 8

    Join Date
    May 2009
    Posts
    32
    Helped
    0 / 0
    Points
    1,374
    Level
    8

    Re: Switch a LED using a NPN Transistor

    Quote Originally Posted by crutschow View Post
    The beta used to insure saturation is a forced beta (beta lower than the data sheet values). A typical value used for this is 10.

    You can determine the drop by estimating from the data sheet saturation voltage values or use a Spice simulator such as LTspice.


    Edit: If you put 12V on the collector with no load, then the transistor will never saturate, by definition.


    Yeah I see, but someone told me, that for example If I put a BJT in this configuration here:

    Click image for larger version. 

Name:	NPN_LOGIC.PNG 
Views:	6 
Size:	19.9 KB 
ID:	87967

    A person told me that when this NPN is conducting in the circuit above, I'll always have an offset of 0.6V on the "TO MCU INPUT" probe, which means that I'll never have 0V on it.
    So if I connect a digital pin like an input of MCU on the "TO MCU INPUT" it will never go down to 0V it will always be 0.6V from GND due to the BJT drop. Is that true ?
    So my digital port will work between 5V for ON and 0.6V for OFF state.
    I personally don't agree. What do you say about that ?



    •   Alt12th March 2013, 19:03

      advertising

        
       

  8. #8
    Advanced Member level 5
    Points: 17,327, Level: 31
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,411
    Helped
    793 / 793
    Points
    17,327
    Level
    31

    Re: Switch a LED using a NPN Transistor

    Not true. That "person" is a poor source of electronic information so please avoid him/her for such questions. The Vce ON voltage of the transistor should be less the 0.1V for that circuit. Perhaps the confusion is that Vce can be less than the Vbe ON voltage which is 0.6 to 0.7V typically.
    Zapper
    Curmudgeon Elektroniker



  9. #9
    Member level 1
    Points: 1,374, Level: 8

    Join Date
    May 2009
    Posts
    32
    Helped
    0 / 0
    Points
    1,374
    Level
    8

    Re: Switch a LED using a NPN Transistor

    Thanks.

    Well there is only one more question, the heat produced by the BJT is due to the small drop of voltage causing a resistence to the current I(c) right ?
    Also, to avoid the waste of energy in heat dissipation, I should ensure proper saturation, correct ?



  10. #10
    Advanced Member level 5
    Points: 17,327, Level: 31
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,411
    Helped
    793 / 793
    Points
    17,327
    Level
    31

    Re: Switch a LED using a NPN Transistor

    Yes. With proper saturation of the transistor the waste heat will be very small. For example 5mA with a 0.1V drop is only 0.5mW. That raises the temperature about 0.1°C for a typical small transistor case which is too low to feel.
    Zapper
    Curmudgeon Elektroniker



--[[ ]]--