MOSFET Trouble

OK, first the terms NPN and PNP are used in reference to bipolar junction transistors (BJT) not terms used with MOSFET transistors, which are said to be either P-channel or N-channel mosfet transistors. The most commonly used type in applications like you wish to use is a N-channel as a 'low side' switch. The positive voltage source would wired to the load, electromagnet in your case, the other side of the magnet to the mosfet drain terminal and the source terminal back to the negative terminal of the voltage source. There also needs to be wire from the negative power terminal to a arduino ground pin. Then finally a wire from a arduino output pin through a low ohm series resistor to the gate terminal of the mosfet, 200-330 ohms should be fine.

Now what could be causing you your problems. The wiring of course has to be correct which I've tried to outline above. Second and just as important is the specific MOSFET you are trying to use. It's not what is called a 'logic' level mosfet, but rather a standard one that can't be fully turned on to it's lowest possible resistance (Ron value) unless you have at least +10vdc across it's gate/source terminals, and as a arduino can only go to a maximum of +5vdc, your mosfet can't fully turn on. So you really should get a proper mosfet for use with an arduino. You also need to know how much current the magnet draws at the voltage you are powering it with. If that data is not available to you, you should measure the current draw with a meter with the magnet simply wired across the power supply terminals. Once you know that value you are in a better position to select a properly rated 'logic' level N-channel power MOSFET for your project.

That help?

Edit: By the way the drawing in one of your linked photos is completely wrong and see if you can redraw it using the wiring directions I gave above. If you can't first draw it correctly, you aren't in a position to wire it correctly. :wink:

Lefty