Skip to content

I created and released a library in C++ that simplifies the creation of this project for the normal user. It is interrupt-based and doesn't block the code. It is very simple and only requires one Arduino UNO and an IR sensor.

License

Notifications You must be signed in to change notification settings

george10hany77/Tachometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tachometer Library for Arduino

Overview

The Tachometer library allows you to measure the rotational speed (RPM) using a tachometer sensor with an Arduino. It provides an easy interface to initialize the sensor, handle interrupts, and calculate RPM based on sensor pulses.

Features

  • Simple Initialization: Easy setup of the tachometer sensor pin.
  • RPM Calculation: Accurate calculation of RPM with debounce handling.
  • Customizable Revolutions: Configure the number of revolutions for averaging RPM calculations.

Installation

  1. Manual Installation:

    • Download the Tachometer library files.
    • Place the Tachometer folder into your Arduino libraries directory, typically found at Documents/Arduino/libraries.
  2. Using the Arduino IDE:

    • Go to Sketch > Include Library > Add .ZIP Library...
    • Select the .zip file containing the Tachometer library.

Disclaimer

You can create only one instance

Usage

Basic Example

Here’s a simple example to get you started with the Tachometer library:

#include <Tachometer.h>

const uint16_t SENSOR_PIN = 2; // Replace with your sensor pin

Tachometer tachometer(SENSOR_PIN);

void setup() {
    Serial.begin(9600);
    if (!tachometer.init()) {
        Serial.println("Tachometer initialization failed!");
    }
}

void loop() {
    double rpm = tachometer.getRPM();
    Serial.print("RPM: ");
    Serial.println(rpm);
    delay(1000); // Update every second
}

About

I created and released a library in C++ that simplifies the creation of this project for the normal user. It is interrupt-based and doesn't block the code. It is very simple and only requires one Arduino UNO and an IR sensor.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages