In the "Getting started with Arduino" book, there is an example circuit that shows how to control a fan with an Arduino through a MOSFET. I have built this little circuit.
Is it correct that you put the diode in the circuit in order to prevent the voltage spikes, generated by the fan's motor, to be applied to the drain of the MOSFET, and then also be applied to the ground pin of the Arduino? You use the diode to protect the ground pin, and thus the Arduino?
You don't need to protect the Vin pin from voltage spikes, right?
The diode goes across the load, the fan, so that when the MOSFET switches off the current
still has a path to flow (it cannot be instantly reduced to zero). It protects the
circuit from 100's or 1000's of volts that could otherwise occur it you provided no easy path.
For semiconductor diodes the cathode is the n-type end, anode the p-type end, by
convention.
For electrochemisty the answers depends on whether its a battery cell or an electrolysis
cell. The names derive from the greek for building up and breaking down, refering to
the plating or dissolving of the electrodes, which depends on the direction of current
flow, not voltage.
Having a definition that depends on the direction of current flow is confusing and not
useful in my opinion.