DC Fan Help

MadMatt:
You might need a capacitor to smooth out the output signal of the transistor, going to the motor. Just put a capacitor from the between the motor contacts, make sure you wire it correctly (polarized). It should get rid of any noise, unless the noise is not from the PWM but from a defect in the motor itself.

470uf should be more than enough.

thanks soo much that really worked :smiley: sorry about everyones else suggestions didnt really help :confused:

That solution has two problems: (a) you are probably exceeding the current rating of the transistor, because there will be a surge of current to charge the capacitor every time the transistor turns on; (b) you will probably find that you have only a small amount of control over the fan speed, it will mostly run near full speed.

If you want to control a PC-type fan, the best solution is to buy a 4-pin fan designed for PWM control. These have a separate PWM input. They are designed to work using a PWM frequency around 25KHz, so you need to increase the Arduino PWM frequency.