This is the schematic for the project. I'm using an IRF520 transistor ( 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. 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
  • 1
    @owg60 yea it is a n-chanel here is the fixed schematic: I moved the ground that is connected to the arduino to the negative of the battery like this 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
up vote 1 down vote accepted

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\$ – Tony EE rocketscientist Dec 9 '16 at 5:29
  • 1
    No flyback diode? – winny Dec 9 '16 at 6:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.