I have ordered logic-level MOSFETS of the type IRLZ34N (for the sake of working on a Raspberry Pi) but I have problems in Wiring it up. I have so far connected:

  • +12 to the +12v lane of the switch

  • FET Drain to the blue color of the switch

  • FET Source to the negative terminal of the lab PSU

  • FET Gate to GPIO pin

My setup is comparable to this diagram: enter image description here Apart from me having only wired one color, not three and not using TIP120 but IRLZ34N. Same pinout (Gate/Drain/Source and Base/Collector/Emitter, read from front left to right)

However, the LED strip just lights up blue right away. Even with the raspberry pi turned off. Or the Gate Wire removed from the jumper cable (i.e. 100% sure that there is no voltage on gate)

Where did I go wrong?

  • \$\begingroup\$ double check your fets pinou and exchange the blue one with the one for green. \$\endgroup\$
    – PlasmaHH
    Jul 2, 2015 at 11:04
  • 2
    \$\begingroup\$ Connect the gate to ground. Does it turn off? "Disconnected" is not the same as "zero volts". \$\endgroup\$
    – pjc50
    Jul 2, 2015 at 11:06
  • \$\begingroup\$ Connecting gate to the PSUs ground does indeed turn the FET off. \$\endgroup\$ Jul 2, 2015 at 11:10
  • \$\begingroup\$ How about a circuit diagram and not a cartoon that shows TIP120 Darlington BJTs. \$\endgroup\$
    – Andy aka
    Jul 2, 2015 at 11:37

1 Answer 1


If your GPIO pins are not configured to output low, they'll be in an undefined state. A FET's gate takes effectively 0 input current, so the voltage on the gate will fluctuate arbitrarily, and may well lead to it being biased 'on'.

Add pulldown resistors to your circuit so that the switches default to off unless being driven by the Raspberry Pi.

  • \$\begingroup\$ You're helping me out the second time already Mister Johnson, thank you heaps! What resistor value should I use and where should it be added? Adding a 10k between Gate and GPIO did not yet change anything. \$\endgroup\$ Jul 2, 2015 at 11:21
  • 1
    \$\begingroup\$ Other way round: connect the gate directly (or via a small resistor of a few hundred ohms), and put the 10k between gate and ground. As Nick says, it picks a voltage from stray capacitance, the human body, static in the air, and passing radio waves. \$\endgroup\$
    – pjc50
    Jul 2, 2015 at 11:22
  • 1
    \$\begingroup\$ What pjc50 said! \$\endgroup\$ Jul 2, 2015 at 11:23
  • \$\begingroup\$ Between Gate and Ground means from the FETs Gate pin to the PSUs ground, correct? \$\endgroup\$ Jul 2, 2015 at 11:40
  • \$\begingroup\$ @RobinHeller Correct. \$\endgroup\$ Jul 2, 2015 at 12:03

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.