Adding resistor to protect the MCU

Thread Starter

Kelvin Lee

Joined Oct 22, 2018
111
Dear Sir/Madam,

I designed a circuit to control the motor fan on/off according to the signal from P0 of the Microbit MCU. Someone suggest me adding 10K resistor to the circuit in order to protect the MCU.

May I know how the 10K resistor can protect the MCU, if need, why 10K is chosen? Is there a calculation behind?

Best regards,

Kelvin.

Microbit_BD139.png Microbit_BD139_with_10K.png
 

R!f@@

Joined Apr 2, 2009
10,004
Here
1.png

1K protects the MCU port.
10K grounds the base during PORT "off" to make sure the transistor stays off during off period and if the port is floating.
Diode protects the transistor from motor back EMF
 
Last edited:

bertus

Joined Apr 5, 2008
22,882
Hello,

Likely the 1K resistor needs to be smaller.
It all depends on the current used by the fan motor.

Bertus
 

R!f@@

Joined Apr 2, 2009
10,004
1K can be reduced if the transistor does not turn on fully.
But if MCU is at 5V it will work, Besides a 3V motor is quite weak. Unless TS is thinking of a portable drill motor. If that's the case BD139 won't do.

This is what I always use most of the time for transistors around 1A Ic
 

KeithWalker

Joined Jul 10, 2017
3,603
Dear Sir/Madam,

I designed a circuit to control the motor fan on/off according to the signal from P0 of the Microbit MCU. Someone suggest me adding 10K resistor to the circuit in order to protect the MCU.

May I know how the 10K resistor can protect the MCU, if need, why 10K is chosen? Is there a calculation behind?

Best regards,

Kelvin.

View attachment 163501 View attachment 163502
When a microprocessor is booting and before the output pins are assigned, they are floating. This could cause the transistor in your first drawing to be partly turned on, This could cause its power rating to be exceeded. It is good practice to connect a fairly high value (10K) resistor between the transistor base and ground (NOT supply +). This makes sure that during boot the transistor it is turned off.
 

Thread Starter

Kelvin Lee

Joined Oct 22, 2018
111
1K can be reduced if the transistor does not turn on fully.
But if MCU is at 5V it will work, Besides a 3V motor is quite weak. Unless TS is thinking of a portable drill motor. If that's the case BD139 won't do.

This is what I always use most of the time for transistors around 1A Ic
Thanks for your advice, the MCU pin output is 3V. The Ic of BD139 is 1.5A
 

R!f@@

Joined Apr 2, 2009
10,004
Any value from 680R to 1K will do.
All R can be 0.25W types

You can use 1N4001 to 1N4007 diode. What you have on hand will do as long as it can handle 1 to 2 Amps
 

R!f@@

Joined Apr 2, 2009
10,004
I do not mind but it will take some time.
This is all from experience in building circuits.
When you get used to it u just throw in components values that will work without an issue.
But when power consumption is concerned calculation is necessary.

U need to study the gain of the transistor together with ohm's law
 

Thread Starter

Kelvin Lee

Joined Oct 22, 2018
111
I do not mind but it will take some time.
This is all from experience in building circuits.
When you get used to it u just throw in components values that will work without an issue.
But when power consumption is concerned calculation is necessary.

U need to study the gain of the transistor together with ohm's law
I know ohm's law and I find the gain for BD139 from datasheet but I don't know which value I should take for calculation.

Screen Shot 2018-11-10 at 10.29.12 PM.png
 

MrChips

Joined Oct 2, 2009
34,626
Rule of thumb: for transistor in full saturation, use current gain β = 10.

Example, if IC = 100mA
IB = IC/β = 100mA/10 = 10mA

If MCU port output is 3V,

R = (3V - 0.7V)/IB = 2.3V/10mA = 230Ω
Use R = 220Ω

P = I x V = 10mA x 2.3V = 0.023W
0.25W resistor is good to use.
 

Thread Starter

Kelvin Lee

Joined Oct 22, 2018
111
Rule of thumb: for transistor in full saturation, use current gain β = 10.

Example, if IC = 100mA
IB = IC/β = 100mA/10 = 10mA

If MCU port output is 3V,

R = (3V - 0.7V)/IB = 2.3V/10mA = 230Ω
Use R = 220Ω

P = I x V = 10mA x 2.3V = 0.023W
0.25W resistor is good to use.
Thanks a lot, it is very clear. So I should replace the 1KΩ resistor to 220Ω. Is it the key resistor to protect the MCU?

How about the 10KΩ resistor from base to GND? If I want to change, what should I consider?
 

R!f@@

Joined Apr 2, 2009
10,004
Yes, Base R protects the MCU port by limiting current drawn from port and but should be enough to turn on the transistor.

Do your own calculation for base R first.

Base to ground can be lowered but upto a limit.
Calculate base R and then we can tell u about BE resistor
 

Thread Starter

Kelvin Lee

Joined Oct 22, 2018
111
Question is, what is your IC.
Is it 800mA or 80mA ?
I measure the motor with a multimeter, I plug the 3V power to the motor only, when it start up, it requires 800mA, after it start, then only 80mA to keep running.

Someone ask me to find a transistor with Ic at least 800mA, so 1A is better.
 

dl324

Joined Mar 30, 2015
18,216
10K grounds the base during PORT "off" to make sure the transistor stays off during off period and if the port is floating.
I've seen this stated many times, but I find it hard to believe. The leakage current is minuscule.
upload_2018-11-10_7-17-46.png
upload_2018-11-10_7-17-24.png

Maybe if the transistors were being operated at high Vcb, but not at a tenth of the breakdown voltages.

I'm playing around with an LED cube design and I'm driving the common cathodes with a discrete split NPN darlington. The darlingtons are driven by tri-state D flip flops and the cathodes that aren't active are connected to tri-stated outputs with no pulldown resistors. I contemplated putting pulldown resistors on the bases of the darlingtons, but decided not to.

With an operating voltage of 5V, I don't see any LEDs turning on from leakage current.
 

MrChips

Joined Oct 2, 2009
34,626
800mA is transient (lasting only for a short time). You don't need a transistor capable of handling 1A.
Ic continuous @ 200mA will do. NPN transistors 2N3904 and 2N2222 are popular ones.

As for the base pulldown resistor, the value is not critical. This resistor will steal some of the MCU output drive current. You want the pulldown resistor to be 10 times higher or more that the base drive resistor. 10kΩ is fine.
 
Top