Home About Controller Schematics Hardware Downloads

The fan controller I designed consists of the following major components:

  • PIC micro controller with A/D converters (16F877).
  • Firmware for the controller.
  • MOSFET power switching transistors for driving the fans.
  • Fan current sensing.
  • Temperature sensors.
  • Serial port.

Fan speed is controlled using PWM (Pulse Width Modulation). Basically the fan speed is controlled by pulsing the fan at a fixed frequency with a waveform of varying duty cycle. For example to set the fan speed to half, the duty cycle is set to 0.5 (or 50%). For a frequency of 50Hz, the waveform period would be 20ms. For a 50% duty cycle the fan will be on for 10ms and off for 10ms. This is a well known technique. However there are some potential issues with this method. For fans that have active electronics (typically for generating RPM outputs i.e. 3 wire fans) the electronics aren't powered during the off period. In my setup the case fans are standard 2 wire fans and the HSF is a 3 wire fan (has RPM output). I'm not using the 3rd wire of the HSF fan and therefore I don't need to worry about the above problem. I've had no issues driving the fans using this technique. Unfortunately I can't monitor the fan RPMs directly, but they can be determined from the duty cycle given the maximum rated RPM for the drive as the relationship between fan RPM and duty cycle is probably close to linear. 

The PIC firmware's main tasks are the following:

  • Control fan speed using PWM.
  • Sample temperature sensors using the A/D converter (built in).
  • Sample fan currents with the A/D.
  • Receive a command message on the serial port from the PC containing the duty cycles for each of the 3 fans.
  • Send a message on the serial port to the host PC with the temperature and current sensor values.
  • Boot loader. Firmware can be updated without reprogramming using the device programmer over the serial link.

I wrote a Windows application to communicate with the fan controller firmware. The application has the following features:

  • Manual fan speed selection for each of the 3 fans using a slider 0 - 100%.
  • Fan speed presets.
  • Editing of sensors configuration, scaling, units and naming.
  • Editing of fan names, RPMs and other information such as the estimated affect a fan has on a sensor (used by the auto controller)
  • Closed feedback proportional gain controller. In this mode the fan speeds are set according to the temperature sensors to ensure temperatures are less than a preset maximum value.
  • Monitoring of temperatures, currents and fan speeds.
  • Integration with Motherboard Monitor. Temperature sensors and estimated fan RPMs are displayed in MBM.

Follow the navigation links above for details of the project.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.