Could you consider writing “How to Use A Mosfet as a Switch” tutorial in a same manner? There are some pitfalls using mosfets as switches and I think community would benefit having a a tutorial on that.

I have followed other tutorials on how to choose a proper mosfet and I think I did it right, but it turned out that the minimum load to activate mosfet was not taken into consideration (I was switching 2mA, 30V). It took me hours to figure out the problem. ]]>

I’ve written a bluetooth activated version, you can check it out and use it freely if you like:

http://pastebin.com/gHuaqaPB ]]>

Confused? Try both and see which gives you the smaller base resistor. That’s the one to use, because that gives you the bigger base current, which certainly also provides the smaller base current.

Remember this: The whole goal here is to make sure the transistor stays in saturation. There is a base current at which the transistor goes into a saturation, but providing more base current doesn’t hurt (as long as we don’t exceed the maximum base current). For example, if one calculation (based on one value for Vbe) gives you a base current of 10mA, and the other calculation (based on the other value for Vbe) gives you a base current of 50mA, then pick your resistor to provide 50mA. This way you know that if everything is the worst case, your transistor will still stay in saturation.

]]>When you say resistor I presume this is a current limiting resistor in series with the LED.

If so, then the answer to your question is “yes”.

]]>If you need 50mA of base current in order to driver your motor, then you can not do that with Arduino. If you limit the current to 40mA, then the transistor might not be in saturation, in which case a) it might overheat and b) the motor might not work properly.

In practice, if it’s not a critical application, e.g. a toy that needs to work for only 2 minutes, you could limit the current to 40mA, use the Arduino, try to avoid stalling the motor, and see if everything works. It probably will.

On the other hand, if it’s a critical application, for instance a prop that runs in a museum in a completely inaccessible space (hanging from the ceiling 40 meters above priceless art) that must work for a year, I would either switch to a much more powerful transistor or use another transistor to boost the Arduino current up to the 50mA.

]]>