# Math for Controlling a 12V Motor

Hey !
This is the first time that I'll be controlling a motor using Arduino. So bear with me.
I'm aware of the fact that Arduino supplies 5V while the DC motor I am using needs 12V. While I know that I need a transistor to control it, I don't have any grasp over the math required to figure out the best transistor needed for it.
Can anyone please deduce the math required for using a transistor to control the motor, along with the resistor value required for it ?
I'll be obliged.

Step 1) What is stall current of motor
Step 2) Browse N-channel MOSFET data sheets and find device that can handle stall current AND is capable of operating at logic level input
Step 3) Obtain 470ohm resistor and 10k resistor
Step 4) 470 connects Arduino output to gate 10k connects gate to source
Step 5) Browse diode data sheets and find diode that can handle full load current of motor
Step 6) Connect diode in reverse bias across motor terminals

No maths required

Step 2 is not how I’d do it.

Step 2: Figure out the maximum on-resistance your MOSFET can be to support your max current
and not fry, nor leave the linear region

That means R <= max_heat_dissipation / (I x I)
and R <= 0.5 / I (assuming a logic level FET - you don’t want the drain rising too high in voltage w.r.t. source)

Maths definitely required.

The max current rating of MOSFETs is not a useful guide, because it assumes infinite heatsinking
(which you can’t provide and don’t want - ideally you want no heatsink), and it assumes you
don’t care if you leave the linear region.

For instance if you want max dissipation of 0.5W and your load current is 10A, you’d go for on-resistance
<= 5 milliohm.

At 10A that’s 50mV between source and drain which is fine (more than 0.5V and you might have to
start worrying about lack of a clear 4.5V Vgd to hold the device firmly in the linear region.)