Author Options:

How can I apply a calculation to a frequency counter? Answered

I am trying to find a way to convert frequency (as in cycles per second (literal cycles of a wheel)) into speed. I've found schematics and code for a frequency counter, but I want to be able to display the actual speed in MPH in LEDs. The calculation is simple enough to do - I just need to know if there is a way that I could covert the output of a frequency counter to MPH by way of some calculation, and if so, how. 

essentially, I want to learn how to program, say, a PIC micro to read how often a reed switch is closed, then translate that into a readable speed on 7-segment leds.

where should I start? what kind of chip should I use? Where do I learn to code? I am pretty much lost

thanks for reading

3 Replies

orksecurity (author)2010-09-12

Start with the frequency counter and display program. You may be able to find sample code for this for a given PIC.

Add a multiplication by the appropriate scaling factor (circumference of the wheel) before updating the display.

Label appropriately. Done.

Select as Best AnswerUndo Best Answer

orksecurity (author)orksecurity2010-09-14

Another solution, of course, is to put a frequency divider circuit before the frequency counter. Fairly easy to do in the digital domain, if your input is a pulse per rotation...

Select as Best AnswerUndo Best Answer

framistan (author)2010-09-13

Figure out FIRST what is your main goal. is it to "build a MPH display" or is it "to learn to do coding." Try to think of SEVERAL methods of accomplishing the goal. There are always more than ONE way to accomplish a task. Then pick one method. If the ONE method is very difficult, then break it down into many small tasks that can be accomplished easily. Work on it until you achieve the MAIN goal. This is how the NASA achieved going to the MOON. It was a very difficult task... they broke it down into many small tasks. Mission accomplished! ... and "failure is not an option."

Select as Best AnswerUndo Best Answer