Project tutorial
DIY Tachometer (RPM Meter)

DIY Tachometer (RPM Meter)

In this project, I will show you how we can use a 3€ IR distance sensor to build a proper DIY tachometer that functions properly.

  • 11,950 views
  • 2 comments
  • 11 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

About this project

In this project, I will show you how a 3€ IR distance sensor works and how we can use it to build a proper DIY tachometer that functions properly. Let's get started!

Step 1: Watch the Video!

Make sure to watch the video. It gives you all the information you need to create your own DIY tachometer. But during the next steps I will present you some additional information.

Step 2: Order the Components!

Step 3: Create the Circuit!

Step 4: Upload the Code!

Here you can find the code for the project. Upload it through an FTDI breakout board. Also, make sure to include this library:

https://github.com/olikraus/u8g2

Also make sure that you use the board setting: Arduino Pro Mini 3.3V 8MHz

You did it! You just created your own DIY Tachometer!

Code

CODE:C/C++
#include <Arduino.h>
#include <U8x8lib.h>
#include <SPI.h>
#include <Wire.h>
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
unsigned long rpmtime;
float rpmfloat;
unsigned int rpm;
bool tooslow = 1;

void setup() {
  u8x8.begin();
  u8x8.setFont(u8x8_font_profont29_2x3_f);
  TCCR1A = 0;
  TCCR1B = 0;
  TCCR1B |= (1 << CS12); //Prescaler 256
  TIMSK1 |= (1 << TOIE1); //enable timer overflow
  pinMode(2, INPUT);
  attachInterrupt(0, RPM, FALLING);
}

ISR(TIMER1_OVF_vect) {
  tooslow = 1;
}

void loop() {
  delay(1000);
  if (tooslow == 1) {
    u8x8.clear();
    u8x8.drawString(1, 0, "SLOW!");
  }
  else {
    rpmfloat = 120 / (rpmtime/ 31250.00);
    rpm = round(rpmfloat);
    u8x8.clear();
    u8x8.setCursor(1,0);
    u8x8.print(rpm);
  }
}

void RPM () {
  rpmtime = TCNT1;
  TCNT1 = 0;
  tooslow = 0;
}

Schematics

Schematics
Fjb570hkepokz9m jdeuokiizb
tachometer_uKW8AK4IGy.ino

Comments

Created by

GreatScottLab

Are you GreatScottLab? Claim this project and add it to your profile.

This is mine

Posted by

Beastidrees62
BEASTIDREES62
  • 4 projects
  • 25 followers

Additional contributors

Published on

September 19, 2020

Members who respect this project

Dsci0166DefaultDuminyrAoh14gjw2byo20ck1tedwvydtfjpowv6kjpzfqtu7lfe=s96 cDefault

and 6 others

See similar projects
you might like

Similar projects you might like

DIY Simple Frequency Meter Up to 6.5MHz

Project tutorial by Mirko Pavleski

  • 12,315 views
  • 6 comments
  • 19 respects

DIY Simple Autorange Capacitance Meter (10pF-10000microF)

Project tutorial by Mirko Pavleski

  • 10,864 views
  • 9 comments
  • 20 respects

DIY 6.5MHz Frequency Meter with MAX7219 7-Segment LED Module

Project tutorial by Mirko Pavleski

  • 4,157 views
  • 1 comment
  • 9 respects

DIY Gauss Meter

Project tutorial by Tanishq Jaiswal

  • 3,278 views
  • 0 comments
  • 9 respects

Arduino DIY Light Meter With BH1750 Sensor

Project tutorial by Nick Koumaris

  • 13,779 views
  • 2 comments
  • 7 respects

DIY Distance Meter with Arduino and a Nokia 5110 Display

Project tutorial by Nick Koumaris

  • 13,138 views
  • 0 comments
  • 23 respects
Add projectSign up / Login