# Control of a coreless DC motor using a PWM and a mosfet

I'm using 4 Si2302 logic level mosfets to drive 4 coreless dc motors. The speed of the motors is control led by the PWM signal from an Arduino Pro Mini. The power supply for the boards is a 3.7V (4.2V when fully-charged) 500mAh 50C Lipo.

The circuit is setup in the following way:

• Source to ground
• Gate to PWM pin with a 10KΩ resistor to ground.
• Drain to motor terminal 1
• Motor terminal 2 to Vcc
• Diode placed across the motor terminals

simulate this circuit – Schematic created using CircuitLab

The motor gets its RPM value via a joystick which is connected to an Analog Input on the Arduiuno. This is then converted to a 0-255 value and outputted at the PWM output.

I'm facing the following problems with the circuit:

1. As soon as I supply power to the circuit the Motors run at full RPM till the Arduino starts taking data from the joystick. It then settles down to the RPM corresponding to the joystick position. Is there any way to counter this so that the motors remain switched off until the Arduino starts receiving values from the joystick ? (My understanding was that the 10KΩ Rgs resistor would take care of this.)

2. The second problem is that the mosfet never fully switches off. This happens even when the joystick is at the 0 position. I have also tried switching the pins HIGH and LOW, however there is still movement in the motor. Is there any remedy to this problem?

3. When I measure the resistance between Gate and Source, the mosfet shows around 6K ohms. Shouldn't this be around 10KΩ since the Rgs resistor is 10KΩ ? Is this a sign that the mosfet is damaged ?

Reduce the 10K resistor to 3.3K or even 1K.

The Si2302 device that you are using has threshold voltage around 0.65V, this is much lower than many MOSFETS which more typically have a a threshold of 2v - 4.5V.

All effects you are seeing are probably because of the pullup resistor in the Arduino (assuming it uses an AVR processor). This can be anywhere between 20K and 100K and will be putting enough current out of the processor to create a bias voltage that turns on the MOSFET slightly.

When you measured the gate resistance, was it still connected to the Arduino?

The pull-up can be disabled programmatically, but of course not until the software is running.

kevin

• I removed the 10K resistor and soldered a 3.3K resistor but the motor is still on even when the PWM is 0. I even connected the gate directly to ground (to simulate the Arduino pin going LOW) and there is still a 0.5V voltage drop across the motor terminals. I tried this with one of the functioning Fets and successfully switched the motor off. Only 1 out of the 4 mosfets is showing this odd behaviour. I'm pretty convinced now that this mosfet is faulty and will swap it out and test the circuit again. Thanks for your reply. Jun 22, 2015 at 5:30
• Pullups are not active at boot; only once enabled by software. Sep 1, 2018 at 16:32

On the Arduino Pro Mini all digital pins (except pin 13, indicator LED) are floating until programmed otherwise, so unless you are deliberately activating the internal pull-up your pull-down resistor should prevent the FET from being turned on at start up.

When I measure the resistance between Gate and Source, the mosfet shows around 6K ohms.

A reading of only 6k is suspicious. However to eliminate the effect of other components you should take the FET out of the circuit, then measure the Gate-Drain and Gate-Source resistances with a digital multimeter. Finally, short the Gate to the Source and measure from Drain (+ve meter lead) to Source (-ve meter lead). All readings should be well over a Megohm. If the Gate-Drain or Source-Drain junction is broken down the FET may stay partially on even with 0 PWM.

• That 6K reading felt weird to me too. My first guess was the mosfet was faulty but the other 3 mosfets functioned properly. I'm going to swap this mosfet with a new one now. Is there any solution for keeping the motors off at startup ? Shouldn't the 10K pull down resistor keep them OFF until the Arduino starts giving PWM values ? Thanks for your reply. Jun 22, 2015 at 5:35
• 10k should be enough. Monitor the pins on start-up to make sure that they are not being driven high (if they are then there may a problem in your setup code). Jun 22, 2015 at 8:55

Your first problem occurs after you power your system, without any move of joystick, right? Maybe silly, but have you tried to do following :) :

int motorSpeed1 = 0;
int motorSpeed2 = 0;
int motorSpeed3 = 0;
int motorSpeed4 = 0;


Good luck, Regards,