Currently I don't have the relay. I only drive the green led with the mosfet
The 12V is an external power supply (230v AC to 12v CC). I connect the GND of this power supply with the same GND of the rest, including Arduino GND (I use this same 12v to power the arduino)
My 1st problem is, I still have the led on, I can see just a bit light whereas the mosfet is OFF.
Why do you use a power MOSFET for 11A to drive a relay of perhaps 11mA? From the datasheet:
Zero Gate Voltage Drain Current I DSS V DS = 55V, V GS = 0V - - 1 μA
V DS = 50V, V GS = 0V, T C = 150 oC - - 250 μA
I.e. even in OFF state more than 1µA can flow and let a green (high efficiency) LED glow.
Add the relay and try again.
Use a low power (cheaper) MOSFET or BJT.
I have 3 of this mosfet to drive 3 different relays. Most of them need at least 1.3A to be closed.
I choose this mosfet to be sure I can use 5V to drive them and be safe with 1.3A.
So you mean that this 1uA can put the led ON even with this 1K resistor ?! Even if the AU_Bouton is not connected (I connect this net to a bouton in order to unplug the GND) ?
So with another mosfet I can avoid this 1uA ? Which one I should use for example ?
Find out where the current actually flows. It may be rectified RF or mains current induced into the diode-LED-resistor loop. It may disappear or increase with the relay coil attached.