|
arduino-nano-v3 |
x 1 | |
|
SH1106 od SSD1306 Oled display 128x64 |
x 1 | |
|
Cheap Infrared sensor module |
x 1 |
![]() |
Soldering Iron Kit |
Arduino Tachometer (RPM meter) with IR sensor module
A tachometer is an instrument measuring the rotation speed of a shaft or disk, as in a motor or other machine. The device usually displays the revolutions per minute (RPM) on Analogue dial, or on digital display. In this project, tachometer is made using an IR Sensor module as unit for measuring the number of rotations.
Simply we have interfaced the IR sensor module with Arduino nano and the SH1106 Oled display. The 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.
One diode transmits IR rays which reflect back to the receiver diode and then IR Module generates an output or pulse which is detected by the Arduino controller.
Arduino calculates RPM for a minute using the given formula:
rpm = (objects / 3.0)*60;
because in our case we have 3 obstacles (objects) in one full circle
The device is very simple to build and consists of several components:
- Arduino Nano microcontroller
- IR sensor module
- and SH1106(or SSD1306) Oled display
If you want to make a PCB for this project, or for any other electronic project, PCBway (www.pcbway.com) is a great choice for you. PCBway is one of the most experienced PCB manufacturing company in China in field of PCB prototype and fabrication. They provide completed PCB assembly service with worldwide free shipping , and ISO9001 quality control system. Also, on their site there is an online gerber viewer where you can upload your gerber and drill files to render your board.
Let me mention that instead of SH1106, an SSD1306 OLED display can be used, so in the code everywhere you simply need to replace SH1106 with SSD1306.
When measuring, we need to place the sensor at a certain distance from the rotating object, and this distance can be defined by the trimmer potentiometer on the IR module. In this case, I will measure the RPM of two small Stirling engines, as well as one PC power supply fan.
By the way, in the description of the construction of the device, there are also brief instructions for assembling the high-temperature Stirling engine.
Immediately after starting the device, my logo appears on the screen, and after a few seconds the measurement can begin. It is useful to know that any image can be converted into a C code array using special programs for this purpose, and even online.
For greater visibility, a progress bar proportional to the number of revolutions appears on the upper part of the screen . Depending on the range of values for which we will use the tachometer, in a part of the code:
display.fillRect(0,4, map(rpm, 0, 1000, 0, 128), 8,WHITE);
another value can also be mapped.
First, we measure the rotational speed of a low temperature Stirling engine. This machine has 6 obstacles so we adjust the arduino code accordingly
rpm = (objects / 6.0)*60;
For this machine to work, the cup must be filled with boiling water.
Next, we measure the rotational speed of a high-temperature Stirling engine.
And finally, we measure the rotation speed of the PC fan.
The device is built into a suitable box made of 5 mm PVC board, covered with self-adhesive colored wallpaper. In fact, I used the box from one of my previous projects, so the light sensor and the button have no function in this specific project.
#include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #define sensor 2 const unsigned char zmaj [] PROGMEM = { // 'zmaj7 60x60, 128x64px 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x80, 0x00, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x00, 0x00, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x04, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0c, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x80, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x40, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x80, 0x60, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x80, 0x30, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x3f, 0xfa, 0x80, 0x0f, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xed, 0xbf, 0xf4, 0x80, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0x3f, 0xe9, 0x80, 0x00, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0xff, 0xd3, 0x00, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0xff, 0xa6, 0x01, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0xff, 0x4c, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0xfe, 0x98, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0xfd, 0x30, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x82, 0x02, 0x60, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa1, 0xfc, 0x80, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x41, 0x80, 0x00, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0xbe, 0x00, 0x04, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0x40, 0x00, 0x0b, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x05, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x47, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x87, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x00, 0x00, 0x8b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x80, 0x00, 0x97, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4c, 0x01, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa6, 0x03, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd3, 0x04, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe9, 0x8c, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0x88, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x90, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x90, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x8a, 0x05, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x87, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x01, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x81, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; int rpm = 0; //int pid; unsigned long millisBefore; volatile int objects; void setup() { Serial.begin(9600); display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64). attachInterrupt(digitalPinToInterrupt(2), count, FALLING); delay(1000); display.clearDisplay(); display.drawBitmap(0, 0,zmaj, 128, 64, WHITE); // display.drawBitmap(x position, y position, bitmap data, bitmap width, bitmap height, color) display.display(); delay(2000); display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(22,10); display.println("mircemk");// Print text display.setCursor(10,40); display.println("RPM METER"); display.display(); delay(2000); pinMode(2, INPUT); } void loop() { print_to_OLED(); if (millis() - millisBefore > 1000) { rpm = (objects / 3.0)*60; objects = 0; millisBefore = millis(); } delay(100); display.fillRect(0, 4, 128, 12,BLACK); display.fillRect(0,4, map(rpm, 0, 1000, 0, 128), 8,WHITE); display.display(); } void print_to_OLED() { display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(13,20); display.println("RPM:"); display.setCursor(70,45); display.println(rpm); display.display(); } void count() { objects++; }

