i am running a low side switch with the 3.3V gpio output of the pi, and for the particular transistor i’m using (irf520 ) the 3.3V is barely enough to turn it on - is there some clever positive feedback i can use to force the transistor ‘very on’ when on and off when off?

How abt this, I put the gpio into high-impedance input mode to turn transistor on, and set output=0 to turn transistor off. current into gpio pin when output=0 is 1.2mA which i suppose is ok. Is 12V after 10Kohms ok on a raspi input pin?


simulate this circuit – Schematic created using CircuitLab

enter image description here

  • 1
    Do you have any idea what are you doing? This is going to fry your gpio peripherals Commented Nov 14, 2019 at 22:27
  • 1
    from the pin description (diagram added above) 0.5mA into the gpio pins is fine. Do you have any idea what you are doing? Commented Nov 14, 2019 at 22:36
  • 1
    The diagram very clearly shows the GPIO inline with a 6V circuit. 6 volts. No one is talking about amperage -- and this is 3/3 people who have warned you! Good luck.
    – goldilocks
    Commented Nov 14, 2019 at 22:40
  • 1
    from here raspberrypi.stackexchange.com/questions/3209/… : A GPIO pin should never be connected to a voltage source greater than 3.3V as prompt damage to the chip may occur as the input pin substrate diodes conduct. There may be times when you may need to connect them to out-of-range voltages – in those cases the input pin current must be limited by an external resistor to a value that prevents harm to the chip. I recommend that you never source or sink more than 0.5 mA into an input pin. Commented Nov 14, 2019 at 22:54
  • >_< en.wikipedia.org/wiki/Hail_Mary_pass
    – goldilocks
    Commented Nov 14, 2019 at 23:48

3 Answers 3


Firstly you are applying 6V to the GPIO and are likely to damage the Pi.

There is nothing you can do to make a MOSFET which needs more than 3.3V miraculously work. Although you could use a transistor to drive the gate.

There ARE MOSFETs which switch with 3.3V Vgs although most need more.

  • the raspi apparently can handle 0.5mA into /out of the gpio pins. Thus it appears this ckt will in fact work - its a miracle! Commented Nov 14, 2019 at 22:37
  • 1
    @jeremy_rutman The GPIO can safely source/sink 16mA - not that this is relevant. Provided the GPIO is in Output mode the equivalent series resistance will limit the voltage to slightly over 3.3V. HOWEVER in Input mode (which all GPIO are on boot) applying 6V will cause the substrate diodes to conduct with possible deleterious consequences.
    – Milliways
    Commented Nov 14, 2019 at 23:12
  • the quote above indicates that 0.5mA is a recommended limit for GPIO as input, and is therefore quite relevant if true. Commented Nov 15, 2019 at 14:09

You have to drive this MOSFET with another transistor(a BJT perhaps). Or you could replace the MOSFET with a BJT. The are good for driving transistors.

  • 2
    Yes, use IRL540 (L means Low Trigger) or similar. Or try NPN BJT TIP120.
    – tlfong01
    Commented Nov 15, 2019 at 0:28

Your schematic is not a good idea: It will put 6V on your GPIO pin, and fry your RPi. You could save yourself some money by avoiding the obvious mistakes :)

The best solution for driving a MOSFET from your 3.3V GPIO is a Darlington Pair. Here's why I say this.

If you want to drive an n-channel MOSFET as you've shown in your schematic, simply swap the npn Darlington device in this answer for a pnp Darlington. Similarly, you could use the npn Darlington to drive a high-side p-channel MOSFET.

I'll stop here. If you're interested in this approach, mod your question & post a comment here. I'll try to help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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