hIOTron
Created November 26, 2019 © GPL3+

Digital Tachometer with Arduino for measuring RPM

The tachometer is a device utilized for measuring the number of revolutions of an object in a specific interval of time.

Digital Tachometer with Arduino for measuring RPM

Things used in this project

Story

Read more

Code

Run a Code

Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#define sensor 9
#define start 12
int delay1()
{
//unsigned int long k;
int i,j;
unsigned int count=0;
for(i=0;i<1000;i++)
{
for(j=0;j<1000;j++)
{
if(digitalRead(sensor))
{
count++;
while(digitalRead(sensor));
}
}
}
return count;
}
void setup()
{
pinMode(sensor, INPUT);
pinMode(start, INPUT);
pinMode(2, OUTPUT);
lcd.begin(16, 2);
lcd.print(" Tachometer");
delay(2000);
digitalWrite(start, HIGH);
}
void loop()
{
unsigned int time=0,RPM=0;
lcd.clear();
lcd.print(" Please Press ");
lcd.setCursor(0,1);
lcd.print("Button to Start ");
while(digitalRead(start));
lcd.clear();
lcd.print("Reading RPM.....");
time=delay1();
lcd.clear();
lcd.print("Please Wait.....");
RPM=(time*12)/3;
delay(2000);
lcd.clear();
lcd.print("RPM=");
lcd.print(RPM);
delay(5000);
}

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments