transistor switch calculation

AlbertHall

Joined Jun 4, 2014
12,625
The value of Rc depends on what the output is connected to. Rc need to be low enough to supply whatever current the circuit being switched needs. You say that collector current is to be 20mA in which case Rc = Vs / 20mA
Once that is sorted out then Rb should 10 times Rc. This ensures that the transistor is fully turned on.
 

ScottWang

Joined Aug 23, 2012
7,501
When you want to use the bjt as switch then the bjt will be get into the saturation region and the hFE=10, so when the Ic=20mA then the Ib=20mA/10=2mA, and the Vce=0.2V, Vbe=0.7V, so you can calculate the values of Rc and Rb resistors.
 

Thread Starter

Exjay

Joined Nov 19, 2015
196
I'm getting a different thing. I want my calculation to go in line with the practical result
 

Audioguru

Joined Dec 20, 2007
11,248
The hFE is used when a transistor is used as a linear amplifier that always has plenty of collector-emitter voltage, not when used as a saturated switch. The datasheet for all transistors shows that the base current should be 1/10th or more of the collector current for fairly good saturation, even if the hFE is high.
 

Thread Starter

Exjay

Joined Nov 19, 2015
196
I want a precise calculation, step I will follow to get this resistors value given IC=20mA, HFE=100 , Vs=9V of 2N3904. After I get the values and implement it to on breadboard, I want to see my measurements similar or slightly more with my calculations. Pls am new in electronics
 

ScottWang

Joined Aug 23, 2012
7,501
@Exjay.
If you want the bjt as switch then you can't setup the hFE=100, if you want the hFE=100, Ic=20mA, and that is on the linear region, it can't be a switch,
1. Vcc=9V, Ic=20mA, hFE=100, Vce=0.2V, Vbe=0.7V,
2. Ib=Ic/hFE.
3. Rc=(9V-Vce)/Ic
4. Rb=(9V-Vbe)/Ib
 

WBahn

Joined Mar 31, 2012
32,827
I want a precise calculation, step I will follow to get this resistors value given IC=20mA, HFE=100 , Vs=9V of 2N3904. After I get the values and implement it to on breadboard, I want to see my measurements similar or slightly more with my calculations. Pls am new in electronics
Assuming you did that calculation, the next thing you would need to do is find a 2n3904 transistor that actually has an hFE of 100 at the particular point at which you are operating it. Good luck. You will probably have to sort through hundreds or thousands of transistors before you find one that is acceptably close to having that particular hFE.

Your thread title indicates you are wanting to use the transistor as a switch. This means that you want it to be heavily saturated. This means you want to be operating at a point where the hFE has been significantly reduced. The normal criteria, based on historical datasheet convention, is when hFE is reduced to 10 or less.

But it appears that this is NOT what you are actually trying to do. I'm guessing here, but it sounds like you are trying to simply set up the transistor circuit to have a desired set of conditions and then you want to make measurements to see how close they are. If so, that's quite reasonable and valuable. What you will find is that your results will be all over the place because the actual hFE values for ten different transistors will likely be ten pretty different numbers. But seeing is believing, so let's see.

This sounds like homework or some other type of course work? Is it?

In either case, you will learn the most if YOU make an attempt to work things out and then we can look over your work and help you fix any problems you have.
 

Thread Starter

Exjay

Joined Nov 19, 2015
196
Thanks everybody for your support but I'm still not getting something. What value of HFE is used for switch? And how do I know the value looking at the data sheet and the corresponding operating point?
Or better assume I want a transistor switch with a collector current of 20mA ,supply voltage of 9V what will I look up in the transistor data sheet to get collector current of this 20mA
 

GopherT

Joined Nov 23, 2012
8,009
You put the emitter to ground, add a 470 ohm resistor between collector and 9v supply. (9 / 450 = 20 mA)

Then you need to supply to the base about 10% of the current you have at the collector (which will be 2 mA). So, there is 8.4 volts from Vcc to base = 8.4v / 0.002 = 4200 ohms. So, use 4700 ohms and you will be close enough. Heck, 10k is close enough and my common design.
 
Last edited:

ElectricSpidey

Joined Dec 2, 2017
3,334
If 10 to 1 were written in stone, you couldn’t use the ULN2804A as switches, because the internal resistor is set to 500 to 1 @ 600ma. (12 volts)

Which is pretty much the min gain of a typical Darlington, which is the ratio I have used for 45 years, and never had a problem. (collector current/minimum gain)

Yes 10 to 1 is pretty good as a baseline, but sometimes you may actually need as much a 5 to 1 if you are using one of those older Qs at their max current. And at other times you are reaching the point of diminishing returns driving the base at higher milliwatts to save microwatts at the collector.

Over the years, from what I have seen in data sheets the 10 to 1 ratio is applied to using the Q at or near it’s rated current, but you might want to use a 10 amp Darlington to switch a 100ma load where 10 to 1 would be way overkill, and simply wasting power. But the other side of that coin is using a 10 amp Darlington to switch a 100ma load is overkill.:p
 

WBahn

Joined Mar 31, 2012
32,827
Thanks everybody for your support but I'm still not getting something. What value of HFE is used for switch? And how do I know the value looking at the data sheet and the corresponding operating point?
Or better assume I want a transistor switch with a collector current of 20mA ,supply voltage of 9V what will I look up in the transistor data sheet to get collector current of this 20mA
If you are trying to use the transistor as a switch, then you need to drive it into hard saturation so that the collector-emitter voltage is low and relatively fixed. This means that the collector current will not be dictated by hFE, but rather by the external circuit.

As others have tried to point out, in your circuit (and assuming no load connected to Vc other than the Rc shown) if the transistor is in saturation, then Vce will be low. For silicon BJT transistors a value of 200 mV or so is often assumed.

If you look at the datasheet curves (Figure 17), you'll see that at room temperature the 2n3904 has a saturation voltage (Vcesat) of about 150 mV when the collector current is 20 mA and the base is driven so that hFE is about 10. So Rc will have a voltage of (Vs-Vcesat). You've never indicated what Vs is, so we can only guess. If Vs = 9 V, then Rc will have about 8.85 V across it. To get 20 mA through it, you need it to be about 443 Ω. To get an hFE of 10, you need a base current of 2 mA. Again looking at Figure 17, you'll see that the typical Vbe under those conditions, at room temp, is 0.8 V. So the base resistor you would need would be about 8.2 V / 2 mA or 4.1 kΩ.

Do you see how, unless Vs is pretty low, that the small, relatively fixed values of Vcesat and Vbesat don't matter that much? So just take use Rc = Vs/Ic and Rb = 10·Rc and you will be in the ballpark.
 

Thread Starter

Exjay

Joined Nov 19, 2015
196
Wow!!! I now understand. God bless you all. Please I would like you to be giving me quick response like this whenever future questions arise
 
Top