Page 1 of 1

Electric Fan Control

Posted: Fri Jul 17, 2015 11:46 pm
by Laecaon
After deciding to switch to electric fans I started to look at fan controllers. There are a few ways to do this, but I dont like spending money, I dont like cheap products, and I do like lots of options.

You could go super simple, and use a basic fan switch that simply will turn on a fan at a certain coolant temp (Temp predetermined by the switch manufacturer).

Or you can go with a fan controller. These tend to allow adjustment to when the fan(s) come on. They get fancier with multiple fan (independent), and even variable speed controls. The problem, the cheap ones are well cheaply made and tend to have bad reviews. The good ones cost more than the fans themselves.

Then there is the DIY option, which is my favorite, because I get to be cheap and have all the options, and well its more fun.

The idea is to use an Arduino (https://www.arduino.cc/); have it read two different temperature sensors; and based off those temperature readings turn on and vary the speed of the fans (two in this case).

Hardware is all pretty basic:
Arduino Board, Currently using a Uno R3.
Some resistors (10K ohm)
Diodes, in case of any backwards spin of the fans (dont want any reverse current)
aMOSFET, this is like a relay that can be turned on and off way faster and barely require any current to do so.
Fans (of your choice)
Temperature Sensors.


I dont currently have a temperature sensor, and I havent hooked up a full size automotive fan, but I do have trial done with a potentiometer and a computer fan.

The code the Arduino runs on:

Code: Select all

    int tempPin = A1;   // Temp Sensor
    int fan = 10;       // The output pin for the Fan
    int led = 13;        // led pin
    int temp;
    int tempMin = 900;   // the temperature to start the fan
    int tempMax = 60;   // the maximum temperature when fan is at 100%
    int fanSpeed;
     
    void setup() {
      pinMode(fan, OUTPUT);
      pinMode(led, OUTPUT);
      pinMode(tempPin, INPUT);  
    }
     
    void loop() {  
       temp = readTemp();     // get the temperature
       if(temp > tempMin) {   // if temp is lower than minimum temp
           fanSpeed = 0;      // fan is not spinning
           digitalWrite(fan, LOW);       
       } 
       if((temp <= tempMin) && (temp >= tempMax)) {  // if temperature is higher than minimum temp
           fanSpeed = map(temp, tempMin, tempMax, 32, 255); // the actual speed of fan
           analogWrite(fan, fanSpeed);  // spin the fan at the fanSpeed speed
       } 
       
       if(temp < tempMax) {        // if temp is higher than tempMax
         digitalWrite(led, HIGH);  // turn on led 
       } else {                    // else turn of led
         digitalWrite(led, LOW); 
       }
          
    }
     
    int readTemp() {  // get the temperature
      temp = analogRead(tempPin);
      return temp;
    }
The code needs tweaking for proper fan speeds, proper reading of a temperature sensor and well 2 fans... But it works.


Ill update about the circuit later.

Image

Re: Electric Fan Control

Posted: Sat Jul 18, 2015 12:05 am
by Laecaon
Quick video of it working.

Notice at the end an orange light shows up on the board on the left of the video. If you can read the code above, you will notice that it comes on when the temperature is too high, as a warning.


Re: Electric Fan Control

Posted: Sat Jul 18, 2015 1:15 pm
by Laecaon
Managed to get a temperature sensor working with the system. Its just hard to like, well change the temperature. An Ice cub and a lighter work, but that is messy and dangerous... around computers and electronics...

My goal with this mini project is to make it fairly easy for anyone to replicate, and maybe even sell a couple of quick "kits" (what happens when I order PCBs, they come in sets of 3)

Re: Electric Fan Control

Posted: Tue Aug 04, 2015 7:43 pm
by izzo
Now this is pretty damn neat

You ever check out mp3car?

Re: Electric Fan Control

Posted: Tue Aug 04, 2015 9:25 pm
by Laecaon
yea... some useful stuff. A messy looking website.