I'm wiring a cooling fan into my robot, it's a 5v fan and will be blowing air across my voltage regulator's heatsink. The regulator is used to supply power to my servos, some LEDs, etc.
As far as my knowledge extends, a DC motor shouldn't be powered from the Arduino, without using a motor driving circuit, as a motor can feed back electrical power and damage the chip. I don't know if this is still the case, if it's just running from the Arduino power, or only if running from a pin?
However, if I power it from the same regulator it's going to be cooling, I'm assuming there is no need for a motor driver.
I recently needed a fan on a heatsink to cool a L298 motor driver. I wound up using a transistor, a resistor, a diode, and one of the arduino pins so that the arduino pin can turn the fan on and off, and also control its speed. It’s a very easy circuit to make. It will allow your regulator to supply the power to your fan, but the low amperage from the arduino can adjust its speed. Here’s a picture of the basic circuit:
This comes from PICAXE manual 3. (some critizes PICAXE. It did help a newby like me a lot...).
This manual says :"Note that it is usual to connect a back emf suppression diode across the output device. This is essential with devices such as relays, solenoids and motors which create a back emf when power is switched off. The diode type 1N4001 is the device recommended."
If your fan is driven by a motor driver such a L293 or similar there are built in diodes to suppress the back EMF when the motor is slowing down.
If your fan is driven directly from a power regulator such as L7805, then I think you have to use a diode for suppression.
If I understood well the process, when the power supply is shut-down, the fan decrease speed but it’s own inertia transforms the motor fan in a dynamo/generator. It creates current in the circuit, but of opposite polarity of the power supply.
The diode has to be as close as possible to the fan connector.
What is the power regulator you’re talking about ?