top of page

Tachometer Arduino Coding

In this Blog you will get a complete Arduino code for tachometer. You can able to make your own DIY tachometer and able to measure RPM of any moving Object. The range of this tachometer is from 200 to 50000 RPM. Its cheap in price and easy to make. The items you need

  1. Arduino UNO/ NANO

  2. IR sensor

  3. OTG Cable

Here you just need to connect the arduino with IR sensor. No power supply required. connect Arduino 5V pin to IR sensor VCC, and arduino GND to IR sensor GND. Arduino Digital pin 2 to IR Signal pin. Connection is complete. Now you need to upload the code to arduino. After that you need to install an app on your mobile. connect arduino cord to your mobile using OTG cable. Any arduino Display app will works good. after connect the app open the app and reading starts showing. use a white tape on the rotating object so that ir sensor can identify the object. distance from the ir sensor and object should be max 2 to 3 cm and not more than that.

Get full tutorial video link --

Items purchase Link --

Here is the Code -

float value=0;

float rev=0;

int rpm;

int oldtime=0;

int time;

void isr() //interrupt service routine




void setup()



attachInterrupt(0,isr,RISING); //attaching the interrupt


void loop()



detachInterrupt(0); //detaches the interrupt

time=millis()-oldtime; //finds the time

rpm=(rev/time)*52000; //calculates rpm

oldtime=millis(); //saves the current time


Serial.print( rpm);

Serial.print(" RPM\n");




Sameer Shaikh
Sameer Shaikh
Nov 17, 2023

Thanks you


げら ほ
げら ほ
May 19, 2023

what 52000?

bottom of page