MOSFET Switching without gate voltage / LED Strip

ledmosfetraspberry pi

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?

Best Answer

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.