Electronic – Changing fan Speed of a 4pin PC case fan with a microcontroller

fanmicrocontroller

I'm very new to electronic projects, I know the BASICS of circuits (i.e Ohms law, capacitance)but I've never constructed something on my own.

For my project I want to take the side fan for my computer case, which is a 4-pin connection to the power supply, and which also powers an LED on the fan, and interface it with a micro-controller to change fan speed based on temperature and and also user input, so it has the fan speed increases from the user pressing a button or from automatic temperature readings and a strip of LED's to light up in a row, like a progress bar to show fan speed "intensity".

With my basic knowledge I've come up with some questions that I THINK would need to be answered to do this project. As far as I know, fan speeds can be manipulated by a changing voltage, so I'm ASSUMING that I need to build a circuit of resistors that can change this output voltage value based on switches that are turned on by the micro controller, is this correct? And I'm trying to find a way that I can interface the 4-pin connection with my micro-controller? Also what kind of battery or powersupply do I need to power this circuit? Do I need to know the wattage needed for the fan? Thanks to anyone who lends me advice, It's much appreciated.

Here is the board specifications if needed http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board

And a link to the fan being used. http://azzatek.com/PDF/CSAZ-1000-Solano-Users-manual.pdf (fan on the side)

Best Answer

First of all, you are over-thinking. Solution is simpler than you think.

CPU fans are BLDC fans with four pin connector - VCC, GND, Tachometer output and Input. Here is a diagram:

BLDC 4 pin connection

Connect VCC and GND normally. Use Tachometer output to sense current speed of the fan. In most cases it will give you two pulses per revolution. So you can count those pulses using your microcontroller and get the fan rpm.

For speed control, you need to give a PWM signal to the control pin. Here are some links that will help you learning more about it:

http://www.arduino.cc/en/Tutorial/PWM

http://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM

So here is the solution:

1 pin for tachometer (speed) sensing - You count the pulse to display rpm.

1 pin for PWM output - You use pwm to control fan speed and monitor with speed sense pin. If current speed is less than desired speed, you increase the duty cycle till both match.

1 pin for temperature sense - you define an equation or a table describing what speed at what temperature.

UART or something else for user input/output.

You can also use LCD displays for displaying the current rpm.

Edit (added some info provided by Michael Karas in the comments below)

You might want to run the PWM waveform at micro-seconds(i.e. megahertz frequency) speeds - not milliseconds(kilohertz) speeds. Optimum PWM frequency for small fan motors is greater than 25KHz. This eliminates audible frequency noise due to the PWM. It also puts the high speed on/off of the fan to much greater than the motor drive waveforms so that the PWM truly has a chance to average the voltage in the windings instead of interacting with the BLDC drive waveforms.

Related Topic