Arduino w/ MOSFET - ground pin current

Hey guys,

I'm testing 12V DC motors (they all work under 200 mA until now) with a MOSFET connected to the Arduino pin. If the motor current is higher than 200mA, how could I manage to protect Arduino and make the motor work correctly? Let's consider that the MOSFET source terminal is connected to the 12V source negative pole and the Arduino ground pin (that takes up to 200 mA). Can someone help??

Thanks!

The current does not go into the Arduino ground. It returns to the ground side of the battery.

Ok, thank you very much!

But the current to charge the gate does, best to add a 150 ohm resistor between
output pin and gate to limit the current spikes on switching and protect the pin.

The MOSFET must be logic-level if you are driving directly from 5V, note.

Yes, I'm using a resistor after the output pin and a Pull-down resistor too. This diagram is simplified. Anyway, I know the circuit works, but a dummy question... Why does the current flow just to the battery ground and not to the Arduino ground too?

Thanks

Current only flows in circuts. That's why its called a circuit. There are two circuits
in a MOSFET and they are isolated(*) except at the source (remember the gate oxide is
a superb insulator). Since the two circuits only connect at a single point their
currents are completely independent (specifically the gate and drain currents).

True the source carries the sum of those currents, but each circuit can only take back the
same current it gives(+).

(*) Strictly no, the are only isolated at DC - at high frequencies the capacitance
inside the device comes into play and things get more complex.

(+) Strictly this is actually nonsense, but any imbalance in current would charge the
whole circuit up due to the capacitance to ground, and it only takes a microamp for a
second to reach many kV, so in practice the currents balance perfectly - or put another
way this is not electrostatics so Kirchoffs current law applies.

Great, got it.

Thank you very much