3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino-Based Optical Tachometer

Arduino-Based Optical Tachometer
«
  • Detail.jpg
  • Beakmans Motor.jpg
  • Workbench.jpg
Over ten years ago, I put up a web page with detailed instructions on building a simple electric motor based on one from the Beakman's World TV show. I called it the "Beakman's Electric Motor" page and over the years it has had hundreds of thousands, if not millions, of hits. Realizing that just building a motor, no matter how cool, wasn't a good science fair project, I added suggestions for using the motor as a science fair project, such as experimenting with different magnets, batteries, and coil constructions and seeing how they affect performance. In order to do this, the speed of the motor should be measured, but I left that as an open-ended question.

I've had dozens of e-mails over the years asking how to measure the speed and I've always suggested using a broken light beam and a counter, but I've never built one myself. I even suggested to one person that they use a slot-car lap counter since I'd seen on one sale at Toys 'R Us for 99 cents and she said that it worked perfectly, but not everyone can find a good deal like that.

It just so happened that I got one of these "how do I measure the motor speed?" e-mails on the same day my new Arduino Diecimila microcontroller board arrived from the Make Store, so I thought that would make a great weekend project.

Here is the result, an optical tachometer for Beakman's Electric Motor using an IR emitter/detector pair and a Arduino board. With a few modifications to the programming, you can use this tachometer for measuring other things such as fan or propeller speed. Notes are included on what to change for different applications.

How to have fun with Arduino is a good source of basics on how to setup and use the Arduino board.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Materials Needed

Materials Needed
«
  • Arduino Diecimila.jpg
  • Disconnected Circuit.jpg
  • Frame.jpg
  • Phototransistor Notes.jpg
Arduino Diecimila Board
Available from the Make Store or from several other online resources. Note however that the techniques of this Instructable could be adapted for other microcontrollers and circuits.

Computer with Arduino software and USB cable

IR LED and IR phototransistor
I used a Radio Shack #276-142, but that may be an old part number. Parts selection on this probably isn't too critical.

Visible light LED
I used a high-brightness red one that I had around. Actual selection not too critical.

10K Ohm resistor

220 Ohm resistor

Breadboard (semi-optional), hookup wires, clips

Opaque tape, such as black electrical tape

Framework for holding LED and detector
Use your imagination, I used KNex pieces to build a frame.

Beakman's Electric Motor (or something else to measure)
Original instructions for building the motor are here: Beakman's Motor
Similar plans are available from other places, such as this Instructable:
Simple Electric Motor
« Previous StepDownload PDFView All StepsNext Step »
31 comments
Apr 29, 2012. 7:04 PMdanielito.lajo says:
Hi, I wonder if I can use it in a diesel engine, I mean with all the noise and vibration over there... I want to visualize in a LCD display... thank you... great work
Apr 8, 2012. 5:16 AMyaly says:
can I use a magnet and a reed switch for example on a bike?
Jun 9, 2011. 11:46 AMkkrumm says:
Hello,
I have uploaded the code to my arduino and it works great, up to about 7500RPM then it starts sending random numbers and the occasional 0.
Have I run into a timing limit or what? I really need to read up to about 20,000RPM . I am using a signal generator sending a square wave to the board on the bench and the output goes wierd with a 250hz square wave inout from the sig gen. At 250hz the RPM indicates 7500rpm on the nose. Thanks for your assistance. Great program!!
Dec 14, 2011. 3:56 AMstringstretcher says:
If you read the fine print on the picture of Mims notebook, he says to use a large value resistor for higher sensitivity, and a smaller value for faster speeds. Maybe this helps?
Oct 10, 2011. 10:33 PMptorelli says:
Hi,

How did you validate that it is actually working properly? I found that if I spin it very slowly (<10 RPM), the interrupt is triggered like crazy, generating hundreds of falling edges per second. I notice you have no debouncer for lower frequencies.

