But not logic level, despite the blurb on the Sparkfun page. But as you imply, not a problem if the OP will be switching 10V or more (with an NPN transistor driving the mosfet).
Aye, there's the thing. With a P-channel MOSFET having it "logic level" is less important, as it's the voltage difference between the power supply (source) and the gate that is key, not the voltage level at which you are driving the gate. If you are running it with a 5V supply then yes, you need a "Logic level" one as it is going to be switching with those 5V levels. However, if you are switching higher voltages with it then you will be needing an NPN BJT or N-channel MOSFET to drive the P-channel MOSFET - that is, to connect the gate to ground when you want to turn it on. During "off" time the P-channel's gate would be pulled up to your power supply voltage (12V, 15V, whatever), and then to turn it on you activate a small signal BJT NPN which switches that gate to ground creating the voltage difference it needs to switch on.
If you think about it, having the source at 12V and switching the gate with a 5V signal referenced to the lower side of the load (ground), the Vgs is going to be switching between -7V (-12V + 5v) and -12V (-12V + 0V), not between -5V and 0v.
If you do not use a transistor to drive the P channel mosfet, when your uC output is high you send +5 hence the 12-5 = 7, which would turn it on potentially and not off like one would want it. So whether you are at 0 or 5 v output the thing would always be open.
If you put a transistor where the collector is connected to the driving source (12v here) to drive the mosfet, then you send either 0 Gate-source voltage or 12V Gate-source. This would make sure it is turned on/off provided the Vgs(th) is at least 8 or so.
Am I understanding this correctly?
The one from sparkfun seems to be fully on at 10Vgs,I think it is appropriate for 12V then?
It looks like the max drain-source voltage is 60V, but the specs say Vgs +- 25V. Does this mean that the mosfet can be used up to 60V but the Vgs cannot be more less than -25V???
I might buy a few 'logic level' P-channel mosfets, and perhaps a few others that can be used for 12V or more (the Sparkfun one looks like it can do 12v).
You want to switch the high side of 12V with a p-channel mosfet ?
Is there a good reason for that ? Switching the low side is easier.
You need a npn-transistor and a few resistors.
The collector of the npn-transistor is connected to the gate of the mosfet. There is also a resistor from 12V to the gate.
Arduino output LOW -> transistor off -> gate of mosfet is 12V (via resistor) -> mosfet is off.
Arduino output HIGH -> transistor on -> gate is 0V -> mosfet is on.
The sparkfun p-channel mosfet is perfect for this.
The Vgs (gate-source) is maximum 25V.
The source is connected to the 12V and the gate switches between 12V and 0V. So that is okay. If you want to switch more than 25V with a p-channel mosfet, you need a different circuit (or switch the low-side with a n-channel mosfet).
You see that I have one N-channel mosfet to switch the sensor heater on, and a P-channel mosfet to switch the power between 1.4V and 5V (it requires cycles that switch between 5v and 1.4v). Turns out I can use PWM on the N channel mosfet to simulate 1.4V so the P channel mostfet is not necessary. However, I think I will still buy a few P channel mosfets that I will have in stock in case... Won't cost me too much, so not to worry if I never use them.
Thanks for your help, as usual the people here are great, very helpful.