Author Topic: BJT Switch Design question.  (Read 3796 times)

0 Members and 1 Guest are viewing this topic.

Offline ghani256Topic starter

  • Contributor
  • Posts: 15
  • Country: pk
BJT Switch Design question.
« on: August 20, 2017, 06:04:19 pm »
Ok so I am revising some transistors and I came across using BJT as a switch, so I decided to design a simple circuit to control an LED. I want someone to kindly check the steps that I followed and offer any suggestion, corrections or improvements that can be made.

The LED needs 20mA for full brightness and at that current has a forward voltage drop of 2.0V. The transistor I am using, 2N3904 has a saturation voltage of 0.2V. Also, I am using a 5V supply. So the collector resistor comes out to be Rc=(5-2-0.2)/(20*10^-3) = 140Ohm.

Now the minimum Hfe specified on the datasheet of the 2N3904 is 30, so I used that to find the base current as Ib = 20/30 = 666uA. Assuming Vbe of 0.7 volt, the base resistor can be found to be Rb = 6456Ohm. I can use the closest 6.2k.

Below is a schematic of the circuit I made in proteus, along with the simulated values of collector current and voltage.
 
The following users thanked this post: petert

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: BJT Switch Design question.
« Reply #1 on: August 20, 2017, 06:31:06 pm »
Now the minimum Hfe specified on the datasheet of the 2N3904 is 30, so I used that to find the base current as Ib = 20/30 = 666uA. Assuming Vbe of 0.7 volt, the base resistor can be found to be Rb = 6456Ohm. I can use the closest 6.2k.

You've done everything correctly except the base current may be a little low. Note that the Hfe is specified with a VCE of 1V, so with a forced beta of 30, it might not quite saturate. However in practise, I think it will be fine. The transistor will probably be close enough to saturated for your application.

https://www.onsemi.com/pub/Collateral/2N3903-D.PDF
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: BJT Switch Design question.
« Reply #2 on: August 21, 2017, 12:05:20 am »
A rule of thumb I learned somewhere is to design for a forced beta of 10
to handle product and temp variation. In fact if my memory serves me
many datasheets show Vcesat at a forced beta of 10.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: BJT Switch Design question.
« Reply #3 on: August 21, 2017, 12:34:56 am »
That's a good rule of thumb, but if you need to be more conservative with the load on your logic output, calculate Ib from the minimum HFE and double it.   Vce_sat will be slightly higher but that's often less of a problem than overloading a MCU I/O pin would be.

However if your operating Ic is far from the current the minimum HFE was specced at, you'll have to search through the transistor datasheet for a HFE vs Ic graph to see if HFE may be lower than the spec at your operating Ic.
« Last Edit: August 21, 2017, 04:00:49 pm by Ian.M »
 
The following users thanked this post: petert

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: BJT Switch Design question.
« Reply #4 on: August 21, 2017, 03:56:05 pm »
Excellent tip, I always thought the rule resulted in a lot of wasted power and
not exactly good LP design. And if one is driving lots of pins that way the
UP has internal power rail issues, as well as the output drivers.

I am curious, I might try your method out to see how much of a power savings
it portends.

There is one problem I see, the min Hfe, or Beta, not speced in sat, so I assume
thats why you double for safety....?



Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: BJT Switch Design question.
« Reply #5 on: August 21, 2017, 04:24:00 pm »
Doubling the base current is just to ensure its actually saturated.  If you didn't double it, you'd be relying on the HFE being far enough above the minimum specified.  When calculating the resistor, don't forget to allow for the drop in the logic '1' output voltage when sourcing the desired base current.

Anyway, its all obsolete nowadays with the easy availability of low Vgs threshold MOSFETs.
 

Offline BigBoss

  • Regular Contributor
  • *
  • Posts: 115
  • Country: fr
Re: BJT Switch Design question.
« Reply #6 on: August 21, 2017, 05:37:51 pm »
Don't put the transistor into hard saturation region.Arrange the resistors so how the transistor will work near saturation with a margin.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: BJT Switch Design question.
« Reply #7 on: August 21, 2017, 05:56:22 pm »
In this case, I'd configure the transistor as an emitter follower and reduce the value of R1 to compensate for the extra voltage drop. Then there would be no base resistor to worry about.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: BJT Switch Design question.
« Reply #8 on: August 21, 2017, 09:45:34 pm »
Don't put the transistor into hard saturation region.Arrange the resistors so how the transistor will work near saturation with a margin.

Why not? This response interests me.
 
The following users thanked this post: petert

Offline BigBoss

  • Regular Contributor
  • *
  • Posts: 115
  • Country: fr
Re: BJT Switch Design question.
« Reply #9 on: August 21, 2017, 10:35:35 pm »
Don't put the transistor into hard saturation region.Arrange the resistors so how the transistor will work near saturation with a margin.

Why not? This response interests me.

Saturation region is inverse in BJTs compare to MOS.If you drive hardly the BJT, a Collector-Base current wants to flow through BC junction and this current returns to signal source.

