I am using the power MOSFET IRF504N. I am not sure if my Rpi's GPIO 3V3 signal can directly input to the gate of the MOSFET which requires 4V minimum.

I guess that I don't need a gate driver to shift up the Rpi's 3V3 signal. So I am now experimenting, ...

I read the IRF540N datasheet which says Vgs(th) is 2V minimum and 4V maximum. Does it mean Vgs between 2V to 4V won't guarantee anything?

I forgot to mention that the motor is DC12V 100mA (37GB528-70 70rpm). And I also want to drive another solenoid valve DC12V 300mA (FDZ-5). The picture below shows the two little guys.

Motor and Solenoid Valve Picture


simulate this circuit – Schematic created using CircuitLab

  • 1
    For future reference any edits to a question can be made using the edit button at the bottom of the question. Edits to the question, (including adding additional information) should not be posted as answers. – Darth Vader Feb 9 at 10:21
  • Many thanks for your advice and help on how to edit the question.. – tlfong01 Feb 9 at 14:37
  • You should add a current limiting resistor and a pull down resistor on the MOSFET gate. – MatsK Feb 9 at 16:53
  • Many thanks for your advice. I googled and found that the current limiting series resistor could be 330 to 470R, and gate pull down resistor 1k to 2k. The EE StackExchange I googled is: Mosfet does not turn off - 2017may30 electronics.stackexchange.com/questions/308054/… – tlfong01 Feb 10 at 6:56

This might work, but it won't work well.

The parameter you've asked about (Vgs(th) is 2V minimum and 4V maximum) means this:
The threshold voltage at which conduction begins from Drain to Source is a minimum of 2 V, and a maximum of 4 volts. Since the RPi GPIO is 3.3 V, there will be some devices that may not conduct at all. See Fig 3 in this spec sheet.

Bottom Line: You need to drive your chosen MOSFET with a much higher voltage than the 3.3 V available from the RPi GPIO pin if you want your circuit to operate "properly" (within design specifications). You should have around 7 V gate-source voltage for best results - at least for this MOSFET.

  • I am confused. I don't understand why you say Rpi GPIO is 3V6. – tlfong01 Feb 11 at 1:53
  • @tlfong01: It was an error... thank you for catching it. I've corrected my post. – Seamus Feb 11 at 7:37
  • I neither understand why it is 7V and not 5V or 9V. Does this magic number 7 applies to all loading? – tlfong01 Feb 12 at 5:17
  • You need enough G-S voltage to form the D-S channel AND drive the channel resistance down to a "low" value. The G-S voltage should be "well above" the threshold voltage (up to 4 V), and "well below" the maximum rating (20 V). I chose 7 as a reasonable value. You can use anything you like between the threshold and the max. Go for it. You can actually learn quite a lot by reading the spec sheets, tutorials and studying the application notes that most mfrs publish. – Seamus Feb 12 at 9:52
  • Well, I did read the tutorials and application notes before studying the datasheet. Fig 3 of the datasheet penzu.com/p/f445eb50 seems to say that for Vgs = 5V, the channel opens wide enough to let 20A pass through. So I don't understand why Vgs 5V cannot do for less current. I already have a level shifter converting Rpi GPIO 3V3 signal to 5V, so I wish to know if 5V will do as good as 7V, for my 35mA motor, and my original question is if direct Rpi GPIO 3V3 signal without level shifting can also do for such small loading. – tlfong01 Feb 13 at 7:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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