Introduction: Build RPM Meter With Arduino and IR Sensor

In this tutorial, we are going to make Digital Tachometer using an IR Sensor with the help of Arduino for measuring the number of rotations of the rotating Motor in RPM. Here we have interfaced the IR sensor module with Arduino and the 0.96 Inch OLED display to display the RPM count. The IR sensor module consists of an IR Transmitter & Receiver that can work as a Digital Tachometer for speed measurement of any rotating object. There are two types of tachometer one is mechanical and another one is digital. Here we are going to build an Arduino-based digital tachometer using an IR sensor module. So let's make it.

Supplies

Step 1: What Is Tachometer and RPM?

The Tachometer is an RPM counter used to measure the number of rotation per minute. The unit of measurement of the tachometer is the revolutions per minute (RPM). So in short we can say that tachometer is an instrument that measures RPM.

Step 2: How Tachometer Works?

A tachometer works on the principle of Infrared waves. When we power the InfraRed sensor module to 5v, Infrared LED starts emitting infrared rays. These infrared rays reaches the object’s surface and this radiation gets reflected back to the IR receiver. The Photodiode or IR receiver detects the infrared light and produces output accordingly. In our case, this reflected infrared light is used to measure the RPM of the motor.

Step 3: Circuit Diagram

Step 4: Arduino Programming for RPM Meter

#include <Arduino.h>

#include <U8x8lib.h>

#include <SPI.h>

#include <Wire.h>

U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);

unsigned long rpmtime;

float rpmfloat;

unsigned int rpm;

bool tooslow = 1;

void setup() {

 u8x8.begin();

 u8x8.setFont(u8x8_font_profont29_2x3_f);

 TCCR1A = 0;

 TCCR1B = 0;

 TCCR1B |= (1 << CS12); //Prescaler 256

 TIMSK1 |= (1 << TOIE1); //enable timer overflow

 pinMode(2, INPUT);

 attachInterrupt(0, RPM, FALLING);

}

ISR(TIMER1_OVF_vect) {

 tooslow = 1;

}

void loop() {

 delay(1000);

 if (tooslow == 1) {

  u8x8.clear();

  u8x8.drawString(1, 0, "SLOW!");

 }

 else {

  rpmfloat = 120 / (rpmtime/ 31250.00);

  rpm = round(rpmfloat);

  u8x8.clear();

  u8x8.setCursor(1,0);

  u8x8.print(rpm);

 }

}

void RPM () {

 rpmtime = TCNT1;

 TCNT1 = 0;

 tooslow = 0;

}

Step 5: RPM Meter Circuit

Here is the final RPM Meter Circuit.