« Last Edit: August 21, 2017, 10:38:33 pm by BigBoss »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: BJT Switch Design question.
« Reply #10 on: August 21, 2017, 10:44:09 pm »
Don't put the transistor into hard saturation region.Arrange the resistors so how the transistor will work near saturation with a margin.

Why not? This response interests me.

Saturation region is inverse in BJTs compare to MOS.If you drive hardly the BJT, a Collector-Base current wants to flow through BC junction and this current returns to signal source.
We know that. The original topic of the discussion and the person you replied you mentioned saturating a BJT, not a MOSFET.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: BJT Switch Design question.
« Reply #11 on: August 21, 2017, 11:19:22 pm »
There is one additional consideration, using transistor in inverted modem, that is
collector and emitter swapped. That results for some devices in lower Vcesat, some
approaching 10 mV. Tradeoff is breakdown voltages and lower gain. This approach
was used in old designs for analog switching.



Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline BigBoss

  • Regular Contributor
  • *
  • Posts: 115
  • Country: fr
Re: BJT Switch Design question.
« Reply #12 on: August 21, 2017, 11:29:09 pm »
We know that.

If you know that, you know what I'm talking about..
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: BJT Switch Design question.
« Reply #13 on: August 22, 2017, 12:44:46 am »
Here's a further scenario for young players:

You have a logic level output that's too weak to drive your NPN power transistor into saturation at your expected load current.   You have another NPN transistor with Ic_max greater than the power transistor Ib_sat you require.   You DO NOT have a heatsink for the power transistor, and your load cant tolerate a significant extra voltage drop. 

The solution is to use the smaller transistor as an emitter follower to boost the logic output's current capability, then use a suitable resistor between it and the power transistor base to provide Ib_sat at your expected Ic_sat.   Don't forget the Vbe drops of *BOTH* transistors when calculating the resistor.    The emitter follower reduces the load on the logic output by a factor of its HFE, e.g making it easy to provide >100mA base drive to the power transistor from a logic output that is only rated for <4mA.

A pull down resistor may also be added at the driver emitter if you need faster turnoff  or lower off-state leakage current through the load at high temperatures.


« Last Edit: August 22, 2017, 10:35:22 am by Ian.M »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: BJT Switch Design question.
« Reply #14 on: August 22, 2017, 07:39:24 am »
We know that.

If you know that, you know what I'm talking about..
You should have made it clear you were referring to a MOSFET.

Here's a further scenario for young players:

You have a logic level output that's too weak to drive your NPN power transistor into saturation at your expected load current.   You have another NPN trancistor with Ic_max greater than the Ib_sat you require.   You DO NOT have a heatsink for the power transistor, and your load cant tolerate a significant extra voltage drop. 

The solution is to use the smaller transistor as an emitter follower to boost the logic output's current capability, then use a suitable resistor between it and the power transistor base to provide Ib_sat at your expected Ic_sat.   Don't forget the Vbe drops of *BOTH* transistors when calculating the resistor.    The emitter follower reduces the load on the logic output by a factor of its HFE, e.g making it easy to provide >100mA base drive to the power transistor from a logic output that is only rated for <4mA.

A pull down resistor may also be added at the driver emitter if you need faster turnoff  or lower off-state leakage current through the load at high temperatures.
That's a good idea. The downside is slower turn off. One way to improve that, is to connect a small capacitor (100pF to 10nF) between the logic output and the higher current transistor, bypassing the emitter follower and base resistor. Note though that there will be a high current spike, taken from the logic pin, when it goes high. If that's an issue (it shouldn't be, as the logic pin should be able to handle the surge) add a low value resistor 100R to 1k in series with the capacitor.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: BJT Switch Design question.
« Reply #15 on: August 22, 2017, 10:25:11 am »
Actually his sim shows ~ 20 mA needed, so 2 mA into base easily
achieved by Arduino output to sat the transistor. The ATMEGA328
will drive up to 20 mA at 4.1 V (Vcc = 5V).

Rbase = (Vcc - Vbe) / 2 mA


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: BJT Switch Design question.
« Reply #16 on: August 22, 2017, 12:50:50 pm »
Actually his sim shows ~ 20 mA needed, so 2 mA into base easily
achieved by Arduino output to sat the transistor. The ATMEGA328
will drive up to 20 mA at 4.1 V (Vcc = 5V).

Rbase = (Vcc - Vbe) / 2 mA


Regards, Dana.
I think he knows that and had no intention of suggesting two transistors to drive a 20mA LED off an ardunio.
Here's a further scenario for young players:

Often providing more information, even though it's not directly useful to the immediate problem is a good idea, because it helps people solve other problems in the future. What if the next question was going to be about driving a 2A motor? Then that would be useful.
 

Offline eetech00

  • Regular Contributor
  • *
  • Posts: 64
Re: BJT Switch Design question.
« Reply #17 on: August 22, 2017, 01:37:52 pm »
Hi

Add a resistor from transistor base to ground (about 10 * base resistor=62k) to ensure transistor turns off when switch is open. If you do this, then you don't need a SPDT switch. You can use a SPST switch.
« Last Edit: August 22, 2017, 01:40:36 pm by eetech00 »
 
The following users thanked this post: petert


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf