-
A capacitor initially behaves like a short circuit when it is first connected to a voltage source. In this case, that means the MOSFET briefly connects +12 V directly to ground each time it turns on.
-
At a PWM frequency of 1000 Hz, the MOSFET is effectively shorting +12 V to ground 1000 times per second.
-
While capacitors can be used to suppress electrical noise from motors, in a circuit like yours the value should be reduced from 100 µF to 0.1 µF—a reduction by a factor of 1000.
-
If the fan generates any kickback voltage when the MOSFET turns off, adding a diode will eliminate it. A 1N400X series diode (for example, a 1N4007) is suitable. This diode must be connected with the banded end (cathode) to +12 V and the anode to the MOSFET drain.
-
When we help people with projects like this, we take a holistic approach and look for both hardware and software issues. While these circuit changes alone may not fully resolve your problem, they are essential and should be implemented regardless.
- So others can chime in, believe this represents what you are doing.
- Please confirm the following.
- Fans are powered by 9V or 12V ?
- How is the Arduino getting its 5V power ?
Edit:
- It's a bit late now but you might find this informative:

