Tachometer Using Arduino and Hall Effect Sensor - Engineer Experiences
Tachometer Using Arduino and Hall Effect Sensor - Engineer Experiences
Table of Contents
Introduction to Tachometer
In this project we will make a tachometer using Arduino
(http://engineerexperiences.com/category/arduino). It is a device which is used to measure
the RPM (revolution per minutes) of rotating objects like a shafts or wheels etc. This project
differ from other projects present around web as it uses a Hall Effect sensor rather an IR
LED sensor which means it can be used in any prevailing ambient conditions.
Learn more
COMPONENTS
Hall Effect Sensor
Arduino Uno
Rotating Shaft (Who’s RPM to be measured)
Small magnet
Connecting wires
http://engineerexperiences.com/tachometer-using-arduino.html 1/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
NOTE: This tutorial makes use of the Timer Interrupts of Arduino Uno defined in previous
article to measure the RPM more precisely and accurately rather than other prevailing
methods present. If you are not familiar with this concept than check out that article first.
(http://engineerexperiences.com/arduino-uno-timer-and-interrupts.html)
SETUP
The setup for making this project is very simple.
(https://lh3.googleusercontent.com/Eza7BZ4NlWRStIJnaPVGNNh-
32Rp8jPnuZUIdnX5_TAeuRjsrwAjjf8LRxF5pSF5fnSx5ZaP6zxH-
woIFoTOF_BWzQDavChk9_zlzd9nTjxySfaYntsDHQ1xshXHahfdJrGo-
12fzW4G8EA8LUgEK5vHTHz1Fb0GxOvLGEV3KxUgwJCG4Tx6pjSDn4TVluSyN835AdB8
LWllB8S1lfuPOdLM5SqDvN_0k1ee7kp287tYR30H8R9775FWVg6W_lHC9d4kErx-
n1deWMhhPI5WiBD2dZgppT3rT1SElAR88GsXYUWCNoHePaIEDw7kpvhIeTVMsi9732hL
yoSNTaDFVVucpUeldEfkwG-keoxIBnfUQQ-ekVpyEFQ2-
rfgsAVQZwwZRubn1xX0ZMF1dzWVetsgibVpQjM2zMZe9mRozRxmdreYJua0qYEkTPQ6F
http://engineerexperiences.com/tachometer-using-arduino.html 2/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
ql7TgMIHbkx5YrRRXD5wGiowBOZF3OyjFk9qFox_s75y9CBTxxlAKv7Bshg2xZyGlYhohAV
grXhxuL6z-5NVB16dZmMGUOwc1VMH-
A9cmlkmSiqAkJNhuoVQzweJPRXcO63ZtONNyZHaZwrJ6taiBY3eghNXa4Kc6iLvCANwcH
myBr2ngd5i1fYwKAY=w1366-h417-no)
Code:
http://engineerexperiences.com/tachometer-using-arduino.html 3/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
void isr()
//Each rotation, this interrupt function is run twice, so take that into consideration
for
//calculating RPM
//Update count
counter++;
}
void setup()
{Serial.begin(9600);
counter = 0;
rpm = 0;
}
void loop()
{
delay(1000);//Update RPM every second
passedtime = millis();
counter = 0;
Serial.print("RPM=");
http://engineerexperiences.com/tachometer-using-arduino.html 4/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
UNDERSTANDING CODE
Most of the code is clear from the comments mentioned.
Interrups:
The code as mentioned above makes use of the Arduino Interrupts
(http://engineerexperiences.com/arduino-uno-timer-and-interrupts.html). Now as we know
the Interrupts execute a set of instruction when called no matter what the Arduino was doing
before. Here, Interrupts are called when the magnet passes through the detector.
Learn more
We use Interrupts here to count the number of times the Hall sensor detects the magnet.
Whenever there is a hike in Input pin the Interrupt routine (ISR function) named as “isr” is
called which increment the counter value and thus makes a count.
Use of Interrupts increases the accuracy of reading as Interrupt is called every time the
magnet passes and Uno counts it this is different from other methods in which the Arduino
has to wait for whole code to be finished before getting back to read the Sensor reading
again and if the code is large due some other reasons the reliability of the reading decreases
drastically.
The Interrupts in Arduino Uno are initiated or called on either using Falling, Rising or Logic
type. In our Program we have used the Rising type Interrupt initiator; Rising type calls the
Interrupt every time the detector pin detects a rise in input from LOW to HIGH.
If you are using an IR LED based sensor you can also use Falling type, in this case the
Interrupt will be called every time the detector pin detects a fall in the input i.e. from HIGH to
LOW.
http://engineerexperiences.com/tachometer-using-arduino.html 5/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
Another thing to note is the formula for the rpm calculation; it is based on simple math and
unitary method to calculate number of revolution made by the shaft-
Delay Function:
The delay(1000) is used in the code it determine after how much time the value to be
changed on your display, you can set it according to your needs.
The display device used in this tutorial is the Serial Monitor of the Arduino itself; instead of
this you can also use 16*2 LCD or LED shields to display the RPM values using the
respective libraries and hardware.
Calculations:
The value obtained from this project can further be used for measuring the speed of the
wheel/disc to which the shaft is connected using the relation-(3.14*D*N)/60 here, D is
diameter of the wheel/disc and N is the RPM. This relation will give the speed in m/s. This
speed further can be converted to Kmph or Mph.
The value obtained can also be used in positioning of some other components relative to
shaft or for feedback and control.
Feel Free to contact us, comment below and provide us with your feedback to improve our
services. Like our facebook page (https://www.facebook.com/EngineerExperiences) for more
posts.
Share this:
(http://engineerexperiences.com/tachometer-using-arduino.html?share=twitter&nb=1)
(http://engineerexperiences.com/tachometer-using-arduino.html?share=facebook&nb=1)
3
(http://engineerexperiences.com/tachometer-using-arduino.html?share=google-plus-1&nb=1)
http://engineerexperiences.com/tachometer-using-arduino.html 6/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
Arduino (http://engineerexperiences.com/tag/arduino)
Techometer (http://engineerexperiences.com/tag/techometer)
PASCHALIS
April 10, 2018 at 12:02 am (http://engineerexperiences.com/tachometer-using-arduino.html#comment-452)
http://engineerexperiences.com/tachometer-using-arduino.html 7/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
REPLY
SEARCH HERE
SEARCH
Custom Search
Email Address
SUBSCRIBE
RECENT POSTS
http://engineerexperiences.com/tachometer-using-arduino.html 8/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
Ad SENFENG Laser
Ad Chee mau
engineerexperiences.com
http://engineerexperiences.com/tachometer-using-arduino.html 9/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
TOP POSTS
http://engineerexperiences.com/tachometer-using-arduino.html 10/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
BLOG STATS
293,421 hits
Email Address
SUBSCRIBE
RECENT POSTS
http://engineerexperiences.com/tachometer-using-arduino.html 11/12
5/2/2018 Tachometer Using Arduino and Hall Effect Sensor | Engineer Experiences
(htt
ps://
ww
w.yo
utub
e.co
(htt m/c
p://f han
) A) es)
http://engineerexperiences.com/tachometer-using-arduino.html 12/12