# Problems with IRF520 Transistor

This is the schematic for the project. I'm using an IRF520 transistor (http://www.futurlec.com/Transistors/IRF520.shtml) which goes from left to right Gate->Drain->Source. So the problem is that when gate is connected to a pin on the arduino the transistor will always be open regardless of what that pins state is but if I pull it out the transistor closes. Any help would be appreciated. imgur.com/a/dYliz EDIT: Added Schematic link

• Can you use the built-in schematic editor to post a schematic? – ThreePhaseEel Dec 9 '16 at 2:29
• @threephaseeel no they cant. Not enough rep. – Passerby Dec 9 '16 at 2:41
• @Passerby removed original schematic link check the first link – Hal Dec 9 '16 at 2:42
• Hal your image shows a p-channel device and the datasheet you included is an n-channel device. If it is n channel, your ground is connected to the wrong side of the battery. It should go ground, battery minus, battery plus, motor, drain, and source back to ground. – owg60 Dec 9 '16 at 2:55
• @owg60 yea it is a n-chanel here is the fixed schematic: imgur.com/a/dYliz I moved the ground that is connected to the arduino to the negative of the battery like this imgur.com/a/jih8B and now when the gate is connected to the arduino 5v it is on but if it is connected to a pin on the arduino regardless of the state of the pin the transistor is closed – Hal Dec 9 '16 at 3:08

Based on the newest schematic, Your pull-down resistor is too strong for the Arduino's output to overcome. A 220Ω resistor pretty much guarantees issues. Try bumping it to 2.2kΩ or 22kΩ.

See the two answers in Calculating the pulldown resistance for a given MOSFET's gate for more info, one math heavy, the other one more plain terms.

• So I bumped it down to a 10k resistor and it still isn't working, the 5v pin on the arduino is able to open the transistor but none of the digital pins are doing anything when they are High – Hal Dec 9 '16 at 3:33

Well to all of you sitting on the edge of your seat awaiting an answer to this trivial problem I have it. The transistor was bad.

• You burnt out a perfectly good transistor by exceeding the Avalanche Energy ?? $E=200mJ (abs.max)= \frac {1}{2}LI^2$ – Sunnyskyguy EE75 Dec 9 '16 at 5:29
• No flyback diode? – winny Dec 9 '16 at 6:33