Measure RPM - Optical Tachometer

Introduction: Measure RPM - Optical Tachometer

About: Greetings ! I'm Tanay, a hobbyist interested in making robots and sharing stuff. I hope that my instructables help you in solving your problems Happy Tinkering ! Note : Sorry for the inconvenience but I won...
More About electro18 »

This Instructable will show you how to make a Portable Digital Optical Tachometer using an Arduino Uno.

Instead of a slotted sensor , it has a reflection based sensor. So :

1. You don't have to worry about the thickness of the rotor

2. The number of blades won't change your readings

3. It can also read the RPM of drum style rotors which slotted sensor can't

What is a tachometer ?

A tachometer is a device used to measure the RPM or Revolutions Per Minute of any rotating body. Tachometers can be contact based or non-contact ones. The non-contact or contact-less optical tachometers usually use laser or Infrared beam to monitor the rotation of any body. This is done by calculating time taken for one rotation.

Step 9: Testing and Troubleshooting

1. Take a DC fan and stick a white tape to one of it's blades. Place the sensor 2~7 cm from the blades

2. The readings will appear on the LCD

3. If the sensor gets no readings for 5 sec then it will automatically display the idle screen

4. The Idle screen will display the maximum RPM reached in that particular run.

TROUBLESHOOTING :

1. If the status LED is not blinking, try to adjust the potentiometer until the sensor is able to get readings

2. Ambient light may sometimes interfere with the sensor. Decreasing the sensitivity would eliminate the chance of getting false readings.

3. Check the polarity of the photodiode properly.

4. If everything fails , check your sensor manually by using :

Serial.println( digitalRead(2) ) ;

if your sensor doesn't show " 1 " when any object is placed in front of it then try increasing the value of 33k resistor.

Step 10: Conclusion

Though there are many optical tachometers available in the market, this device is comparatively cheap and works quite well. I've tested it above 20000 RPM and it works every time ! Being open source and programmable , there arise infinite possibilities of customizing this project.

I have built one of these tachometers and it appears to be working, however at a speed measurement of around 1000 rpm the readings fluctuate/jump between 3 or four different readings. This seems to be an error because the disc that I am measuring has high inertia and cannot change speed rapidly.

I was very interested in this project, but I have a problem downloading the "arduino1.6.12" program! I can not download from the Internet to a computer, which is on both my PC and my laptop. Could you send this progtam to my email so I can do this tachometer? If necessary, save it to a server where I can download this program. To be able to program the electronics bord for the tachometer. My Email Rapco@post.cz

239 Comments

I must have missed something because I am baffled by something that you stated in step 8 - Explanation and calculation where you stated the following:

"This line attaches an interrupt to pin 2 on arduino in "RISING" mode. This means that whenever the sensor goes from LOW to HIGH , the function RPMCount(); is invoked.

This means that in one revolution , the function will be called twice ( REV++ ). Therefore actualREV = REV/ 2"

What confuses me is why there would be TWO rising edge interrupts for each revolution, if there is only one reflective area on the unit being measured. As the IR Led emitter hits the leading edge of the reflective surface, it will cause the IR Photo Diode detector to become activated and cause the voltage to rise to slightly less than the VCC voltage, which in turn will trigger the interrupt of Int0 to fire and invole the RPMCount ISR as the RISING edge is detected. That voltage level will remain at the active level until the IR LED emitter is no longer over the reflective surface and exciting the IR Photo Diode and the signal level will FALL to 0 but because the Int0 interrupt only reacts to the RISING edge, the RPMCount ISR will NOT be invoked. It would seem to me that the RMPCount would only be invoked two times per revolution if the Interrupt mode was set to activate on the condition of "Logic Change"

Thus i believe that your RPM value is off by a factor of 2, because you divide the time in half to account for the "2 interrupts" that are not actually 2, but are rather only one.

one thing i realized is that the rev/2 probably originated from measuring a 2 blade rotor. the only reason I can make this assumption is because my IR sensor is tripping the interrupt twice for each blade. for IR depending on the sensitivity set on your photodiode, reflective materials can be almost any surface. Much like how you can change the channel on your TV even when aiming at the wall in the other direction. Just remember to take into account the number of blades if your RPMs way higher than usual (like by a factor of 2 lol)

ps - Also, you guys rock! I couldn't have finished this without you guys.

Hello, absolutely correct! I kept wondering why he assumed it counts twice. and therefore he needs to divide by two. The only case would have been that he uses CHANGE rather than RISING or FALLING.

I am trying to do the same for a motor with encoder and optocoupler, it seems that the optocoupler does mis count on low speeds! it basically counts more than once (interrupt is called 2~3 times) while the rotor blade is just leaving the optocoupler IR Led and receiver (i.e while going out)!

Yet to try to figure this out! I already have a debounce for ~20 milliseconds and using a 65ohm resistor for the IR LED.

I agree dividing by two put reading off by a factor of 2. There will still be some error because we can assume the first time it interrupts was not a full revolution and should be subtracted off but the time would need to be updated to account for this offset as well and millis() can't be called within RMPcount because it is an interrupt itself.

Thanks for the feedback. Having been a professional software developer for 35+ year and an electronics engineer for 10+ years before that it just didn't add up. As for subtracting 1 from the count, it might just be better to set the inital count to -1 and then the first interrupt will set the counter to zero and then all calculations will be based upon all complete revolutions, irrespective to how much of the first revolution was completed when the interrupt occurred.

1. When the rotor will complete one revolution, it will trigger the interrupt twice i.e. first while leaving the sensor and second while returning back to the initial point after one complete revolution. This will invoke the function twice.

2. I've used one of the I/O pins as the GND pin because I needed the sensor to be as compact as possible. Using three pins in a row is pretty convenient. You could attach the sensor GND to the Arduino GND as well, that will work just fine.

"When the rotor will complete one revolution, it will trigger the interrupt twice i.e. first while leaving the sensor and second while returning back to the initial point after one complete revolution. This will invoke the function twice."

I agree, that It will trigger the interrupt twice, but one of them will change the signal from low to high, another time - from high to low.

You are using RISING => the counter should increase once per revolution.

I am trying to make this project with some slight modifications, more of a stroboscope. Instead of having a sensor to record the readings, the LED would blink and change blink speeds with an encoder. I'm looking to avoid the delay command, so I'm going off of the BlinkWithoutDelay example and I am having some trouble. Any help is appreciated. Here is my code:

Thanks for this great project, although there was a lot of time passed for this project to comment, but I think it is easier to use I2C connection instead of shift register to minimize connections (to I2C LCD) and components?