Tachometer using Arduino.

                A tachometer is a device which counts numbers of rotation per minute or seconds. In this project, we can't use any mechanical device to count device rotation we use an IR sensor to know rotation. This IR sensor feed data in Arduino and Arduino count RPM or RPS.For this project when we press push button rpm meter to start counting rpm for a few seconds and then display on LCD module. Circuit diagram for tachometer is given below.

Parts list

Arduino uno___(01)
Lcd module 16*2___(01)
IR module___(01)
10Kohm Resistor___(01)
100ohm Resistor___(01)

                           This tachometer is working on the principle of light reflection principal. we went to set up one white sticker on the surface to reflect light on ir receiver. When the light reflects ir module pin goes high so one revolution is noted in Arduino this way using interrupts and millis function we able to determine rpm of any revolving things. Here as shown in diagram output of ir sensor is only given to Arduino digital pin 2 because another digital pin is not capable with interrupts function. If you went to use another arduino module interrupt pin is different to know about inttrupt pin click here.
The code for the Arduino tachometer is given below.
#include<LiquidCrystal.h>
LiquidCrystal lcd(10,9,8,7,6,5);
float value=0;
float rev=0;
int rpm;
int previoustime=0;
int time;

void isr() 
{
rev++;
}

void setup()
{
lcd.begin(16,2);                
attachInterrupt(0,isr,RISING);  
}

void loop()
{
delay(1000);
detachInterrupt(0);           
time=millis()-previoustime;       
rpm=(rev/time)*60000;        
previoustime=millis();           
rev=0;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("  TRANSISTORHUB");
lcd.setCursor(0,1);
lcd.print(     rpm);
lcd.print(" RPM");
lcd.print("   ");
attachInterrupt(0,isr,RISING);
}
The formula for calculating rpm is very simple.
                  rev
RPS =   ----------
                 time
Using millis function we able to calculate the time and from interrupt function, we can able to calculate revolution. 



Comments

Popular posts from this blog