Maker Pro
Maker Pro

Why a pull down resistor for transistor base

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 calculated the following:

Current through T2 and Green LED is 72mA
Base current for T2 = 72mA/120 = 600uA

Base resistor for R4 = T1 VCE 5V - VBE T2 0.7V
4.3/600uA = 7.1K
They have this as a 1K.

T1 Ic = 72mA + (5/10K)= 72.5mA
T1 base current is 72.5mA/200=0.362mA

T1 base resistor is 3V (GPIO) - 0.6/0.326mA=7.3K
Can I add a saturation factor of X3
Therefore 3V-0.6/(0.326mA x 3)=1K

Is my value of R2 too big? As the transistor T1 switches on at 1.1V?

Have I got anything wrong?
 

bertus

Moderator
Nov 8, 2019
3,302
Joined
Nov 8, 2019
Messages
3,302
Hello,

Are you sure about the current through the led?
Small leds will have a maximum current of about 20 mA, most times 5 to 10 mA is enough to make it good visible.

Bertus
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
T1 has a Vbe of ~ 0.6 V to 0.7 V. Therefore it will of course turn on at ~ 1.1 V at the input. That is usually no issue with digital outputs of e.g. a microcontroller as logic low is < 0.8 V.
If you want a threshold at a higher voltage, add series diodes into the input leading to the base of T1. Or use a comparator circuit. Not required in my opinion.
 

bertus

Moderator
Nov 8, 2019
3,302
Joined
Nov 8, 2019
Messages
3,302
Hello,

To have a transistor in saturation for switching, it is a common use that the base current is about 1/10 of the collector current.
Some times for small transistors a base current of 1/20 of the collector current is used.
That is why you will see a 1K resistor in stead of the calculated 7.1 K resistor.

Bertus
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Current through T2 and Green LED is 72mA
That would be to much for an LED and ignores the current through the relay coil.
Base resistor for R4 = T1 VCE 5V - VBE T2 0.7V
4.3/600uA = 7.1K
They have this as a 1K.
Perfect for saturating T2 as long swicthing speed is og no concern - which it i not here.
T1 Ic = 72mA + (5/10K)= 72.5mA
  • Where do you take the 72 mA from?
  • 5/10k is not a current but a conductance (1/Ω). You cannot add current and conductance. You surely mean (5 V / 10 kΩ). Take care of your units. Having them in the equation is often helpful in identifying errors, easily spotted when units don't match.
Can I add a saturation factor of X3
3 times is good, 2 times would be sufficient, too, and reduce power dissipation a bit.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
That would be to much for an LED and ignores the current through the relay coil.

Perfect for saturating T2 as long swicthing speed is og no concern - which it i not here.

  • Where do you take the 72 mA from?
  • 5/10k is not a current but a conductance (1/Ω). You cannot add current and conductance. You surely mean (5 V / 10 kΩ). Take care of your units. Having them in the equation is often helpful in identifying errors, easily spotted when units don't match.

3 times is good, 2 times would be sufficient, too, and reduce power dissipation a bit.
Hi,the 72mA is current through the LED and Relay together.
Yes it should be 5V/10K.
Ok, hopefully the microcontroller will only operate it's GPIO at 3V high and OV low. If the low is <O.8V and I will not get the problem.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Hi,the 72mA is current through the LED and Relay together.
But not through T1, only through T2.
Take some time and think about the circuit. I get a feeling you haven't completely understood what's going on and where.
 

ratstar

Aug 20, 2018
485
Joined
Aug 20, 2018
Messages
485
(excuse this horrible banter I cant help myself.)

Your amping it once, outside the arduino? and then your amping again inside the relay module, because your using off the shelf parts look at all the useless part repetitions there is in working modularly.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
But not through T1, only through T2.
Take some time and think about the circuit. I get a feeling you haven't completely understood what's going on and where.
Yes you are correct.
I measured the current going from the 5V rail when the relay and green led are on, it was 72mA.
The current through T1 is 5V/10K = 0.5mA.
So when I calculated the base resistor value for T1 I added 72mA + 0.5mA / 200 (min Hfe).
Was that incorrect?
Thanks in advance
 

ratstar

Aug 20, 2018
485
Joined
Aug 20, 2018
Messages
485
Got another piece of useless trivia, a pull up resistor can be used as a passive inverter, and it used to go on the input of the controls into the old 80's arcade games, because they need to send in inverted values for some reason no idea.

I like to call em pu-tang wires, simplest component is just a wire inverter.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Your amping it once, outside the arduino? and then your amping again inside the relay module,
Possibly to acivate the relay with n active high output from the arduino?
If the software were to drive the relay with an active low output T1 could be omitted.
 
Top