Thanks,
Peter
Sep 14, 2011. 4:51 PMos_sanches says:
Hi, what your sugest to i´m use this sketch to measure rotations over 200.000rpm?
Apr 6, 2011. 2:28 PMeddy40 says:
please upload a proper program file.
Jun 4, 2008. 6:14 AMlalder says:
OMG is that the Forest Mimns Book in the back ground? I totally loved them, and learned a bunch from them!
Sep 1, 2010. 2:30 PMcraigbic says:
yes it is! I still have all of his "Engineer's Notebook" series he did for Radio Shack (back when they actually sold cool stuff for electronics hackers). The schematic and explanation of Phototransistors, as I recall (I'll have to dust off my collection) was from his fantastic reference book, Getting Started in Electronics which was also sold through Radio Shack. It's still available and I highly recommend it as well as any of his other electronics reference books to anyone interested in electronics at any skill level. They are terrific references and easy to follow.
May 30, 2010. 6:31 PMRANDOMFISHYFACE says:
 for me when i down load the program it comes up as a tmp file so could you post it replying to this comment

Feb 6, 2010. 1:31 AMLenny24 says:
Hello. Great Instrucrable; I need the kind of Script for an RC-Car Engine-RPM-Meter (OMG, Creepy Word ;))
And i Found out, That you can also Use a Reed Sensor for Measuring. Or an Hall-Sensor. I Tried out Both and  the Hall sensor worked best for me.
Nov 29, 2009. 6:51 AMwii552 says:
could this be done with a cds cell/photocell/LDR/photoresistor(all the same thing)
Dec 5, 2009. 12:53 PMzholy says:
I've tried that ... but it is too slow ... LDR + laser ... you could break the beam very fast, an Arduino would not noticed.
Sep 18, 2007. 10:28 AMEvilSpeeder says:
What would the upper rpm limit of something like this be?
Nov 24, 2009. 6:24 PMkikiclint says:
That would depend on how fast the arduino can run through its loop of code.  It also might depend on how fast the sensor can detect a change of light.
Jul 6, 2008. 7:34 PMzq76 says:
Besides the point, but another way to measure the rotor speed is to hook the two paper clips up to an oscilloscope and count the voltage spikes over a period of time.
Sep 18, 2007. 11:52 AMEvilSpeeder says:
I should have been more specific, I meant to ask about the tachometer. Thanks
Nov 24, 2009. 5:28 PMCairie says:
i added a Serial.println and the serial data is in very strange characters. ascii maybe? anyway, it's not in number form. do you have any suggestions on how to make it voltage change in integers? i want to bring it over to Pd and create some sounds.
thank you!
Nov 24, 2009. 6:22 PMkikiclint says:
You could use an op-amp as a comparator, so that the output would only be on, or off.  It is really simple.  By changing the voltage at the non inverting input voltage, you can change the sensitivity as well.  http://web.telia.com/~u85920178/begin/opamp00.htm gives an example of how to do this.  You might be able to leave off the negative voltage and have it still work.
Oct 6, 2009. 7:44 PMDBeta says:
Thanks for this. I know this is an old guide, but I just got an arduino and your code example worked perfectly for tapping into the digital tach output on an S2000(A Honda sports car built for racing). I actually didn't have to change it at all! The output of the car worked exactly like the photocell you used. I tested it up to 4,000 RPM, but no higher(just didn't test higher, not sure the limit). I'm working on attempting to get that info cleanly into the computer to be processed by python or the like, but that is just a mater of time.
Aug 19, 2009. 4:24 PMteddanbren says:
I need to be able to calculate angular acceleration (which will vary) for calculations after the is there a way to store each RPM reading into either a spreadsheet or .txt file so it can be analyzed in a graphing program?
Jun 9, 2009. 8:09 PMrobotkid249 says:
You don't need a resistor to the led, arudino has them built in.
Jun 21, 2009. 10:43 AMraykholo says:
its only for one pin (like pin 13) and only on some models other pins need a resistor so that if something shorts out in the circuit, some of the output voltage will still be burned off and the board wont fry, then again, each component has a different voltage rating, so resistors might be necesary
May 21, 2009. 2:23 PMsparkyhester says:
Great instructable. I tried this with a small 'flag' on the shaft of a motor that ran through the slot of an opto-transistor. The motor was running at about 1200RPM I think but the figures being produced by the arduino were in the region of 30000 to 50000. Any ideas why?
May 16, 2009. 4:06 AMadrenalynn says:
I concur with sscanf: This won't work as detailed in your "pretty picture" - you need to go back to your hand-drawn schematic on graph paper. As detailed in the first picture the transistor will never see the voltage it needs...
Jan 4, 2009. 7:59 PMsscanf says:
I just used this howto as a reference for a similar application using the same IR components and Arduino Diecimila. Everything worked great but note that there is an important difference between the circuit diagrams on this page for connecting the phototransistor. I found that the hand drawn connection shown on the graph paper worked but the other does not. Your mileage may vary.
Nov 5, 2008. 12:45 PMDavidRobertson says:
Cool
Sep 16, 2007. 5:20 PMos_sanches says:
Hi! Can I use this tach to see another rpm measures? the aplication run under windows xp? can you send me this aplication? tks

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
13
Followers
3
Author:CMPalmer