I have been trying to drive a 12 V LED array with an IRF3205 MOSFET. I wanted to do this:


simulate this circuit – Schematic created using CircuitLab

However, when I tested it, the LED was only being given 6 V and the MOSFET was dropping 10 V across the drain and source. Going through the things that could be wrong, I found that giving the gate 5 V causes the problem to be solved, and the LED gets the full voltage of the 12 V power supply. The LEDs draw about 100 mA when they are being driven correctly in this way.

I looked up the datasheet, and saw that the gate threshold voltage is 2-4 V, meaning that this should work fine with the 3.3 V Raspberry Pi GPIO.

What is going on, and is there a way I could drive this chip with a 3.3 V Raspberry Pi GPIO pin?

  • 3
    \$\begingroup\$ Not only does 2-4V mean "It could be 4V" it also does not mean that at 4V (or 2V or 3.3V) the RDSon is at its lowest point. \$\endgroup\$ – PlasmaHH Apr 5 '16 at 12:47
  • 8
    \$\begingroup\$ Read the datasheet more carefully. Threshold V is measured at a very low current, much less than your LED needs. Note the gate voltage where they specify the ON resistance. You want to drive the FET with THIS voltage. Or change the FET for one where ON resistance is specified at your actual drive voltage. \$\endgroup\$ – Brian Drummond Apr 5 '16 at 12:47
  • 2
    \$\begingroup\$ The Threshold voltage is the voltage where the MOSFET starts to conduct a little bit. To make the MOSFET conduct enough to drive a significant load (like your LED) it needs some additional voltage also. So you're lucky, your 5 V happens to be just enough. \$\endgroup\$ – Bimpelrekkie Apr 5 '16 at 13:03
  • 2
    \$\begingroup\$ Where abouts did you connect the LEDs? In the drain or in the source? Your schematic implies neither making it fairly useless! \$\endgroup\$ – Andy aka Apr 5 '16 at 13:46
  • 2
    \$\begingroup\$ You ought to use what is called a "logic level MOSFET". This means its gate can be driven properly from logic-level signals. \$\endgroup\$ – Oleksandr R. Apr 5 '16 at 13:47

A fundamental misconception many have with MOSFETs is that the gate threshold is where the "magic" happens. The gate threshold is truly a threshold - it is the absolute threshold of conduction: where the device goes from totally of to jusssssssssssst a little bit on.

A meaningful diagram can be found a few pages deeper:

enter image description here

This shows various relationships between \$V_{GS}\$, \$I_D\$ and \$V_{DS}\$.

With a 12V \$V_{DS}\$ voltage, you can see that even with 4.5V on the gate, the MOSFET will conduct only a small fraction of the 110A that the device is rated for.

Yes, these curves are characterized for pulse behaviour but you get the idea - you need much more than the gate threshold voltage to really get the MOSFET "on" and working well.

If you want to drive a MOSFET from the GPIO line directly, you will need to find one which can sink sufficient current at that 3.3V drive level.

Consider the Fairchild FQP30N06L device:

enter image description here

You can see that even with 3V, the device will conduct a lot of current.

| improve this answer | |

If you want to get rid of MOSFET threshold and turn-on voltage problems, completely, I suggest you try this:

R1 will dissipate about a watt while the LED's ON, so prudence would dictate using about a 2 watt resistor. I like these.

enter image description here

and here's the LTspice circuit list just in case you want to play with the circuit:

