I'm currently trying to get the hang of using a MOSFET as a switch.
My schematic looks something like this (it's the first schematic I've ever drawn, so please don't be too hard on me).
The problem is that the MOSFET is always-on, no matter the gate voltage (or even any gate voltage present at all).
I'm using a 12V DC LED without fixed polarity (so no real flow direction, which is why I drew it as a lamp) which I don't know the resistance of, which is why I put 100 Ohm. I'm almost certain that it does not matter.
Anyhow, the 12V are coming out of a laboratory power supply and I'm only using the positive and negative terminals there. It does not matter if the gate voltage is connected or left out at all, the LED just lights up no matter what.
I've been told (when first trying on a Raspberry Pi, see my last questions if interested) that it could be "stray voltage" and the GPIO pin being floating turning the FET on. I was told to put a pull-down resistor to prevent this.
I've since changed from using the RPI to using the second supply available to me to just provide +3.3v as a replacement for a GPIO Output to make building the circuit easier and more fool-proof (I think I'm one of the bigger fools in electronics for not getting this to run)
From what I have understood I'm supposed to use source as a voltage input, gate as a switch (on/off signal coming in there with a logic level MOSFET like the IRLZ34N) and Drain to connect to the circuit. So that the MOSFET switches (lowers the resistance, becomes conductive, closes the connection) between Drain and Source. Am I wrong in this most basic understanding?