Fan and Digital Input

Generally, the arduino can't provide enough current from the digital i/o pins to power any motor but the very tiniest. You have to switch an external power supply instead with a transistor or relay. Here's a link to the playground page showing how to do it for a solenoid Arduino Playground - HomePage Same principle applies to motors. Unusually in your case, you'd be switching the power from the arduino's regulated supply. How much current does your motor draw?