Version 4
SHEET 1 1140 708
WIRE 128 0 -16 0
WIRE 304 0 208 0
WIRE 304 32 304 0
WIRE 304 112 304 96
WIRE 128 160 80 160
WIRE 240 160 208 160
WIRE -16 224 -16 0
WIRE 80 224 80 160
WIRE -16 336 -16 304
WIRE 80 336 80 304
WIRE 80 336 -16 336
WIRE 304 336 304 208
WIRE 304 336 80 336
WIRE -16 384 -16 336
FLAG -16 384 0
SYMBOL res 224 -16 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR Value 91
SYMBOL LED 288 32 R0
WINDOW 3 28 68 Left 2
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL voltage 80 208 R0
WINDOW 3 24 96 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR Value PULSE(0 3.3 0 100n 100n 10m 20m)
SYMBOL voltage -16 208 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR Value 12
SYMBOL npn 240 112 R0
SYMATTR Value 2N2222
SYMBOL res 224 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR Value 240
TEXT -8 360 Left 2 !.tran .5
| improve this answer | |
  • \$\begingroup\$ Indeed. MOSFETs are great, but BJTs certainly still have their place and this is a good example. \$\endgroup\$ – pericynthion Apr 5 '16 at 16:02
  • \$\begingroup\$ Yes I think I will switch to a transistor based driven circuit like this one. Thanks a lot \$\endgroup\$ – Ben Stobbs Apr 5 '16 at 16:37
  • \$\begingroup\$ Assuming OP'S led array is already designed for 12V with the appropriate resistors, R1 is unnecessary \$\endgroup\$ – Passerby Apr 5 '16 at 17:37
I looked up the datasheet, and saw that the gate threshold voltage is 2-4v, meaning that this should work fine with the 3.3v Raspberry Pi GPIO.

That means 3.3 V could be below the gate threshold voltage.

Even if it were above, that's still not meaningful. You have to actually read the datasheet instead of skimming the highlights and then making (wrong) assumptions.

On page 2, VGSth is clearly defined to be when the FET conducts 250 µA. It's hard to even imagine how you think that is relevant when you want 100 mA.

Just one line above that, the datasheet specifies RDS(on) at 10 V, which is what this FET is intended to be operated at. Nothing says anything about what happens with only 3.3 V on the gate, other than sometimes maybe it will conduct 250 µA.

Again, this is all clearly spelled out. Sometimes you get ambiguous or poorly written datasheets, but this is not one of them. This FET is simply inappropriate for your application.

| improve this answer | |

You should not need to burn 2W in the resistor. For driving 100mA into the diode you need to burn in a resistor : P = VI ; V = IR; P = I^2*R = .01*R W

Assuming the LED needs about 3-4V to be on, that leaves 8V leftover to burn across this resistor. V = IR; V = 8V, I = .1A; R = 80 Ohms

Going back to the power burned in the resistor, I^2*R = .1^2 * 80 = .01*80 = .8W You would also be burning 4V*.1A = .4W in the LED. This seems a little wasteful to me, and a better way might be to reduce the 12V to something more like 5V.

You need a more responsive FET (lower Vt). You could also just convert your output (0-4V) to (0-12V) using back to back BJT inverters, and use the current FET you have, along with 80Ohm resistor.

| improve this answer | |
  • 1
    \$\begingroup\$ Hi, thanks for the help, but it is a pre made 12v led that has built in resistors already. (I think it's actually a few LEDs in series and then a smaller resistor with less power to dissipate) \$\endgroup\$ – Ben Stobbs Apr 5 '16 at 16:50
  • \$\begingroup\$ Do you have any cheap BJT's? If so just create two easy gates. Connect 1k resistor to Base. Connect emitter to ground. Connect collector to 100k resistor, then to 12V. Now create two of these. Connect the output of the microprocessor to the other end of one of the 1k resistors. This inverters output at the collector connects into the base resistor of the next inverter. This output should convert 0->3.3V to 0->12V. Plug this into your MOSFET gate instead of the raw 3.3V output. ex: courseware.ee.calpoly.edu/~dbraun/courses/ee307/F03/2/… \$\endgroup\$ – jbord39 Apr 5 '16 at 16:58
  • \$\begingroup\$ @jbord39 why use 3 when any common npn transistor can handle 100mA directly, no inverting or driver needed. \$\endgroup\$ – Passerby Apr 5 '16 at 21:21
  • \$\begingroup\$ No real reason, either should work. However, I am unfamiliar with the amount of current that the IO can provide, and this is safer (BJT method would draw ~1-2mA most likely) Also it would require him to potentially un-solder if he had already constructed the driver. \$\endgroup\$ – jbord39 Apr 5 '16 at 22:10

I have now completed the project using a standard 2N3904 NPN Transistor, which can handle the whole 100mA at 12v.

Thanks for everyone's advice.

| improve this answer | |

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.