Pulse Width Modulation (PWM) is very common technique for controlling cooling fan speed in Desktop PC. In this project PIC16F877A based Pulse Width Modulation controller was built and tested with 2 fans. 80 mm Coolink SWiF2-80P PWM Fan and Arctic Cooling F12 PWM 120 mm. These are 4 wire fans and their pinouts are shown in the diagram below.
A standard PWM Fan connector has 4 wires: +12V, Gnd, Control and Sense. Control input should be connected to 25 KHz PWM signal. By changing the Duty Cycle of control signal you can adjust the fan speed. Sense wire is used for monitoring the actual fan speed. Sense output will send 2 pulses per revolution. By counting the number of these pulses in a minute you can calculate fan RPM. PIC16F877A was used again as default MCU for current design, however the code can be modified to work with any similar PICs like PIC16F876A or PIC16F88 and support most of PWM 12V computer fans.More on the next page.