how do I measure rpm's of a computer fan.

I want to use the signal wire on a three wire computer fan to measure the fan's speed. So far, what I do know is that the fan utilizes a hall effect sensor which sends pulses (2?) for every revolution. Measuring the pulses through a diode, the adc returns values between 15-40. 40/1023 * 5 = roughly .2 volts max. 1) What would be the best way to determine the rpm's (count the pulses)? Could I set a threshold voltage and count every instance the voltage rises above it? 2) Purely out of curiosity, how do I use the internal 1.1v analogReference? like this possibly:" analogReference(INTERNAL); "?
Thanks.

Count the pulses using a digital pin, preferrably using an interrupt. Then the math is simple, accumulate each pulse, and when a minute has passed (could also be an interrupt) divide the accumulated pulses by 2 and you have the rpm...

If your hall effect doesn't provide a logic level signal you would need an amplifier (op amp) and you could then use the AVR's comparator. Personally I would replace the hall effect sensor with one that does provide digital logic output...

Computer fan tacho outputs are normally open collector or open drain, so they need a pullup resistor. Easiest solution is to connect it to an Arduino digital input pin configured with the internal pullup enabled. To find the rpm, you can either count how many pulses you receive in a certain time interval, or time the interval between pulses and work out the rpm from that.

Ok, I tried one of the IDE examples: "DigitalInputPullup" with the fan's sensor wire connected to digital pin #2 and all I get in the serial monitor are a steady stream of zeroes. Assuming I have done everything correctly, I'm guessing the sensor output (~ 0.2 volts) isn't enough to register on the digital pin? and yes, I just checked: I need at least 3 volts. So I need an op amp?

void setup(){
  Serial.begin(9600);
  pinMode(2, INPUT_PULLUP);
  pinMode(13, OUTPUT); 
  pinMode(6, OUTPUT);  // fan
  digitalWrite(6, HIGH);// turn the fan on
}

void loop(){
  
  int sensorVal = digitalRead(2);
  Serial.println(sensorVal);
  if (sensorVal == HIGH) { 
    digitalWrite(13, LOW);
  } 
  else {
    digitalWrite(13, HIGH);
  }
}

http://arduino.cc/playground/Main/ReadingRPM