Introduction
In this project, we have designed Digital Tachometer using an IR Sensor with Arduino for measuring the number of rotations of the rotating Motor in RPM. Simply we have interfaced the IR sensor module with Arduino and the 16*2 LCD module for display. The IR sensor module consists of IR Transmitter & Receiver in a single pair that can work as a Digital Tachometer for speed measurement of any rotating object.
The Tachometer is an RPM counter which counts the no. of rotation per minute. There are two types of tachometer 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.
You can also make: Fan Speed Measurement Device as well as GPS Speedometer.
Components Required
For designing Digital Tachometer using IR Sensor with Arduino & LCD we need the following components:
1 2 3 4 5 6 |
1. Arduino UNO Board 2. 16*2 LCD 3. IR Sensor module containing both transmitter and receiver 4. Tact Switch (Reset Switch) 4. Breadboard 5. Connecting Jumper Wires |
Digital Tachometer using IR Sensor with Arduino for measuring RPM
Now after managing these components do this following connection for designing Digital Tachometer using IR Sensor with Arduino for measuring RPM
LCD Pins 1, 3 ,5 ,16 ——— GND
LCD Pins 2, 15————— VCC (+5V)
LCD Pin 4 ——————– Arduino pin D7
LCD Pin 6 ——————– Arduino pin D6
LCD Pin 11 ——————- Arduino pin D5
LCD Pin 12 ——————- Arduino pin D4
LCD Pin 13 ——————- Arduino pin D3
LCD Pin 14 ——————- Arduino pin D2
IR Sensor Module Pin -GND —— GND
IR Sensor Pin +VCC —— VCC
IR Sensor Pin OUT — Arduino Pin D9
Tact Switch one end ————- Arduino PinD12
Tact Switch another end ————-GND
A connection diagram is given below as well. Simply assemble the circuit like this.
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 2 3 4 5 |
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 |
Working Mechanism
In this circuit, the IR sensor module is interfaced with Arduino to measure fan rotation speed in RPM. The calculation is done on this basis.
After 5 seconds Arduino calculates RPM for a minute using the given formula.
Where object = number of the blade in a fan.
Arduino Source Code/Program:
So here is a source code for designing Digital Tachometer using IR Sensor with Arduino. Simply copy the code and upload it to your Arduino board using Arduino IDE.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
#include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #define sensor 9 #define start 12 int delay1() { //unsigned int long k; int i,j; unsigned int count=0; for(i=0;i<1000;i++) { for(j=0;j<1000;j++) { if(digitalRead(sensor)) { count++; while(digitalRead(sensor)); } } } return count; } void setup() { pinMode(sensor, INPUT); pinMode(start, INPUT); pinMode(2, OUTPUT); lcd.begin(16, 2); lcd.print(” Tachometer”); delay(2000); digitalWrite(start, HIGH); } void loop() { unsigned int time=0,RPM=0; lcd.clear(); lcd.print(” Please Press “); lcd.setCursor(0,1); lcd.print(“Button to Start “); while(digitalRead(start)); lcd.clear(); lcd.print(“Reading RPM…..”); time=delay1(); lcd.clear(); lcd.print(“Please Wait…..”); RPM=(time*12)/3; delay(2000); lcd.clear(); lcd.print(“RPM=”); lcd.print(RPM); delay(5000); } |
Video Preview & Explanation
You can also use the IR sensor for designing a Bidirectional Visitor Counter.
9 Comments
Actually Pin no. 15 of 16*2 LCD display is connected with +5V Vcc. But you mistakenly have written there pin no. 16 is connected with the +5V Vcc , so please fix that typing mistake. By the way your post is explaining everything about that project is very good with detailed instruction with the application of each components. Hope now I can also do it very easily.
Thanks for referring the mistake. And all the best for your project.
Thank you.
You also did another mistake there i think. Because you mentioned that you connected the humidity sensor’s vcc pin with +5v vcc. But I think that you didn’t use the humidity sensor over here and can you check the whole post once again ?
Corrected. Thank you again 🙂
Why did you use a nested for loop till 1000?
nice idea!!!!!!!!
What’s the maximum RPM that this circuit can read? Can it do 1000rpm, 5000rpm?
In the formula stated above why is it that we are multiplying the value obtained with 12?