In my project work I'm controlling 12v DC solenoid valve with Arduino but the 5v control output can not switch the valve, so I like to interface it MOSFET how could I achieve that?
choose an n-channel MOSFET which reaches a low channel resistance at VGS the solenoid generates a high induction voltage => VDS of the MOSFET exceeds the upper limit => the MOSFET gets damaged.
I/O pin = low => solenoid off, I/O pin high => solenoid on.
My colleague Joerg proposed one solution which is the simplest one.
All what do you need is to select a suitable NMOS transistor that can withstand the on the current of the solenoid and turns on with an input voltage with 5V. The solenoid is to be connected to VDD=10V and the drain of the switching transistor.
The other solution is to use a bipolar transistor instead of nMOST. You need only to add a sufficient current limiting resistance for the base current to protect the base to the base to emitter voltage and pass the required current to on the Solenoid and on the transistor to saturation mode of operation.
The last solution is to use a CMOS driver and you supply it with 8 V by dropping about 2 volt from the 10V by cascading 3 diodes in forward biasing. In this way you can apply the 5 V as an input high and get 8 V which is able to drive an nMOS transistor with larger current.
You can use a N-Channel MOSFET(IRF540) to control your 12v solenoid valve.
I attached the circuit diagram. In this circuit, when you press the button 1, Arduino send a HIGH logic to gate terminal of the MOSFET IRF540, connected on the 9th pin of the Arduino. As IRF540 is an N-Channel MOSFET, so when its gate terminal gets HIGH, it allow the flow of current from drain to source and turn the solenoid on.
Similarly, when you press the button 2, Arduino sends a LOW logic to the gate terminal of the MOSFET IRF540 which makes the solenoid turn off.
For best performance, i suggested you to control the solenoid valve using 5v relay.