Maker Pro
Maker Pro

Why a pull down resistor for transistor base

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi
I have attached a image I saw on the web. The transistor is used to drive a relay module by inverting the logic, which ensures that the relay PNP is switched off too.
Why is the 10K required pull down from base of transistor?
How is this value calculated?
If the input of the transistor (say from a GPIO) at 3.3V, is it because the micro I may float?
I thought that there would be a pull up internally on the micro side, so it can't be because of leakage current?

Can anyone help?

Thanks in advance
 

Attachments

  • 13kXP.png
    13kXP.png
    15.4 KB · Views: 32

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
It is not strictly required. It ensures the transistor is off under these conditions:
  • no diver connected to the input
  • driver at the input not active, e.g. a microcontroller's GPIO pin during reset before it is initialized as output by the boot software.
The value is kind of arbitrary. It needs to be high enough to present no noticeable burden to the driving stage. It needs to be low enough to ensure the transistor is off. 10 kΩ to 100 kΩ, whatever is available will usually work.
I thought that there would be a pull up internally on the micro side, so it can't be because of leakage current?
For one there isn't necessarily a pull-up, depends on the component. Verify by studying the datasheet.
Second a pull-up will activate the transistor which may not be what you want, see above.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
It is not strictly required. It ensures the transistor is off under these conditions:
  • no diver connected to the input
  • driver at the input not active, e.g. a microcontroller's GPIO pin during reset before it is initialized as output by the boot software.
The value is kind of arbitrary. It needs to be high enough to present no noticeable burden to the driving stage. It needs to be low enough to ensure the transistor is off. 10 kΩ to 100 kΩ, whatever is available will usually work.

For one there isn't necessarily a pull-up, depends on the component. Verify by studying the datasheet.
Second a pull-up will activate the transistor which may not be what you want, see above.
Thanks for the help.
The micro has a 100R series resistor that will be in series to the 1K base resistor. That will probably cause no problem I think?
I think it probably will not hurt to have the 10K to OV.
Rhanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
That will probably cause no problem I think?
Don't "think". Calcuate the resulting base current, multiply by the gain of the transistor, check if the resulting current is sufficient for the load.
That is very basic engineering and you should not need a forum to help you with that.
 

ratstar

Aug 20, 2018
485
Joined
Aug 20, 2018
Messages
485
If the transistor isnt switching on, you could try a higher ohmage, for the pulldown.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Don't "think". Calcuate the resulting base current, multiply by the gain of the transistor, check if the resulting current is sufficient for the load.
That is very basic engineering and you should not need a forum to help you with that.
I have, it works fine. Thanks.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
If the transistor isnt switching on, you could try a higher ohmage, for the pulldown.
The 1K and 10K combination switch on the transistor. This is turn drives the. NPN on. The relay contacts then switch over.
 

Nanren888

Nov 8, 2015
622
Joined
Nov 8, 2015
Messages
622
Don't "think". Calcuate
It might be easy to miss the excellent message here.
The data sheets of the transitors will give values, parameters that let you calculate whether is works, off when supposed to be and on when supposed to be.
But, even more it will give ranges of values as well as typical values.
Here's where good design comes in.
The experimental approach will often get one prototype going, with that particular transistor you picked out of the packet, but if you really want to be able to say that you designed it, calculate for the ranges of values & design, choose values, so that it to work for every sample that's within specs.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
It might be easy to miss the excellent message here.
The data sheets of the transitors will give values, parameters that let you calculate whether is works, off when supposed to be and on when supposed to be.
But, even more it will give ranges of values as well as typical values.
Here's where good design comes in.
The experimental approach will often get one prototype going, with that particular transistor you picked out of the packet, but if you really want to be able to say that you designed it, calculate for the ranges of values & design, choose values, so that it to work for every sample that's within specs.
Thanks, I am starting off in Electronics, so unsure of a few things. I will post up my calculations so that people can see if I have done everything correctly. Thanks for the advice.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi all,
Just to be clear I am only ensuring the PNP is in the off and on condition. I am not driving the relay coil.

The 10K pull up keeps it off as base emitter are both at 5V.
The additional transistor with 1K base resistor and 10K pull down is what I have added. So when this is driven high, the transistor pulls the PNP base to OV, which switches the PNP on. When driven by a low, the PNP will be off.

