Arduino Forum

Using Arduino => Motors, Mechanics, Power and CNC => Topic started by: nishant_91 on Jan 11, 2013, 04:23 pm

Title: Strange Problem while controlling motors with MOSFET
Post by: nishant_91 on Jan 11, 2013, 04:23 pm
So, I was trying to drive a motor using PWM based on the circuit in the Getting started with Arduino book (Image attached). However my circuit (the second image) does not behave as expected.

As soon as the power is turned on, the motor is on irrespective of the Arduino. In fact it works even if I disconnect the the arduino from the gate pin! I have replaced the mosfet, diode, resistor etc, in case there was a hardware problem but there is still no difference. Please hep me to find the mistake!
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: nishant_91 on Jan 11, 2013, 04:26 pm
The thin red and blue wires are going to the brushed DC motor (Not able to fit in the picture, sorry!)
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: larryd on Jan 11, 2013, 09:36 pm
Your 100R resistor is shorted out, review how to use a protoboard.
I don't see a ground going to the Arduino.
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: nishant_91 on Jan 11, 2013, 10:51 pm
Thanks for pointing that out, silly of me,
But shouldn't it work even though the resistor is shorted? Since the motor should only be on wen there is a high voltage applied to the gate?
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: larryd on Jan 12, 2013, 12:51 am
Please confirm you have a ground connection going to the Arduino.
Would you also confirm what number is written on the FET.
Also, we like to see a Gate to Ground resistor  (10K should be good here).
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: nishant_91 on Jan 12, 2013, 06:50 am
I do not have a ground connection to the Arduino, is it necessary? I am new to electronics, could you tell me why?
The MOSFET is IRF520, I know it wont be fully activated by the Arduino since it is not a logic level MOSFET but it is enough for my purposes since me motor draws only 70mA
Lastly thanks for the help!
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: retrolefty on Jan 12, 2013, 06:54 am

I do not have a ground connection to the Arduino, is it necessary? I am new to electronics, could you tell me why?

Yes it is necessary, because the gate voltage for the mosfet is coming from the arduino and it won't be a circuit without a ground return for the gate drive signal back to the arduino. You can't light a lamp by just having one wire from the battery positive to the lamp without also having a wire from the other side of the lamp back to battery ground. The mosfet source terminal is the return path back to whatever is driving the gate terminal.

The MOSFET is IRF520, I know it wont be fully activated by the Arduino since it is not a logic level MOSFET but it is enough for my purposes since me motor draws only 70mA
Lastly thanks for the help!
Title: Re: Strange Problem while controlling motors with MOSFET
Post by: nishant_91 on Jan 12, 2013, 11:42 am
Thanks for the explanation! I was not sure of the working principle of the MOSFET, I shall try it out with a ground!