1
\$\begingroup\$

Well, I have this circuit design that drives a motor (draws abt 3A) via N channel mosfet. It works fine on a breadboard. I decided to go with pcb and ordered some from oshpark. Suprisingly once the push button is clicked the mosfet turns on as expected but after letting go it never turns back off. First I thought there was something wrong with the button or the mosfet and replaced both of them but didnt do any good.

Does anyone know whats wrong with my circuit? I'm new to this pcb design thing and would love to hear your feedbacks.

MCU-> Attiny85

Mosfet --> PSMN1R0-30YLD

Power source --> 3.7 lipo 15A C rating battery

enter image description here

Thanks a lot!

\$\endgroup\$
7
  • 1
    \$\begingroup\$ First of all you need a schottky diode in reverse parallel to motor's terminals. Second it is not good to drive a gate of a power mosfet directly from IO pin of MCU. Third - you have LED - does it turn off when you turn off the motor? \$\endgroup\$ May 29, 2017 at 20:57
  • 1
    \$\begingroup\$ Measure the voltage at the gate when its supposed to be off. If the gate is low and the FET is conducting, probably the absence of the diode fried the FET. \$\endgroup\$
    – Wesley Lee
    May 29, 2017 at 20:59
  • 1
    \$\begingroup\$ A FET with fried oxide will typically only be "partially" on and is likely to get rather hot when passing a few amps. \$\endgroup\$ May 29, 2017 at 23:35
  • \$\begingroup\$ @TodorSimeonov - actually the scheme depicted, with direct drive from an MCU and a pulldown resistor, is quite ordinary and accepted for small motors and logic-level FETs. Many FETs have enough of a diode in their internal structure not to need an external one for such usage. \$\endgroup\$ May 29, 2017 at 23:45
  • \$\begingroup\$ @TodorSimeonov - when the motor is not connected led and the push button works fine, when the motor is attached to the circuit (drawing current) the mosfet and the led stays on even the push button is off \$\endgroup\$
    – ManinBlue
    May 29, 2017 at 23:54

1 Answer 1

1
\$\begingroup\$

As I wrote my question about the LED I was thinking that your MCU may be restarting, because of induced current through pin. Now when you say the LED stays on, I am pretty sure about that.

A electric motor has large inductance. When the current flowing through it stops and one of its pins is disconnected the magnetic flux does whatever it can so this current to continue to flow. The result of this effect is a voltage kickback - the negative terminal of the motor jumps to a voltage higher than its positive terminal searching for a path from where the current will continue to flow. This kickback, if not limited with capacitors, is very fast - it has very high dV/dt. This dV/dt is related to inductance multiplied by turned off current. The higher one of these, the higher will be dV/dt.

In your circuit the only path this current can use is the capacitance of your MOSFET. There are two paths where this current can go - one is Drain to Source capacitane - Coss (output capacitance) and the other is Drain to Gate capacitance - Crss (reverse transfer capacitance). The second is dangerous, because with a fast rising drain on turn off the current flows to transistor's gate and tries to turn it back on. That's why good MOSFET drivers have strong pull-down circuit to ensure transistor stays off with high dV/dt on its drain.

In your schematic you don't even have a series resistor from MCU's pin to transistor's gate. I thnik the reverse current Crss*dV/dt flows into your MCU's pin and discharges thorough MCU's ESD diode and this way disturbing Vcc causes the MCU to restart.

My recomendations are:

  1. Put a large electrolyte capacitor (at least 220uF-470uF) near the motor's terminal from Vcc to GND and in parallel ceramic SMD as much higher you can find.

  2. Put a flyback diode with its anode connected to transistor's drain (motor's negative) and cathode to Vcc (motor's positive). Never forget the flyback diode when switching inductive loads like motors, relays, incadescent bulbs, heaters, loads with long wiring, etc! Never! This diode should be fast. In your case a SS34 schottky in SMA package would fit and can be soldered on terminal's pins.

  3. Cut the trace between MCU's pin and transistor's gate and put a series resitor of 330-470 ohm. You are not making PWM, just turn on and turn off so speed will not be a problem.

  4. Add a Gate to Source resistor like 1k-2k to hold the MOSFET off while MCU is in restart and pins are tri-stated.

  5. You can also put a capacitor of 10nF-47nF on motor's terminals to provide a path for dV/dt current while voltage raises from 0 to Vcc.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for taking the time to explain everything in details! Tried to put a diode and it worked like a charm. But I'm not gonna stop there, I'm gonna design another board and this time it will have all the suggested components. God bless you sir! \$\endgroup\$
    – ManinBlue
    May 30, 2017 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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