BJT Switch Design question. - Page 1
Forum section: electronics / beginners

author: ghani256
author_rank: Contributor
timestamp: August 20, 2017, 06:04:19 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 20, 2017, 06:31:06 pm
content: Quote from: ghani256 on August 20, 2017, 06:04:19 pmYou've done everything correctly except the base current may be a little low. Note that the Hfe is specified with a VCEof 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

author: danadak
author_rank: Super Contributor
timestamp: August 21, 2017, 12:05:20 am
content: A rule of thumb I learned somewhere is to design for a forced beta of 10to handle product and temp variation. In fact if my memory serves memany datasheets show Vcesat at a forced beta of 10.Regards, Dana.

author: Ian.M
author_rank: Super Contributor
timestamp: August 21, 2017, 12:34:56 am
content: 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 HFEand 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 HFEwas specced at, you'll have to search through the transistor datasheet for a HFEvs Ic graph to see if HFEmay be lower than the spec at your operating Ic.

author: danadak
author_rank: Super Contributor
timestamp: August 21, 2017, 03:56:05 pm
content: Excellent tip, I always thought the rule resulted in a lot of wasted power andnot exactly good LP design. And if one is driving lots of pins that way theUP 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 savingsit portends.There is one problem I see, the min Hfe, or Beta, not speced in sat, so I assumethats why you double for safety....?Regards, Dana.

author: Ian.M
author_rank: Super Contributor
timestamp: August 21, 2017, 04:24:00 pm
content: Doubling the base current is just to ensure its actually saturated. If you didn't double it, you'd be relying on the HFEbeing 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.

author: BigBoss
author_rank: Regular Contributor
timestamp: August 21, 2017, 05:37:51 pm
content: Don't put the transistor into hard saturation region.Arrange the resistors so how the transistor will work near saturation with a margin.

author: Zero999
author_rank: Super Contributor
timestamp: August 21, 2017, 05:56:22 pm
content: 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.

author: Benta
author_rank: Super Contributor
timestamp: August 21, 2017, 09:45:34 pm
content: Quote from: BigBoss on August 21, 2017, 05:37:51 pmWhy not? This response interests me.

author: BigBoss
author_rank: Regular Contributor
timestamp: August 21, 2017, 10:35:35 pm
content: Quote from: Benta on August 21, 2017, 09:45:34 pmSaturation 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 21, 2017, 10:44:09 pm
content: Quote from: BigBoss on August 21, 2017, 10:35:35 pmWe know that. The original topic of the discussion and the person you replied you mentioned saturating a BJT, not a MOSFET.

author: danadak
author_rank: Super Contributor
timestamp: August 21, 2017, 11:19:22 pm
content: There is one additional consideration, using transistor in inverted modem, that iscollector and emitter swapped. That results for some devices in lower Vcesat, someapproaching 10 mV. Tradeoff is breakdown voltages and lower gain. This approachwas used in old designs for analog switching.Regards, Dana.

author: BigBoss
author_rank: Regular Contributor
timestamp: August 21, 2017, 11:29:09 pm
content: Quote from: Hero999 on August 21, 2017, 10:44:09 pmIf you know that, you know what I'm talking about..

author: Ian.M
author_rank: Super Contributor
timestamp: August 22, 2017, 12:44:46 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 22, 2017, 07:39:24 am
content: Quote from: BigBoss on August 21, 2017, 11:29:09 pmYou should have made it clear you were referring to a MOSFET.Quote from: Ian.M on August 22, 2017, 12:44:46 amThat'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.

author: danadak
author_rank: Super Contributor
timestamp: August 22, 2017, 10:25:11 am
content: Actually his sim shows ~ 20 mA needed, so 2 mA into base easilyachieved by Arduino output to sat the transistor. The ATMEGA328will drive up to 20 mA at 4.1 V (Vcc = 5V).Rbase = (Vcc - Vbe) / 2 mARegards, Dana.

author: Zero999
author_rank: Super Contributor
timestamp: August 22, 2017, 12:50:50 pm
content: Quote from: danadak on August 22, 2017, 10:25:11 amI think he knows that and had no intention of suggesting two transistors to drive a 20mA LED off an ardunio.Quote from: Ian.M on August 22, 2017, 12:44:46 amOften 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.

author: eetech00
author_rank: Regular Contributor
timestamp: August 22, 2017, 01:37:52 pm
content: HiAdd 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.