PracticeMakesBetter
Published © GPL3+

Easy Peasy Tachometer

Easy peasy reliable tachometer, that you can use to measure the rpm of tools, bicycle wheels, and robots using inexpensive parts.

BeginnerFull instructions provided2,253
Easy Peasy Tachometer

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Graphic OLED, 128 x 64
Graphic OLED, 128 x 64
×1
3144 Hall Sensor
×1

Story

Read more

Custom parts and enclosures

Hall Sensor wiring diagram

Code

Easy Peasy Tachometer

Arduino
It is a home made reliable tachometer, that can be used with an Arduino Uno or Nano that you can make to measure the speed of rotating objects on tools, bicycles, and robotics.
// Easy Peasy Tachometer
//James Rovere 2020
#include <Wire.h>
#include <Adafruit_SSD1306.h>// You may have to edit library for 128x64, //default is 128 x 32.

#define OLED_WIDTH 128
#define OLED_HEIGHT 64

#define OLED_ADDR   0x3C // A very common address for these displays.

Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);


float value=0;
float rev=0;
int rpm;
int oldtime=0;        
int time;

void isr()          //interrupt service routine
{
rev++;
}

void setup()
{
 display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
 display.clearDisplay();
   
digitalWrite(2 ,HIGH);// Instead of using a pull up resistor
attachInterrupt(0,isr,RISING);  //attaching the interrupt

}

void loop()
{
delay(2000);// 2 second delay
detachInterrupt(0);           //detaches the interrupt while calculating
time=millis()-oldtime;        //finds the time 
rpm=(rev/time)*60000;         //calculates rpm
oldtime=millis();             //saves the current time
rev=0;

  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);// Vertical, Horizontal.
  display.println("RPM:");
  display.setTextSize(5);
  display.setTextColor(WHITE);
  display.setCursor(0,25);
  display.println(rpm); 
  display.display();
  

  attachInterrupt(0,isr,RISING);


}

Easy Peasy Tachometer

Arduino
It is a home made reliable tachometer, that can be used with an Arduino UNO or NANO that you can use to measure the speed of rotating objects on tools, bicycles, and robotics. For a complete tutorial follow this link https://youtu.be/2-J4f8-RX90
// Easy Peasy Tachometer
//James Rovere 2020
#include <Wire.h>
#include <Adafruit_SSD1306.h>// You may have to edit library for 128x64,
//  default is 128 x 32.

#define OLED_WIDTH 128
#define OLED_HEIGHT 64

#define OLED_ADDR   0x3C // A very common address for these displays.

Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);


float value=0;
float rev=0;
int rpm;
int oldtime=0;        
int time;

void isr()          //interrupt service routine
{
rev++;
}

void setup()
{
 display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
 display.clearDisplay();
   
digitalWrite(2 ,HIGH);// Instead of using a pull up resistor
attachInterrupt(0,isr,RISING);  //attaching the interrupt

}

void loop()
{
delay(2000);// 2 second delay
detachInterrupt(0);           //detaches the interrupt while calculating
time=millis()-oldtime;        //finds the time 
rpm=(rev/time)*60000;         //calculates rpm
oldtime=millis();             //saves the current time
rev=0;

  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);// Vertical, Horizontal.
  display.println("RPM:");
  display.setTextSize(5);
  display.setTextColor(WHITE);
  display.setCursor(0,25);
  display.println(rpm); 
  display.display();
  

  attachInterrupt(0,isr,RISING);


}

Credits

PracticeMakesBetter

PracticeMakesBetter

0 projects • 1 follower

Comments