Arduino projects

Measuring Fan Speed Using Infrared Sensors and Arduino

In this article, we designed a digital tachometer using Arduino and an infrared sensor to measure the RPM (revolutions per minute) of a rotating fan. Simply connect the infrared sensor module to the Arduino and the 1602 LCD module to display the results. The infrared sensor module consists of an infrared emitter and receiver pair. Now, let’s explore how to measure fan speed using an infrared sensor and Arduino.

A tachometer is an RPM counter used to measure the number of rotations per minute. There are two types of tachometers: mechanical and digital. In this article, we will design a digital tachometer based on Arduino using an infrared sensor module to detect objects and count rotations. When the transmitted infrared light is reflected back to the receiver, the infrared sensor module generates an output. When we press the start button, the Arduino controller detects this output. It counts continuously for 5 seconds.

Measuring Fan Speed Using Infrared Sensors and Arduino

Required Components

To design a fan speed measurement circuit using an infrared sensor and Arduino, we need the following components:

  • Arduino UNO development board
  • 1602 LCD display
  • Infrared sensor module
  • Breadboard
  • Connecting jumper wires

Circuit Diagram

Below is the circuit diagram for measuring fan speed using an infrared sensor and Arduino.

Measuring Fan Speed Using Infrared Sensors and Arduino

Introduction to the Infrared Sensor Module

An infrared sensor is an electronic device used to sense certain characteristics of its surroundings by emitting and/or detecting infrared radiation. Infrared sensors can also measure the heat emitted by objects and detect motion.

The region with a wavelength range from 0.75 to 3μm is called the near-infrared region. The region between 3 and 6μm is called the mid-infrared, and infrared radiation with a wavelength greater than 6μm is called far-infrared.

An infrared sensor includes an infrared LED and an infrared photodiode. Together, they are known as a photo-coupler. As mentioned earlier, the infrared sensor has a built-in infrared emitter and receiver. The infrared emitter is a light-emitting diode (LED) that emits infrared radiation. Therefore, it is called an IR LED. Although an IR LED appears like a regular LED, the radiation it emits is invisible to the human eye. The infrared receiver is also known as an infrared sensor because it detects radiation from the IR emitter. Infrared receivers come in the form of photodiodes and phototransistors. When the infrared emitter emits radiation, it reaches the object, and some of the radiation is reflected back to the infrared receiver. Based on the intensity of the radiation received by the infrared receiver, the sensor’s output is defined.

Main Features

  • Operating Voltage: 3.0V – 5.0V
  • Detection Range: 2cm – 30cm (adjustable via potentiometer)
  • Current Consumption: ~23 mA at 3.3V, ~43 mA at 5.0V
  • Effective Output Level: Low level when an obstacle is detected
  • Onboard Obstacle Detection LED Indicator

Source Code/Program

#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);
}

Back to top button