So in that regard, what collector current would you recommend? I have a 10K pull up, so Ic will be 5/10K i.e. 0.5mA.

The base current is 3V-0.6/(1K) i.e. 2.4mA. I wanted to make sure that the transistor is fully saturated.
This works on my breadboard.
My question is how I can ensure this is correct in terms of calculations.
Any help would be appreciated.
Thanks.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
he 10K pull up keeps it off as base emitter are both at 5V.
Which resistor do you mean? There is one labeled 4.7 k - 10 k as pull-up another labeld 10 k as pull-down.
When discussing a circuit, please label components with unique names (geek speak: reference designators) such as R1, R2, R3, C1, C2, ... and refer to these labels. This makes it absolutely clear what you are talking about.
It is also good practice to indicate any voltages or currents that turn up in the discussion with names and directional indicators (arrows) or polarity indicator (+, -). And most importantly between which points voltages are measured or within which connections currents are measured. This avoid ambiguities such as "voltage at the base of Qx" which we see rather often here but which makes no sense as this statement doesn't indicate the reference to which this voltage is being measured.

To give you an example I annotated (partly) your original schematic:
upload_2021-2-18_10-59-23.png
In this example the "voltage at the base of T1" is meaningless. Vbe is a different voltage than Vbase-gnd, although both voltages can be measured with one tip of the probe at the base of T1. You see the point?
That's just for this one voltage. I'll leave the other voltages and currents (as needed) to you.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Which resistor do you mean? There is one labeled 4.7 k - 10 k as pull-up another labeld 10 k as pull-down.
When discussing a circuit, please label components with unique names (geek speak: reference designators) such as R1, R2, R3, C1, C2, ... and refer to these labels. This makes it absolutely clear what you are talking about.
It is also good practice to indicate any voltages or currents that turn up in the discussion with names and directional indicators (arrows) or polarity indicator (+, -). And most importantly between which points voltages are measured or within which connections currents are measured. This avoid ambiguities such as "voltage at the base of Qx" which we see rather often here but which makes no sense as this statement doesn't indicate the reference to which this voltage is being measured.

To give you an example I annotated (partly) your original schematic:
View attachment 51006
In this example the "voltage at the base of T1" is meaningless. Vbe is a different voltage than Vbase-gnd, although both voltages can be measured with one tip of the probe at the base of T1. You see the point?
That's just for this one voltage. I'll leave the other voltages and currents (as needed) to you.
Sorry for the confusion. The relay module has the PNP, relay, fly back diode etc.
I have added only the 1K (R2) to base of T2, The 10K pull down at R1, the transistor T2 and a 10K pull up at R3.

R3 ensures that the PNP is off when T1 is off as the base of the PNP and it's emitter are at 5V.
When I apply 3V to R2, this switches on T2, pulling the base of the PNP (on the relay module low) and switches it on. This then operates the relay.

From this, I am only operating T2 between on and off. I have calculated Ic to be 0.5mA.
The value of In is 2.34mA.
The circuit works but I wanted to ask if my calculations look correct when I make say 10 or 20 of these boards.
I hope that is a bit clearer and sorry for the confusion.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
I have calculated Ic to be 0.5mA.
Ic of T1 or T2?
Please re-draw the circuit with all useful information and be specific in your post. We could assume something and then calculate another thing but still be off from the real thing.
Also: the whole thing of T1 being on or off depends not only on the base-emitter voltage of T1 but also on the load current and we have no clue what this is. For T1 to be fully on (geek term: saturated), the base drive needs to be high enough to bring the collector emitter voltage down to the saturation voltage (a few 100 mV, typically).
Also: 2TY is not a transistor type. You could have us guessing that this is the marking on a MMBT8550 transistor, but better to provide us with the real transistor type used and possibly a link to the datasheet so we do not have to search for one.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Ic of T1 or T2?
Please re-draw the circuit with all useful information and be specific in your post. We could assume something and then calculate another thing but still be off from the real thing.
Also: the whole thing of T1 being on or off depends not only on the base-emitter voltage of T1 but also on the load current and we have no clue what this is. For T1 to be fully on (geek term: saturated), the base drive needs to be high enough to bring the collector emitter voltage down to the saturation voltage (a few 100 mV, typically).
Also: 2TY is not a transistor type. You could have us guessing that this is the marking on a MMBT8550 transistor, but better to provide us with the real transistor type used and possibly a link to the datasheet so we do not have to search for one.
Ok, I will provide a better schematic. Please bear with me and thanks
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi,
I have attached a image of the schematic.
I have only added the section on the left i.e. R1,R2, R3 and T1.
R3 added to keep T2 off.
The relay coil is 600R, and driven from 5V.
T2 is S8850 PNP transistor.

