Thank you very much for this detailed answer. ![]()
wvmarle:
You need a logic level gate or it won't switch on. Look for the VGS(th) value, this should be about 2V. Yours is 3-5V, and it's fully open at about 10V.
I understand that my lack of voltage comes from the VGS(TH) value: the grid voltage is not high enough to have a full commutation, so I should look for a lower VGS(TH) value. I will buy a new transistor.
wvmarle:
In this circuit you also need a p-channel FET, and your part is an n-channel (use those for low side switching). The symbol in your schematic is also for an n-channel FET.Note that for your p-channel FET it will switch on when the output of the gate is LOW (0V, or -5V VGS). So you will need a NOR instead of OR gate.
I don't understand the reason why I should use a P-channel MOSFET + a NOR gate rather than a N-channel MOSFET + a OR gate ?
With a P-channel MOSFET + a NOR gate the low state leaving the NOR gate will allow the current to flow through the transistor.
With a N-channel MOSFET + an OR gate the high state leaving the OR gate will allow the current to flow through the transistor.
From my perspective, given the same inputs (on the logic gate), I should have the same behavior for both cases in terms of output from the transistor, no ?
Obviously I am wrong, but I would appreciate if you could explain to me the reason why using a P channel FET (+ corresponding NOR gate) is the only solution here ?
wvmarle:
This way you will connect the Arduino's pin to 5V while it is still powered off. That's a bad idea, and it will kill the pin. Adding a 10k resistor there will protect the clamping diode from burning.
Thank you very much, I will make sure to add a resistor to protect the Arduino's pin.
wvmarle:
The switch also needs a pull-down resistor (on the side of the OR gate), to make sure the OR gate gets a LOW level signal when the switch is open.
Actually there is already a pull down resistor, which I didn't draw on my simplified schematic, but thank you. ![]()
wvmarle:
While the switch is open and the Arduino is off, both inputs of the NOR are pulled low (pin 2 via R2 and R4, pin 3 via R5), and the output is high, switching off the MOSFET. R3 is to limit the current rushing in to charge the gate, protecting the NOR output (usually can not supply more than 10-20 mA, depending on the part).When the switch closes, the Arduino is still off, but R2 limits the current through the clamping diode to <0.5 mA which is safe, especially as it lasts only a very short time: until the Arduino is powered up. The pin 2 of the NOR is pulled high, the output goes low, and the MOSFET is switched on.
Now you can set the Arduino pin "Arduino_power_signal" to high to keep the power on, even when the switch goes off.
That's exactly the behavior I want to implement. As I said above, I just don't understand the importance of using a P-channel FET + NOR gate for it to work. I would like to understand the "whole story" before I can order the new parts.
Thank you very much for your help ![]()