Ohhh. I got it. Where is this info in the datasheet? Or I just assume it's a bit higher than the threshold?
For the IRF640, here are typical transfer characteristics from the data sheet, drain current as a function of drain source voltage, for various values of gate voltage Vgs.

Logic Levels are a guess as there is no one standard. It is based on the voltage of the logic devices driving them. Many are 5V, 3V3, and some even up to about 18V. 5V and 3V3 are what is generally used in this forum and many other data sheets. With that in mind that voltage is all the processor can put out, (usually the processor Vcc), it is the designer's responsibility to determine if it is enough to switch the load. When using transistors etc you also have to factor in current.
MOSFETS are always referenced from the source pin. Vgs is the Voltage from the gate to the source. If it says 3V you need at least 3V positive to turn it on, if it says 5V you will need at least 5V. The MOSFET does not act like a pure switch, when its threshold is met it starts to turn on, the higher the Vgs the more it will turn on. These values change with temperature. There is a point where it is fully turned on, this is also shown on the Vgs chart. There is another voltage usually +- (15V) which is the maximum voltage the gate will withstand without being damaged. The Vgs chart shows how much it is 'turned on' and may be expressed as resistance. The Vgs resistance can be used with Ohm's law to calculate how much heat it will produce.
Now to turn the tables upside down. The P-Channel is referenced from the same pin, the source but gate voltages are shown as negative numbers. They need a negative voltage to turn on, referencing there source not your power supply. If you remember N-Channel for negative and P-Channel for positive you will be in it correctly from the start. The source gets connected to the power source and is always the reference.
Also important is the gate impedance is in the high megohm range and requires no current. It makes a great antenna and generally should be connected to the source with a reasonable value resistor. This resistor should be on the port pin of the processor, if not and a gate resistor is used as it should it then becomes a voltage divider for the gate.
There is a lot more but this should get you started in understanding them.
So, the solution is simple as that? Thanks very much.
One question tho, doesn't the gnd of the arduino needs to be connected with the circuit?
I have one more nano, it will not get burned with this circuit?
Oh thanks. It makes much more sense now.
Yes my mistake, corrected.
Antenna as it easily gets a signal and works with almost no current?
The IRF640 is a n-channel mosfet and it works from the voltage of my arduino. I don't get why it would need to be negative voltage. Or I just don't understand yet what is negative voltage.
Is it just that it needs to be connected with the 24v source via a voltage divider(making it close to 5V(considering I change to a 5v logic level mosfet))?
Apart from it I think I understood a lot with your reply. Thank you very much.
Don't let @gilshultz ramblings confuse you.
It WILL NOT conduct the full 5A you think the motor requires, and certainly not the start/stall current, which is probably much higher. And the IRF640 will overheat.
Don't waste any more time with the IRF640.
I just don't understand why it needs to be negative voltage as it "works" with the irf640. And I will get a logic level mosfet. But would it need to be negative voltage to fully open up?
Or is it just the way it shows up in the multimeter if I test it this way?
NO. Forget negative voltages for the moment. And forget about P-channel MOSFETs.
Don't let all this extraneous, unneeded information confuse you! Use the circuit shown in posts #5 and #18 (they are the same), with a logic level MOSFET.
Aaah. Now I get why it didn't work the other way lol. Thank you sir.
Haha I did get a bit confused. Thanks for the help!!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

