GPIO Can Only Source/Sink 300uA. Best method for turning on LED?

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Hello, I have a microcontroller that can only source/sink 300uA. What is the best method for driving a 20mA LED, or even a 150mA relay? A typical setup is to use a 2N3904 transistor to drive the LED or relay... but this typically needs around 5mA to activate the gate right?
 

Alec_t

Joined Sep 17, 2013
14,312
but this typically needs around 5mA to activate the gate right?
A 2N3904 should drive a 20mA load easily. Base current ought to be less than 300uA. But do you need as much as 20mA? Modern indicator LEDs give a useful light output at just a few mA. A logic-level MOSFET could drive a relay or LED.
 

WBahn

Joined Mar 31, 2012
30,045
Since a 2N3904 transistor is a BJT, it doesn't have a gate.

When used as a switch, you typically want a base current that is about 10% of the collector current, so that might not work too well for you unless you take some care. But you could use a Darlington configuration and now you are in the ballpark.

A better option would probably br to use a logic-level MOSFET.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406

ebp

Joined Feb 8, 2018
2,332
Arrrgh! Edited about 3 time to try to fix errors - I think its finally right(ish)

"... am I reading that correctly?"


No. What is being specified is the gate to source voltage at which the drain (to source) current is 250 µA - that is, the FET is just beginning to be turned on. Note that this "gate threshold voltage" can vary between 1.9 and 2.6 volts from one device to another. Threshold voltage is usually spec'd at somewhere in the range of 250 uA to 1 mA, even for high current FETs.

To get higher drain current you must have higher gate to source voltage. The parameter of interest is transconductance, which is the ratio of change of drain current to change in gate voltage and is expressed in Siemens (used to be called "mho", which is "ohm" spelled backwards because it is the inverse function of resistance in ohms). The transconductance for that FET is 530 mS, typical. It is annoying they don't specify a minimum so you can design with certainty. [EDIT - mS means milliSiemens, not milliseconds, which is abbreviated ms]

Say you wanted to drive the LED at 20 mA. The transconductance is 530 milliamps per volt, so you would need 20/530 = 0.038 V above the threshold voltage. To be conservative, use the 2.6 V threshold voltage and perhaps take the transconductance as half the "typical" value, so we need 2.6 + 0.076 = about 2.7 volts. If you are running your processor at at least 3 volts, it should work well. Figures 1 and 2 of the datasheet show the curves, but as usual, they're rather hard to read accurately for low current. They are also "typical" values, which is almost always the case for performance curves.

If you look around on the web you can find some good ap notes from ON Semi and others on introduction to power MOSFETs.
e.g. https://www.fairchildsemi.com/application-notes/AN/AN-558.pdf

If you need to drive several LEDs, you might consider using a CMOS inverter or non-inverting buffer. Families like the AC series (e.g for part 74AC04) can source or sink plenty of current for driving indicator LEDs. You can get 2 devices in a small package or 6 in a 14 pin package.
 
Last edited:

ebp

Joined Feb 8, 2018
2,332
If I try to edit the above again, I'll probably break it again:

Left out an important thing:
The current into or out of the gate is nominally zero because the gate is electrically insulated from the rest of the FET. The line from the datasheet of interest here is
Gate−to−Source Leakage Current [abbreviated:] IGSS [measured at:] VDS = 0 V, VGS = ±30 V [value:] 200 nA [max]
and note the whole table is at 25 °C. Leakage current will approximately double for each 10 °C increase in temperature from the test condition, so at 45 °C you would expect it to be about 0.8 µA - but this is a maximum spec and real leakage is likely very much less.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Would this mosfet work? Under "Gate-Threshold-Voltage", with VGS = VDS, that the current draw would be 250uA, am I reading that correctly?
https://www.digikey.com/product-detail/en/on-semiconductor/NTR5103NT1G/NTR5103NT1GOSCT-ND/5801875


Its a nRF51822, technically its 500uA, but trying to leave a little headroom.
I may be reading this wrong, but your questions imply that you're expecting a MOSFET gate to draw current in much the same way that a BJT base does. In fact, they're quite different.

A MOSFET gate behaves more or less like a capacitor. It takes some current for a (usually brief) period of time to charge or discharge the gate when transitioning between "on" and "off" states, but the current draw while maintaining either state is incredibly low (an ideal MOSFET would draw zero current while maintaining state, but in the real world there are leakage paths.)

What this means is that, in many situations, you can basically think of the MOSFET as requiring zero gate current. Larger MOSFETs tend to have higher gate capacitance, which translates into higher gate current and/or slower transition times. If you're dealing with small, low power devices, and you're not switching at high speeds (high kHz to MHz range) you have nothing to worry about. If you're driving larger MOSFETs or higher speeds, then the instantaneous currents required become significant.

You may want a gate resistor to limit inrush current to the MOSFET gate to some reasonable level, but rest assured that whatever peak current level you limit it to will only exist briefly before it settles to near-zero.

Hope I didn't butcher those explanations too badly.
 
Top