0
\$\begingroup\$

I am trying to run a low side switch with the 3.3V GPIO output of the Raspberry Pi (3.3v MCU), 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 about 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 Raspberry Pi input pin? enter image description here

enter image description here

\$\endgroup\$
5
  • 3
    \$\begingroup\$ Also, your LED needs a current limiting resistor or it will fry. \$\endgroup\$
    – DKNguyen
    Nov 14, 2019 at 22:31
  • \$\begingroup\$ What you have is an N-channel MOSFET, not an ordinary "Transistor" and additionally, you have one ill-suited to your intended purpose. Although it is not wonderful at low gate drive (most parts which are have SMD packages), hobby vendors often sell the cdn-shop.adafruit.com/datasheets/irlb8721pbf.pdf as a through-hole part able to handle moderate currents with 3v3 drive. \$\endgroup\$ Nov 14, 2019 at 23:03
  • 2
    \$\begingroup\$ Possible duplicate of Is Adafruit's recommendation for led strip driver MOSFET incorrect? \$\endgroup\$ Nov 14, 2019 at 23:06
  • 2
    \$\begingroup\$ Your voltage divider of R1 and R2 will attempt to pull the output of the Pi up to 6 volts - this is a Very Bad Thing as the upper GPIO protection diode will conduct and attempt to pull the Pi's Vcc above 3.3 volts. \$\endgroup\$ Nov 14, 2019 at 23:33
  • 2
    \$\begingroup\$ Why don't you just use an NPN BJT? Do you have one available? \$\endgroup\$
    – jonk
    Nov 15, 2019 at 0:29

1 Answer 1

2
\$\begingroup\$

Just use a MOSFET that has a rated RDson at your drive voltage, NOT the gate threshold voltage (which is when it just barely starts conducting). In this case, even the gate threshold voltage is far above 3.3V. So it seems like you just weren't looking when you picked the MOSFET.

And if you're willing to put that much effort into the method you've dreamed up, then you might as well just go for a gate driver circuit or IC instead.

For slow speed, this is as simple as just having your RPI drive a transistor it can actually drive to pull the gate down, and a pull-up resistor to pull it up. It's basically just placing a second copy of your top circuit at the gate of your top circuit so the transistor pull the gate down and the pull-up resistor pulls it high. Except this time, actually use a transistor your RPI can drive. This would invert the logic so a pin HI turns the MOSFET off.

\$\endgroup\$

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.