Categories: 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.

 


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 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

  1. #include<LiquidCrystal.h>
  2. LiquidCrystal lcd(12,11,10,9,8,7);
  3. float value=0;
  4. float rev=0;
  5. int rpm;
  6. int oldtime=0;
  7. int time;

  8. void isr() //interrupt service routine
  9. {
  10. rev++;
  11. }

  12. void setup()
  13. {
  14. lcd.begin(16,2); //initialize LCD
  15. attachInterrupt(0,isr,RISING); //attaching the interrupt
  16. }

  17. void loop()
  18. {
  19. delay(1000);
  20. detachInterrupt(0); //detaches the interrupt
  21. time=millis()-oldtime; //finds the time
  22. rpm=(rev/time)*60000*3; //calculates rpm for blades
  23. oldtime=millis(); //saves the current time
  24. rev=0;
  25. lcd.clear();
  26. lcd.setCursor(3,0);
  27. lcd.print(“TACHOMETER”);
  28. lcd.setCursor(4,1);
  29. lcd.print( rpm);
  30. lcd.print(” RPM”);
  31. lcd.print(” “);
  32. attachInterrupt(0,isr,RISING);
  33. }



ahcene_diy

Recent Posts

How to make a portable speaker

You've all seen portable speakers becoming popular right now, but most of them are pretty…

2 years ago

UNIVERSAL BRUSH MOTOR DRIVER AND

UNIVERSAL BRUSH MOTOR DRIVER AND BLDC Introducing an overview of the BLDC motor driver circuit and…

2 years ago

DIY Automatic Sensor Hand Sanitizer

DIY Automatic Sensor Hand Sanitizer Automatic Hand Sanitizer Based on Distance Sensor (No Arduino Required)…

3 years ago

What is Arduino

What is Arduino Arduino is a convenient, flexible and easy-to-use open source electronic prototyping platform,…

3 years ago

Make Your Own Arduino Board

Make Your Own Arduino Board In this DIY Project, I will show you how to…

3 years ago

Wind generator from a gyro-scooter motor

WIND GENERATOR FROM A GYROSCOOTER MOTOR A solar power plant is good when there is sun. But…

3 years ago