• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Arduino Engineering Projects / Arduino Tachometer Circuit for Precise Readings

Arduino Tachometer Circuit for Precise Readings

Last Updated on June 26, 2019 by Swagatam

caution electricity can be dangerous

A tachometer is a device that measures the RPM or angular velocity of a rotating body. It differs from speedometer and odometer as these devices deal with linear or tangential velocity of the body while tachometer a.k.a. “tach” deals with more fundamental the RPM.

By Ankit Negi

Tachometer is composed of a counter and a timer both of these working together provides the RPM.In our project we are going to do same, using our Arduino and some sensors we will setup both a counter and a timer and develop our handy and easy tach.

Prerequisites

Counter is nothing but a device or setup that can count any certain regular occurring event like passing of a dot in disc while in rotation. Initially the counters were built using the mechanical arrangement and linkages like gears, ratchets, springs etc.

But now we are using counter having more sophisticated and highly precise sensors and electronics.Timer is an electronic element that is able to measure the time interval between events or measure time.

In our Arduino Uno there are timers that not only keep track of time but also maintain some of the important functions of Arduino. In Uno we have 3 timers named Timer0, Timer1 and Timer2. These timers have following functions-• Timer0- For Uno functions like delay(), millis(), micros() or delaymicros().

• Timer1- For the working of servo library.

• Timer2- For functions like tone(), notone().

Along with these functions these 3 timers are also responsible for generating the PWM Output when analogWrite() command is used in the PMW designated pin.

Concept of Interrupts

In Arduino Uno a hidden tool is present which can give access to a whole lot of functioning to us known as Timer Interrupts.Interrupt is a set of events or instructions that are executed when called interrupting the current functioning of the device, i.e. no matter what codes your Uno was executing before but once an Interrupt is called Arduino execute the instruction mentioned in the Interrupt.

magnet on motor shaft

Now Interrupt can be called at certain condition defined by the user using an inbuilt Arduino Syntax.We will be using this Interrupt in our project that makes our tachometer more resolute as well as more precise than the other Tachometer project present around the web.

Components required for this Tachometer project using Arduino

• Hall Effect Sensor (Fig.1)

hall effect sensor module

• Arduino Uno

Arduino UNO board

• Small magnet

small magnet

• Jumper wires

• Rotating Object (Motor shaft)

DC motor

Circuit Setup

• The setup for creating is as follows-

• In the shaft whose rotation speed is to be measured is fitted with a small magnet using glue gun or electrical tape.

• Hall Effect sensor has a detector in front and 3 pins for connections.

• The Vcc and Gnd pins are connected to 5V and Gnd pin of Arduino respectively. The Output pin of the sensor is connected to the digital pin 2 of the Uno to provide the input signal.

• All components are fixed in a mount board and Hall detector is pointed out from the board.

Programming

int sensor = 2; // Hall sensor at pin 2
volatile byte counts;
unsigned int rpm; //unsigned gives only positive values
unsigned long previoustime;
void count_function()
{ /*The ISR function
Called on Interrupt
Update counts*/
counts++;
}
void setup() {
Serial.begin(9600);
//Intiates Serial communications
attachInterrupt(0, count_function, RISING); //Interrupts are called on Rise of Input
pinMode(sensor, INPUT); //Sets sensor as input
counts= 0;
rpm = 0;
previoustime = 0; //Initialise the values
}
void loop()
{
delay(1000);//Update RPM every second
detachInterrupt(0); //Interrupts are disabled
rpm = 60*1000/(millis() - previoustime)*counts;
previoustime = millis(); //Resets the clock
counts= 0; //Resets the counter
Serial.print("RPM=");
Serial.println(rpm); //Calculated values are displayed
attachInterrupt(0, count_function, RISING); //Counter restarted
}

Upload the code.

Know the code

Our tachometer uses Hall Effect Sensor; Hall Effect sensor is based on Hall effect named after its discoverer Edwin Hall.

Hall Effect is phenomenon of generation of voltage across a current carrying conductor when a magnetic field is introduced perpendicular to the flow of current. This voltage generated due this phenomenon help in Input signal generation.As mentioned Interrupt will be used in this project, to call Interrupt we have to setup some condition. Arduino Uno has 2 conditions for calling for Interrupts-

RISING- When used this, Interrupt are called every time when the Input signal goes from LOW to HIGH.

FALING-When used this, Interrupt are called when signal goes from HIGH to LOW.

We have used the RISING, what happens is that when the magnet placed in the shaft or rotating object come close to Hall detector Input signal is generated and Interrupt are called in, Interrupt initiates the Interrupt Service Routine(ISR) function, which include increment in the counts value and thus count takes place.

We have used the millis() function of Arduino and previoustime (variable) in correspondence to setup the timer.

The RPM thus is finally calculated using the mathematical relation-

RPM= Counts/Time taken Converting the milliseconds to minutes and rearrangement we gets to the formula= 60*1000/(millis() - previoustime)*counts.

The delay(1000) determines the time interval after which the value of RPM will be updated on the screen, you can adjust this delay according to your needs.

This value of RPM obtained can be further used to calculate the tangential velocity of the rotating object using the relation- v= (3.14*D*N)/60 m/s.

The value of RPM can also be used to calculate the distance travelled by a rotating wheel or disc.

Instead of printing values to Serial monitor this device can be made more useful by connecting a LCD display (16*2) and battery for better usage.

You'll also like:

  • 1.  Digital Capacitance Meter Circuit Using Arduino
  • 2.  Make this Amplifier Power Meter Circuit
  • 3.  How to Measure Gain (β) of a BJT
  • 4.  Microamp Meter Circuit
  • 5.  Simple Crystal Tester Circuit
  • 6.  Wireless Servo Motor Control Using 2.4 GHz communication link

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

4 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz