yashastronomy
Published © GPL3+

Arduino based RPM counter with a new and faster algorithm

This project makes use of the preciseness of a laser beam, just one IR sensor and that good old arduino board to measure the RPM of motors.

BeginnerFull instructions provided36,038
Arduino based RPM counter with a new and faster algorithm

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
IR proximity sensor
Use the sensor recommended in this project otherwise the results may vary
×1
Jumper wires (generic)
Jumper wires (generic)
×3
Laser Diode, 655 nm
Laser Diode, 655 nm
You can use a readymade laser pointer and not necessarily the above mentioned one.
×1
DC motor (generic)
this is for testing.
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Battery, 9 V
Battery, 9 V
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Solder Wire, Lead Free
Solder Wire, Lead Free
Soldering iron (generic)
Soldering iron (generic)
only for soldering wires to motor leads.you can use any other means also.

Story

Read more

Schematics

Setup image.

this is the image for the base and other components placement

Circuit Schematics

schematic for connecting sensor to the arduino board

Code

RPM_counter_101

Arduino
This is the code for the RPM counter.
//code by YaSh.

int sen = A0;
const float wid = 0.012;   //adjust the width of the fan blade according to your needs.
const float rad = 0.045;   //adjust the radius of the point of detection in the fan blade.
const float konst = 6.2832;  //  2*pi.
float time_1;
float time_2;
float vel;
float diff;
float tnet;
float rpm;
void setup() 
{
  Serial.begin(9600);
  pinMode(sen,INPUT);
  Serial.print(" \n please start the motor at least 3 seconds prior.\n");
  delay(3000);
}
void loop()
{
  if(analogRead(sen)<950)
  {
    time_1 = millis();
    delay(30);
  }
  if(analogRead(sen)>950)
  {
    time_2 = millis();
    diff = (time_2-time_1);         
    vel = wid/diff;                      //rotation velocity
    tnet = (konst*rad)/vel;              //time = (2*pi*radius)/velocity.
    rpm = (60000)/tnet;                // time in ms to minutes and then to rpm conversion step.
  }
Serial.print("\n The rpm is : "); 
Serial.println( rpm );
}

Credits

yashastronomy

yashastronomy

0 projects • 16 followers

Comments