I have added the circuit to give base current of 2.3mA i.e. 3-0.6/1K. I am only trying to switch T1 on and off, so that T2 can be controlled on and off, with correct logic i.e. 1 is on and 0 is off from R1 input (GPIO).
5/R3(10K) is 0.5mA.
Does that look ok?

T2 current would be 5V/600R 8.3mA.
I am not sure how to make sure with calculations if my circuit is correct, although it works when I have tested it, VCE of T1 goes to around 20mV when T1 is switched on.

I hope this helps. Any help would be appreciated. Thanks in advance.
 

Attachments

  • IMG_18022021_110312_(1080_x_811_pixel).jpg
    IMG_18022021_110312_(1080_x_811_pixel).jpg
    208.2 KB · Views: 7

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Two problems:
  1. The current drawn by the relay is still unknown :(
  2. The green LED has no current limiting resistor. It will burn quickly as it is directly connected between 5 V and gnd by T2.
To get you started:
  1. Add a series resistor to the green LED. I think you may have meant R6 to be this current limiter, but both sides of R6 are tied to gnd, thus rendering R6 useless.
  2. Calculate the total worst case collector current through T2 (sum of relay current and current through green LED.
  3. calculate the worst case base current for T2 by dividing max. collector current by the min. DC gain (as this is a slow on/off switching circuit DC gain is relevant, not AC gain).
  4. From the base current and the voltage drops Vce(T1) and Vbe(T2) calculate the minimum required base resistor R4. If you want to add a safety margin, reduce that value by e.g. 10 % (increase current by 10%) and select the next standard value for R4.
  5. Calculate the collector current of T1 (use the currents through R3 and R4) and perform the same steps as above to get a value for the T1's base resistor R1.
R3 can be 10 kΩ as it is. It is only required to draw the base of T2towards 5 V, thus making Vbe(T2) ~ 0 V. This is good enough to turn T2 off.

The same goes for R2. However, R2 will contribute to the current through R1 as I(R2) = Vbe(T1)/R2 needs to be taken into account. If you don't want this to happen, move R2 to the left of R1 where it will still work as pull-down. Whether 10 Ω is sufficient for R2 depends on the impedance of the output stage driving into the input (R1) of your circuit). R2 needs to fulfill these conditions:
  • If the output of the driver is active High (I assume 5 V as the rest of your circuit), the driver needs to be able to supply current both into the base of T1 and through R2. For a typical µC output capable of driving a few mA this is no problem.
  • If th eoutput of the driver is high impedance, the value of R2 needs to be low enough such that Vbe(T1) is much less than 0.6 V (typical value for an NPN) to turn T1 securely off. Design for 0.1 V max. and you're save. If, for example, the driver's output would deliver 1 µA (just a ballpark figure as I don't know what's driving into R1), this 1 µA would drop 10 mV across R2, definitely hood enough to turn T1 off.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Two problems:
  1. The current drawn by the relay is still unknown :(
  2. The green LED has no current limiting resistor. It will burn quickly as it is directly connected between 5 V and gnd by T2.
To get you started:
  1. Add a series resistor to the green LED. I think you may have meant R6 to be this current limiter, but both sides of R6 are tied to gnd, thus rendering R6 useless.
  2. Calculate the total worst case collector current through T2 (sum of relay current and current through green LED.
  3. calculate the worst case base current for T2 by dividing max. collector current by the min. DC gain (as this is a slow on/off switching circuit DC gain is relevant, not AC gain).
  4. From the base current and the voltage drops Vce(T1) and Vbe(T2) calculate the minimum required base resistor R4. If you want to add a safety margin, reduce that value by e.g. 10 % (increase current by 10%) and select the next standard value for R4.
  5. Calculate the collector current of T1 (use the currents through R3 and R4) and perform the same steps as above to get a value for the T1's base resistor R1.
R3 can be 10 kΩ as it is. It is only required to draw the base of T2towards 5 V, thus making Vbe(T2) ~ 0 V. This is good enough to turn T2 off.

The same goes for R2. However, R2 will contribute to the current through R1 as I(R2) = Vbe(T1)/R2 needs to be taken into account. If you don't want this to happen, move R2 to the left of R1 where it will still work as pull-down. Whether 10 Ω is sufficient for R2 depends on the impedance of the output stage driving into the input (R1) of your circuit). R2 needs to fulfill these conditions:
  • If the output of the driver is active High (I assume 5 V as the rest of your circuit), the driver needs to be able to supply current both into the base of T1 and through R2. For a typical µC output capable of driving a few mA this is no problem.
  • If th eoutput of the driver is high impedance, the value of R2 needs to be low enough such that Vbe(T1) is much less than 0.6 V (typical value for an NPN) to turn T1 securely off. Design for 0.1 V max. and you're save. If, for example, the driver's output would deliver 1 µA (just a ballpark figure as I don't know what's driving into R1), this 1 µA would drop 10 mV across R2, definitely hood enough to turn T1 off.
Hi thanks for your reply. Please remember the relay module is not my design, it was an brought via a website (not by me).

I just want to know that my additional circuit looks fine and confirm with calculations.

I made R3 a 10K, so Ic woul be 5/10K = 0.5mA.ib calculated at 2.34mA. everything seems to work, how can verify that my calculations are correct?

Thanks in advance.

The relay coil is 600R, powered from 5V. So IC will be 5/600=8.3mA.

Thanks again for your help. I will do the calculations as you have suggested and then show them to you, hope that is ok. Thanks
 
Last edited by a moderator:

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Two problems:
  1. The current drawn by the relay is still unknown :(
  2. The green LED has no current limiting resistor. It will burn quickly as it is directly connected between 5 V and gnd by T2.
To get you started:
  1. Add a series resistor to the green LED. I think you may have meant R6 to be this current limiter, but both sides of R6 are tied to gnd, thus rendering R6 useless.
  2. Calculate the total worst case collector current through T2 (sum of relay current and current through green LED.
  3. calculate the worst case base current for T2 by dividing max. collector current by the min. DC gain (as this is a slow on/off switching circuit DC gain is relevant, not AC gain).
  4. From the base current and the voltage drops Vce(T1) and Vbe(T2) calculate the minimum required base resistor R4. If you want to add a safety margin, reduce that value by e.g. 10 % (increase current by 10%) and select the next standard value for R4.
  5. Calculate the collector current of T1 (use the currents through R3 and R4) and perform the same steps as above to get a value for the T1's base resistor R1.
R3 can be 10 kΩ as it is. It is only required to draw the base of T2towards 5 V, thus making Vbe(T2) ~ 0 V. This is good enough to turn T2 off.

The same goes for R2. However, R2 will contribute to the current through R1 as I(R2) = Vbe(T1)/R2 needs to be taken into account. If you don't want this to happen, move R2 to the left of R1 where it will still work as pull-down. Whether 10 Ω is sufficient for R2 depends on the impedance of the output stage driving into the input (R1) of your circuit). R2 needs to fulfill these conditions:
  • If the output of the driver is active High (I assume 5 V as the rest of your circuit), the driver needs to be able to supply current both into the base of T1 and through R2. For a typical µC output capable of driving a few mA this is no problem.
  • If th eoutput of the driver is high impedance, the value of R2 needs to be low enough such that Vbe(T1) is much less than 0.6 V (typical value for an NPN) to turn T1 securely off. Design for 0.1 V max. and you're save. If, for example, the driver's output would deliver 1 µA (just a ballpark figure as I don't know what's driving into R1), this 1 µA would drop 10 mV across R2, definitely hood enough to turn T1 off.
Hi,
I have just noted that the circuit switches on at 1.1V and off at 0.56V.
I need to switch on at 3V and off at lower then 0.56V.
I have measured the current through the relay and green LED to be 72mA.
 
Top