Arduino projects

Infrared sensor and Arduino for speed measurement

In this article, we designed a digital tachometer using Arduino and infrared sensors to measure the number of rotations of a rotating fan, RPM. Just connect the infrared sensor module with Arduino and 1602 LCD module to display. The infrared sensor module consists of a pair of infrared transmitters and receivers. Now, let us understand the knowledge of fan speed measurement using infrared sensor and Arduino.

 

The tachometer is an RPM counter that counts the number of revolutions per minute. There are two types of tachometers, one is mechanical and the other is digital. In this article, we will design a digital tachometer using infrared sensor module based on Arduino to detect objects to count rotation. When the transmitted infrared light is reflected back to the receiver, then the infrared sensor module generates an output, which will be detected by the Arduino controller when we press the start button. It counts continuously for 5 seconds.

 

Infrared sensor and Arduino for speed measurement

 

Required components

In order to design a fan speed measurement circuit using infrared sensors and Arduino, we need the following components:

● Arduino UNO development board

● 1602 LCD display

● Infrared sensor module

● Breadboard

● Connect the jumper

 

Circuit schematic

The following is the circuit diagram for fan speed measurement using infrared sensor and Arduino

Infrared sensor and Arduino for speed measurement

 

Infrared sensor module introduction

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

 

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

 

The infrared sensor includes an infrared LED and an infrared photodiode. Together they are called optocouplers. As mentioned earlier, the infrared sensor has a built-in infrared transmitter and infrared receiver. An infrared transmitter is a light emitting diode (LED) that emits infrared radiation. Therefore, they are called IR LEDs. Even though an IR LED looks like an ordinary LED, the radiation it emits is invisible to the human eye. Infrared receivers are also called infrared sensors because they detect radiation from IR transmitters. Infrared receivers are in the form of photodiodes and phototransistors. When the infrared transmitter emits radiation, it will reach the object, and some of the radiation will be reflected back to the infrared receiver. According to the receiving intensity of the infrared receiver, the output of the sensor is defined.

 

Main features

● Working voltage: 3.0V-5.0V

● Detection range: 2cm – 30cm (adjustable by potentiometer)

● Current consumption: at 3.3V: ~23 mA, at 5.0V: ~43 mA

● Effective output level: output low level when an obstacle is detected

● On-board 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);
  • }



One Comment

Leave a Reply

Back to top button