Need help understanding the fan example in the Getting Started book...

Hi,

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.

Thanks! I think I got it now. The diode in the example works as a 'Snubber diode'. I believe this is a schematic of the setup (attached).

Make sure you get it the right way round, ie the wrong way :wink: with the diode cathode to the positive supply.

Hehe - yes, it is already in place, correctly backwards :slight_smile:

hang_on:
Hehe - yes, it is already in place, correctly backwards :slight_smile:

Or backwardly correct.

Friday Philosophy: if the cathode is connected to the +ve power, isn't it then the anode by definition?

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.