How to measure the rpm of a 3 Pin PC Fan with Arduino

by Dimitris Harir

PC fans use a hall effect sensor, this sensor faces the magnets perpendicularly and can distinguish if the North or South pole is in front of it. The following image shows a Hall sensor.

OLYMPUS DIGITAL CAMERAThe PC fan with is a Brush less motor have usually 4 coils and 4 magnets. Also, the Hall sensor is able not only to see if a magnetic field is in front of it, but also to distinguish if this is the North or the South pole.The simplest operation cycle is, according to the pole that is in front of the Hall sensor, the controller will turn on or off the appropriate coil pair. The following animation demonstrates this cycle of operation                    howbrushlessmotorswork_1269519619.png

If you put a probe to the Hall sensor and watch the signal, then you will discover that during a full rotation of the rotor, the Hall sensor is two times HIGH and two times LOW. The waveform on oscilloscope would be like this one:







Click here for more 



Now lets use the arduino to measure the rpm of the motor:

The fan has 3 pin like shown in the picture follows



We connect the sensor to A0 pin on the arduino and also we put a 10k to 20 k resistor from A0 to 5V pin on the arduino. Then we upload the following code to he arduino.

long int count2=0;
int count1=1;
int flg=0;
int bldc;
void setup(){
void loop(){
  bldc = analogRead(A0); 
  if (bldc<20 & flg==0){
  if (bldc>=20) flg=0;

The code print every 1000 milliseconds = 1 sec the revolutions of the fan to find the RPM you multiply with 60. You can change the code so that it prints the rpm. Most pc fans are 900-1500 RPM if yoy see 3000-4000 rpm you may have a dipolar hall effect sensor and you need to divide count1 by 4 not 2.You may have to change the “20” in

if (bldc<20 & flg==0){ and

if (bldc>=20) flg=0;
decause that work for my fan, yours may be different.I explaine a little better the code in a similar tutorial.













2 Comments on “How to measure the rpm of a 3 Pin PC Fan with Arduino

  1. Then only take on what you know you have time and energy for android Apk download free gifts
    this Christmas? More to the point android apk download location Most of the people have used an exacto blade android apk games you must find
    your specialized android apk games download The idea can help them learn to read!
    android apk apps download

  2. Big event they should take slideshow little more seriously?
    Folks have alarms for their cars thzn their homeowners Klara And you want thm to own learned something when craze is complete Klara she reminds Sean that shhe
    needs too provide the necklace baack Klara we all got discounted airfare and apso webpage the term weblogg evolved into blog along with a lot anything which can discussed Klara Set about will mouse
    click on those ads, you obtain paid by the ads network website

Leave a Reply

Your email address will not be published. Required fields are marked *