Let's Make Robots!

The mother of all fancontrollers... Hopefully

So, I'm the process of making the -in my opinion- ultimate PC fan/pump controller for use with a water cooling system.

The idea is to make a bracket which fits into a 5.25" bay and holds an LCD, some type of input (probably joystick) and an arduino, so the temperature responses are completely programmable. It should have three fan/pump channels and 3-6 (however many ADCs I have left, at least 3) temperature sensors.

At the moment I'm trying to figure out how to get an rpm reading from a fan. I quickly found this, which uses interrupts. The problem is that an arduino nano only has 2 interrupt pins, which means I would only be able to read two instead of three channels. I'm unable to figure out how to do this without the use of interrupts.

Can anyone help me on this? Is it at all possible? Am I being silly? How kick-ass do you think this idea is? Let me know! ;)

 

--EDIT--

Right after I created this, I realized that there is a pulseIn command which does the trick! For anyone interested: you can find the code below!

unsigned long time;
unsigned int rpm;

void setup()
{
  Serial.begin(9600);
  digitalWrite(2, HIGH);
}

void loop()
{
  time=pulseIn(2,HIGH);
  rpm=(1000000*60)/(time*4);
  Serial.println(rpm,DEC);
  delay(700);
}

It should be noted that if the rpms drop below ~200, this won't work anymore...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Using "Mickey Mouse" logic you can have as many inputs as required driving a single external interrupt. By then having the CPU check each input, the correct action to take should be easy to calculate.

You can use the pin change interrupt and a counter based on a timer - read the ATmega's datasheet. Or you can read some input pins in an interrupt based on a timer with a frequency like 10KHz.

I had the ideea more then a year a go for my HTPC but for practical considerations I opted for a custom PCB with a PIC18F2550 microcontroller. Since I do not have enough time (and PIC programmer) I stopped just a little over writing the specs. Here are some, maybe these are usefull to you:

  • 3 PWM fans, synchronized based on their turation (to reduce the risk of ugly sounds)
  • 3 1-wire temperature sensors
  • LCD 2x16
  • IR sensor for remote control (PC on/off, work mode switch)
  • mode switch button and PC on/off button
  • USB for settings from PC
  • smart autotuning algorithms for various working modes (silent, performance, ...)

overkill, I know...