Arduino Tachometer (RPM meter) with IR sensor module
- Comments(0)
- Likes(0)

- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Mirko Pavleski
-
8-bit Space Shooter on ESP8266 & LED Matrix - DIY Arduino Gaming Arcade games are fast-paced, simple-to-play video games and Goal is usually to get the highest score...
-
DIY Low Voltage One Tube 6J1 SW-SSB SDR Radio (Works at 3.7V) A vacuum tube radio, also known as a valve radio, is an early type of radio receiver that uses vacu...
-
Simple & Versatile Arduino Kitchen Timer with TM1637 Display A kitchen timer is a simple, user-friendly device that counts down a set time and alerts the user w...
-
Building an E-Paper Analog Clock with ESP32 - Full Tutorial In several of my previous projects you could see various unusual clocks , including several in the ...
-
DIY ESP32 15 Puzzle game on TFT touch Dispaly The "15 Puzzle" is a classic sliding puzzle that consists of a 4×4 grid with 15 numbered square til...
-
DIY Simple Sensitive Pinpointer Metal Detector A pinpointer metal detector, often simply called a pinpointer, is a small, handheld device used to ...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
Build a Raspberry Pi Pico SDR Radio with Waterfall Display Software-defined radio (SDR) is a radio communication system where components that have traditional...
-
DIY Magnet Polarity Detector - How to Identify Poles with a Hall Sensor from a PC Fan Recently, while working on a project, I needed to determine the polarity of several permanent magne...
-
Light Meter Project - Making Dfrobot Unihiker K10 Work with Standard Arduino Libraries The other day I received a shipment with a UNIHIKER K10 development board from DFRobot, which I rec...
-
DIY Simple Arduino Whack-a-Mole Game A "Whack-a-Mole" game is a classic arcade-style game where moles pop up randomly from holes, and th...
-
Wireless Power Transmission, Long-Distance and High-Efficiency with Class-E Tesla Coil Wireless energy transfer also known as wireless power transmission is a method of getting useful el...
-
330,000 volts (330kV) from modified PC Power Supply and Cockroft Walton Multiplier The Cockcroft-Walton voltage multiplier is a circuit configuration used to generate high DC voltage...
-
Raspberry Pi Pico SSTV Decoder- Receive Images Over Radio Slow-scan television (SSTV) is a method for transmitting and receiving still pictures over radio wav...
-
Building a Plasma Flame Generator, HFSSTC Class-E Tesla Coil Plasma flame generator is a device that utilizes the high-frequency, high-voltage output of a Tesla...
-
DIY STM32 Alarm Clock with 7-Segment Display (Using Arduino IDE) This time I will present you a classic 7 segment display alarm clock which will represent another o...
-
Arduino Breakout game on 8X8 Led Matrix with WS2812B Leds Recently in one of my projects I presented you a simple way to make a Tetris game on an 8x8 LED dis...
-
How to make Simple Offline High Voltage Generator 220V to 60000V A high voltage power supply is an electronic device that provides an electrical output at high vol...
-
8-bit Space Shooter on ESP8266 & LED Matrix - DIY Arduino Gaming Arcade games are fast-paced, simple-to-play video games and Goal is usually to get the highest score...
-
DIY Low Voltage One Tube 6J1 SW-SSB SDR Radio (Works at 3.7V) A vacuum tube radio, also known as a valve radio, is an early type of radio receiver that uses vacu...
-
Simple & Versatile Arduino Kitchen Timer with TM1637 Display A kitchen timer is a simple, user-friendly device that counts down a set time and alerts the user w...
-
Building an E-Paper Analog Clock with ESP32 - Full Tutorial In several of my previous projects you could see various unusual clocks , including several in the ...
-
DIY ESP32 15 Puzzle game on TFT touch Dispaly The "15 Puzzle" is a classic sliding puzzle that consists of a 4×4 grid with 15 numbered square til...
-
DIY Simple Sensitive Pinpointer Metal Detector A pinpointer metal detector, often simply called a pinpointer, is a small, handheld device used to ...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
Build a Raspberry Pi Pico SDR Radio with Waterfall Display Software-defined radio (SDR) is a radio communication system where components that have traditional...
-
DIY Magnet Polarity Detector - How to Identify Poles with a Hall Sensor from a PC Fan Recently, while working on a project, I needed to determine the polarity of several permanent magne...
-
Light Meter Project - Making Dfrobot Unihiker K10 Work with Standard Arduino Libraries The other day I received a shipment with a UNIHIKER K10 development board from DFRobot, which I rec...
-
DIY Simple Arduino Whack-a-Mole Game A "Whack-a-Mole" game is a classic arcade-style game where moles pop up randomly from holes, and th...
-
Wireless Power Transmission, Long-Distance and High-Efficiency with Class-E Tesla Coil Wireless energy transfer also known as wireless power transmission is a method of getting useful el...
-
-
Choose the right brightness for your LEDs. LED RESISTANCE HELPER Tool
192 0 3 -
-
Flood Detection and warning system using LORA and Arduino
514 0 2 -
-
Ender 3 Linear Rail Upgrade (No modifying of existing parts)
450 0 0