I'm using a logical pin output (3.3V) to drive a NPN darlington transitor with the max current possible to minimize the fall and rise times. My microcontroler has a 20mA max output current per logical pin and the max transistor base current is 120mA.

My question is: without a resistor, what would happen? The micro would burn it up giving a (3.3-0.7)/0 current or it would simply stick with 20mA?

I have exaclty same doubt about driving a N-channel MOSFET. What would happen at the gate? With the gate capacitance discharged, it would be a short to the ground leading to big current? Is a resistor needed in this case?

  • \$\begingroup\$ that depends on the microcontroller, some are short-circuit resistant, some aren't \$\endgroup\$ – Jasen Nov 9 '15 at 9:13
  • \$\begingroup\$ Could you give some additional information on how this is presented on datasheets? \$\endgroup\$ – GabrielRado Nov 9 '15 at 9:15
  • \$\begingroup\$ you need to read about the GPIO pins on the microcontroller, different makers present this in different ways.. \$\endgroup\$ – Jasen Nov 9 '15 at 9:39
  • My microcontroler has a 20mA max output current

It might, but I have often seen that figure in the "absolute maxima" section. You do know that that section is NOT what you use to design a working system? (You use that section it to design a surviving system, which is something very few of use have to do.)

  • "without a resistor, what would happen? "

You will be operating the uC outside its rated specs, so anything can happen. (It is your job to keep the current within a stated maximum. Unless the documentation very specifically says so, the uC doesn't have any current-limiting hardware.) A very realistic scenario is that it will work 100% OK on your workbench, but will fail intermittently and mysteriously in in small percentage of devices in the field, and maybe only at full moon.

  • I have exaclty same doubt about driving a N-channel MOSFET.

Strictly speaking, you must use a current-limiting resistor. In practice, when using a small FET, don't bother. For a large (high current, high gate capacity) FET the resistor is needed, but not just for limiting the drive current: the switching of the load current will couple capacitively to the gate, and can give an 'kickback current' that does nasty things to your uC. In such a case, better use a dedicated gate driver chip.

And as Icy noted, do check that your FET operates OK with 3.3V on the gate. Yet another reason to use a gate driver chip.


Relying on the maximum current being limited by the output of the microprocessor wouldn't be good design. You can ensure that the maximum current available from the micro is used by having the correct value resistor in the base connection. (3.3-0.7)/0.02 = 130R.

If this isn't giving you enough base current - consider using a Darlington pair instead of a single BJT. A Darlington pair is a pair of BJT's connected together in a way that makes it look like a single BJT, but with a much higher gain, and a 1.4V base emitter voltage. They can be constructed from 2 discrete BJT's or are more conveniently available in a single package.

And yes, you do have the same problem with the MOSFET - but with the additional problem that 3.3V is probably not enough gate voltage to ensure that the MOSFET is turned on hard.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.