Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Fan Speed Measurement using IR Sensor & Arduino
Arduino Projects

Fan Speed Measurement using IR Sensor & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:November 27, 20236 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Fan Speed Measurement using IR Sensor & Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Fan Speed Measurement using IR Sensor & Arduino:

In this project, we have designed Digital Tachometer using an IR Sensor with Arduino for measuring the number of rotations of rotating fans in RPM. Simply we have interfaced IR sensor module with Arduino and 16*2 LCD module for display. The IR sensor module consists of IR Transmitter & Receiver in a single pair that can work a Digital Tachometer. So let’s learn about Fan Speed Measurement using IR Sensor & Arduino.

The tachometer is an RPM counter which counts the no. of rotation per minute. There are two types of tachometers one mechanical and another one is digital. Here we are going to design an Arduino-based digital tachometer using an IR sensor module to detect objects for count rotation of any rotating body. IR transmits IR rays which reflect back to the IR receiver and then IR Module generates an output or pulse which is detected by the Arduino controller when we press the start button. It counts continuously for 5 seconds.




Components Required

For designing Fan Speed Measurement Circuit using IR Sensor & Arduino we need the following components:

  1. Arduino UNO Board
  2. 16*2 LCD
  3. IR Sensor module
  4. Breadboard
  5. Connecting Jumper Wires

Circuit Diagram

Circuit Diagram Fan Speed Measurement using IR Sensor & Arduino


IR Sensor Module

Introduction

An infrared sensor is an electronic instrument that is used to sense certain characteristics of its surroundings by either emitting and/or detecting infrared radiation. Infrared sensors are also capable of measuring the heat being emitted by an object and detecting motion.

The wavelength region which ranges from 0.75 to 3µm is known as the near-infrared region. The region between 3 and 6µm is known as the mid-infrared and infrared radiation which has a wavelength greater higher than 6µm is known as far-infrared.


An IR sensor consists of an IR LED and an IR Photodiode; together they are called Photo–Coupler or Opto–Coupler. As said before, the Infrared Obstacle Sensor has a built-in IR transmitter and IR receiver. An infrared Transmitter is a light-emitting diode (LED) that emits infrared radiation. Hence, they are called IR LEDs. Even though an IR LED looks like a normal LED, the radiation emitted by it is invisible to the human eye. Infrared receivers are also called infrared sensors as they detect the radiation from an IR transmitter. IR receivers come in the form of photodiodes and phototransistors. Infrared Photodiodes are different from normal photodiodes as they detect only infrared radiation. When the IR transmitter emits radiation, it reaches the object and some of the radiation reflects back to the IR receiver. Based on the intensity of the reception by the IR receiver, the output of the sensor is defined.

Features

  1. Operating Voltage: 3.0V – 5.0V
  2. Detection range: 2cm – 30cm (Adjustable using potentiometer)
  3. Current Consumption:at 3.3V : ~23 mA,at 5.0V: ~43 mA
  4. Active output level: Outputs Low logic level when an obstacle is detected
  5. Onboard Obstacle Detection LED indicator

Source Code/Program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
float value=0;
float rev=0;
int rpm;
int oldtime=0;
int time;
 
void isr() //interrupt service routine
{
rev++;
}
 
void setup()
{
lcd.begin(16,2); //initialize LCD
attachInterrupt(0,isr,RISING); //attaching the interrupt
}
 
void loop()
{
delay(1000);
detachInterrupt(0); //detaches the interrupt
time=millis()-oldtime; //finds the time
rpm=(rev/time)*60000*3; //calculates rpm for blades
oldtime=millis(); //saves the current time
rev=0;
lcd.clear();
lcd.setCursor(3,0);
lcd.print("TACHOMETER");
lcd.setCursor(4,1);
lcd.print( rpm);
lcd.print(" RPM");
lcd.print(" ");
attachInterrupt(0,isr,RISING);
}




Video Tutorial:

Fan Speed (RPM) Measurement using IR Sensor and Arduino || Tachometer
Watch this video on YouTube.

You can also use the IR Sensor to design a Digital Tachometer and a GPS Module to make a GPS Speedometer.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleMeasure Tilt Angle Using MPU6050 Gyro/Accelerometer & Arduino
Next Article How to Control Multiple Servo Motors with Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 6 Comments

6 Comments

  1. JO on December 2, 2019 10:08 PM

    wheel rotate or not to sense the proximative sensore coading

    Reply
  2. jwan on July 10, 2020 12:22 PM

    How to change input to pin 8

    Reply
  3. sunny on July 8, 2021 9:08 AM

    The circuit diagram shows pin 2 is connected to IR and your code attachinterupt shows (0, )?
    please fix basic and Speed in RPM is NOT correct, it is not 13000

    Reply
  4. Dattaraj Vidyasagar on September 18, 2022 12:43 AM

    That’s the trick of publishing program on the net. Do something tricky and the code should not work.
    I tested it. Mr. Sunny, you are right. Connect the output pin of IR sensor to pin-2 and change the following lines in code, then it will work normally.

    attachInterrupt(2,isr,RISING); //attaching the interrupt
    }

    void loop()
    {
    delay(1000);
    detachInterrupt(0); //detaches the interrupt
    time=millis()-oldtime; //finds the time
    rpm=(rev/time)600003; //calculates rpm for blades
    oldtime=millis(); //saves the current time
    rev=0;
    lcd.clear();
    lcd.setCursor(3,0);
    lcd.print(“TACHOMETER”);
    lcd.setCursor(4,1);
    lcd.print( rpm);
    lcd.print(” RPM”);
    lcd.print(” “);
    attachInterrupt(2,isr,RISING);
    }

    on the following link of arduino.cc it is crearly mentioned to use ISR with only two pins i.e. pin-2 and pin-3
    https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/

    Reply
  5. Rob on January 4, 2023 7:37 PM

    This line has a syntax error: rpm=(rev/time)600003; //calculates rpm for blades
    Also, in the code in your article, you are using 60000*3 when it should be 60000/3

    Reply
  6. hugo lejeune on March 7, 2023 5:20 AM

    where does the 60000 come from?

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 16, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use ADS1115 16-Bit ADC Module with Arduino
    How to use ADS1115 16-Bit ADC Module with Arduino
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • Interfacing PN532 NFC RFID Module with Arduino
    Interfacing PN532 NFC RFID Module with Arduino
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.