×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

measuring frequency
2

measuring frequency

measuring frequency

(OP)
Hi! Do any of you know of any methods of measuring frequency besides using a digital counter? r there any ways of improving the quality of the measurement like using a multiplying pll to increase accuracy? Thanks...

RE: measuring frequency

look at it with an oscilloscope...

RE: measuring frequency

Is this for a product or just for your own use? A microcontroller could be used with an interrupt on zero cross and the time measured in between. There are a million ways to do this. To me, this would be the easiest.

RE: measuring frequency

(OP)
it's for my own use... i want to do some experimentation and i need to be able to quickly monitor frequency changes in the range of 10 -20 kHz. The microcontroller sounds like a good idea... i've never used one b4... how would i convert the period reading into a frequency reading? are there microcontrollers which are specific for frequency measurements?
thanks for the reply

RE: measuring frequency

Actually, many Digital Multimeters can read frequency in this range.  

A Fluke 87 is rated up to 200 kHz.  

Might be just the excuse you need to buy a new DMM.

RE: measuring frequency

Another thought - depending on the level of the signal you are trying to measure, a PC sound card and a program such as Spectrogram could probably do this as well.  

RE: measuring frequency

Simplest: divide the input frequency by 16,384 to generate
 an about 1-2 sec. pulse. Measure its lenght with the
microcomputer timer, then calculate.

<nbucska@pcperipherals.com>

RE: measuring frequency

Could someone please explain to me why using one of the most basic pieces of equipment is MORE difficult that creating an elaborate, unneccassary, and unreliable setup that is entirely way to complex?  Why would anybody chose debugging a whole microprocessor project when they can use a simple oscilloscope?  By the way, you will not get accurate results with the micro, you will alway just round off!

RE: measuring frequency

(OP)
I'm sorry melone, I will need to measure the frequency fluctuation at about 5 times a second... I don't know how u could do that with a scope... hope that clarifies things... sorry for being unclear...

RE: measuring frequency

Rent, Borrow, or ?? one of the newer high end O'scope and dump that information to a file.  On the really nice O'scopes you can choose how much and how often.

What could be simpler or more accurate?

RE: measuring frequency

(OP)
ok cool thanks...will try and get a hold of one...

RE: measuring frequency

If you measure the time to complete a half cycle, then you can double this time and invert it. Walla, frequency. I would use a microchip micro since I have the programmer, etc. There are many programmers on the web for PIC chips that can be built from scratch. I think a lot of people use the 16F84 chip with these programmers. Depending on the chip, many ports can be configured to cause an interrupt on rising or falling edge. You can also measure full cycle by not changing to say rising edge after a falling edge interrupt, this will give you the time to complete one cycle and this can simply be inverted to get the freq. Microchip has application notes to measure frequency with all the code, etc, already done. Visit www.microchip.com.
Good luck

RE: measuring frequency

(OP)
thanks buzzp!

RE: measuring frequency

One more note: The zero cross signal needs to be clean with very little slope so I use an RC network to generate a 'square' wave with much quicker rise/fall (compared to a 60Hz sin wave-probably still advisable with 20kHz) times to produce a more consistent zero cross. Good luck

RE: measuring frequency

Why doesn't anybody want to use a scope?

RE: measuring frequency

melone,

maybe with all the newer tech, people don't remember how to use them.

RE: measuring frequency

If a scope is not available or if it is desired to measure the frequency all the time then why dedicate an expensive piece of equipment to monitoring the frequency all the time when a much less expensive solution is adequate? Or perhaps, buzzly just wants to play.
A scope is the obvious choice for one time measurements provided you have one that will measure the frequency. If it does not have this function then how do you propose to measure the frequency in real time using an oscilloscope without other interfaces(communications, logging capability,etc.)?  And if these other interfaces were available to the scope then it would likely measure the frequency in real time.

A meter with frequency capability is a cheaper solution except you can not do anything with the information except display it. What if he wants to take an action when the freq falls out of a certain range? A micro has limitless possibilities in this area. Not only can you measure and display the information but you can take an action; energize a relay or SS device, communicate with a PC, call a telephone number, etc. Sure add-ons to meters allow communication, logging, etc, but you can not take an action without interfacing to some other device. Bottom line-buzzly knows what he needs to accomplish and if a scope is not an option then so be it.
Crowbar,
I am afraid with the newer technology, knowing how to use a scope is more important now than it ever has been.

RE: measuring frequency

BUZZP, check out the LeCroy LC584XL and let me know what you think.  You can get details statistics on different characteristic on a live waveform, and heck, you can even do jitter analysis.  This scope has an ethernet connection to allow for information to be transferred over a network.

I don't discourage anybody from playing around, but let's be realistic here.  Micro projects are notorously laborious and very sensitive to any changes (hardware OR software).  If you want to measure something, don't fool yourself and think that you will design something in your spare time that will outperform a dedicated piece of equipment that has proven time and again it's usefullness, and accuracy.

However, if you really want to do this with a micro, go with a high-sample rate, high-bit count A-D, and get yourself a fast micro.  You will want to run a fast micro so you have enough time to sample your data and actually process it real time.  Otherwise, you will be forced into acquiring and post-processing or you will need a DSP for real time processing capabilities.  (Wait a second, now is sounds like your building a o'scope).

Hopefully, you have determined a good method for connecting your micro project to your signal.  You will DEFINITELY need a scope to verify that your circuit doesn't load down your signal (resistively AND capacitively).  I would suggest a very high impeadance (~10Meg) dummy load, but the C might be tricky.  You will obviously want to keep it very low (in pF range) otherwise you can be modifying your signal and thus the resulting measurement will be useless.  If you are connecting to a clock output from another IC, you must be very sure that you don't load it down, otherwise you could cause your whole system to become unstable or crash.

Also, what programming languages do you know, C, Assembly, etc.?  Are you comfortable enough to learn one on your own?  Are you comfortable trying to debug your code?  What tools do you have available to debug (scope, logic analyzer, software, etc.)?

Why would you want to only check to see if the frequency has changed?  Don't you want to know what the signal looks like?  Just because your micro tells you that the signal is operating at 50KHz, don't you need to know if it is a 50KHz sinwave, squarewave or worse, something in between?  Isn't the duty cycly also important?  Are you looking for glitches?  If so, how short?

Once again, I applaud your desire to try something new, but I don't think that this project is as easy as it seems.  However, it would definetly be a very good learning experience!

Good luck and keep us posted!

RE: measuring frequency

melone,
You seem to be going to great lengths to prove that a scope is the best tool to use. Yet you don't know just what buzzly needs to measure - or why. Info that buzzly has not submitted is:
 
 What range of frequencies? Is waveform important? Is it a one-off measurement, or for continuous monitoring? What action is to be taken with the data? Are records to be kept?

Until this is known, the best instument to use cannot be decided.

RE: measuring frequency

melone,
You seem to be going to great lengths to prove that a scope is the best tool to use. Yet you don't know just what buzzly needs to measure - or why. Info that buzzly has not submitted is:
 
 What range of frequencies? What accuracy? Is waveform important? Is it a one-off measurement, or for continuous monitoring? What action is to be taken with the data? Are records to be kept?

Until this is known, the best instument to use cannot be decided.

RE: measuring frequency

Pebe you are right
Pebe you are right


It is a BIG mistake to solve an unknown problem !
It is a BIG mistake to solve an unknown problem !

<nbucska@pcperipherals.com>

RE: measuring frequency

PEBE and NBUCSKA you have both hit the nail on the head!  If we don't understand the problem, why would ANYONE suggest a solution that has SO MANY INHERENT FLAWS?  Why not err on the side of caution and suggest a solution that will work (regardless of the end users complexity, especially since it will probably change of the lifetime of his project), instead of trying to get fancy by making some pretty big assumptions?

You are right, I am going out of my way to prove that the scope is the best tool for the job, because the scope IS the tool for this job.  Not only will it give the most accurate results, it offers more functionality than is currently required.  My recommendation is based on what the user needs today, and what he is likely to need tomorrow (based on his VERY limited information).  Frequency by itself does not give you the whole story!  2 signals can have the exact same frequency, but that doesn't mean that both signals are the same.  Try putting a sawtooth waveform into a clock input that is designed for square waves.

RE: measuring frequency

I think it is about time that someone answers to the original question:

The best way to improve the accuracy is :
1.) Use more accurate reference frequency
2.) and more time to measure.

Digital counter's accuracy is unlimited, given
ideal reference and infinite time.

<nbucska@pcperipherals.com>

RE: measuring frequency

hi buzzly

there are so many chips that measure the frequency directly
and you don't need to setup a microprocessor based circuit to measure frequency

here i introduce the most widely use frequency to voltage converter of the world!!!
it's also very low cost

national semiconductor's LM2907/LM2917  Frequency to Voltage Converter

General Description:
The LM2907, LM2917 series are monolithic frequency to
voltage converters with a high gain op amp/comparator designed
to operate a relay, lamp, or other load when the input
frequency reaches or exceeds a selected rate. The tachometer
uses a charge pump technique and offers frequency
doubling for low ripple, full input protection in two versions
(LM2907-8, LM2917-8) and its output swings to ground for a
zero frequency input.



Advantages:

* Output swings to ground for zero frequency input
* Easy to use; VOUT = fIN * VCC * R1 * C1
* Only one RC network provides frequency doubling
* Zener regulator on chip allows accurate and stable frequency

Applications:

* Over/under speed sensing
* Frequency to voltage conversion (tachometer)
* Speedometers
* Breaker point dwell meters
* Hand-held tachometer
* Speed governors
* Cruise control
* Automotive door lock control
* Clutch control
* Horn control
* Touch or sound switches


and many other user defiend applications!!!!

like your application

if you need more go to www.national.com and download it's data sheet.



RE: measuring frequency

melone,
If someone wants to know how to crack a nut, it is better to ask how big the nut is before offering him a sledge hammer.

RE: measuring frequency

Or maybe, we should simply over up the solution that will just barely meet the requirements and offers a whole host of problems that require a varied set of troubleshooting skills to solve.  Perhaps we can use some of our wisdom to look past the original post, and try to figure out what this person NEEDS and not only what he/asked for.

RE: measuring frequency

Melone, How do you know the best tool for the job when you don't know what the job is?

RE: measuring frequency

You guys are right....I should have simply answered the question as it was stated.  I'm am sorry that considering an option that exceeds the stated requirements by allowing for future functionality is so unacceptable.

BTW, could someone PLEASE explain why the oscilloscope is so repulsive?  I don't think that anyone has offered a good explanation of why one of the most commonly used pieces of lab equipment is no longer acceptable to measure frequency.  Also, why do we think that we would NEVER actually want to look at the waveform?  Call me old-fashioned, but I kinda like to know what I'm dealing with.

RE: measuring frequency

  Keep it up guys, this is good fun!  I draw your attention to the fourth posting in this thread.  The fellow asked how to convert a period reading into a frequeny reading.  Enough said!

RE: measuring frequency

That is exactly my point.  This person doesn't know what he/she needs, and I was trying to offer up a solution that allows for future expansion without having to go through the trouble of major hardware / software debugging.

RE: measuring frequency

So we agree that no-one knows what exactly he wants to do and why. I simply gave another possible solution. Since the scope would be obvious and was already suggested, I didn't think it was necessary to repeat that suggestion. Measuring frequency with a micro is not that difficult (depends on experience level with micros, board layout, blah blah). I just don't appreciate the slams against my suggestions when it would be the BEST solution for some applications. The inherent flaws are minimal with micros if you know what your doing. And maybe this guy does not have several grand to shell out for a feature rich scope. Bottom line: no-one knows his application so no-one can say what is best so quit being so dang arrogant Melone!! Would you want to leave your multi-thousand dollar scope outside in a 3R box with temperatures down to 30 below or 130 above? Absolutely not! This is one example where a scope would not be the best choice. Also, a microcontroller circuit could be built for way under $50 to handle this application. If this needs to be done in more than one location at the same time, then a scope would not make sense unless the locations are such that a multi channel scope could be hooked to all at the same time. Obviously, there are many applications where a scope would be the worst choice and applications where the micro circuit would be the worst. I think you need to just relax and take a deep breath before you start going off and being so sarcastic, Melone.
Before I stoop to such a low level, this is my last post unless something meaningful is posted.

RE: measuring frequency

I guess we agree to disagree on this point, and I appreciate your explanation of your posistion.  I hope that you accept my apologies for the sarcasm.

However, let's examine why my suggestion make sense.  1) The user asked a vague question that suggests that they either don't know what they need, or they are looking for a unique solution.  When the micro solution was suggested, he/she admitted that they have never used a micro before.  Therefore, this person has probably never debugged a micro project before.

2)  Let's go on the assumption that this person doesn't know what they need and after some troubleshooting / debugging, they decide that they need additional functionality.  If it is easily added in software, then it doesn't cost anything except time.  Otherwise, it would require more hardware and additional software (troubleshooting and debugging).

3)  I have tried to be impartial and simply suggest a solution that will work for MOST situations.  Then when I tried to get someone to explain to me why the micro solution is better, people got defensive and would not consider other options.  I agree that in certain circumstances, the scope is the worst tool for the job.  However, you must admit, that for most circumstances, it is the best.  I took an educated guess at what the poster needed, and suggested a solution based on some assumptions.  If ANYONE would have given an answer other than, "a scope is not the only solution", I think this thread would have gone in a different direction.

Finally, I know that you, BUZZP, are probably pretty upset with this discussion, but I am very happy that there are people out there that are passionate about helping others!  People like you are what makes this site so great, and I hope that our disagreements don't disuade you from helping others with your knowledge.  I have read many of your posts and have always been impressed with your knowledge and understanding of technical matters.


RE: measuring frequency

Cool down Buzz,

  I've had this thread marked and have been watching it faithfully.  I can agree with the points all have you have made.  If the Genie in the bottle were to grant me ONE wish it would be to walk into HP (or your favourite manufacturer of the best equipment) with a blank cheque.

  On the other hand I'm quite competent to design and build equipment as good as or better than any of them could offer.  However, time is money, and that approach wouldn't be economically sound.

  What I ask you to take note of, is regardless of your approach, that you remember you're dealing with a neophyte here; someone who hasn't yet learned to convert a period measurement to a frequency measurement.  What good is either top-of-the-line or sophisticated homebuilt equipment to him?  This thread is great for those of us in a position to argue the virtues of one approach over the other, but keep it simple.

RE: measuring frequency

No shortage of solutions. Make a one-shot with a pulse width much less than the minimum period and pass the pulse through a low pass filter.  For your application, a 25 us one-shot should work.  Make the low pass filter corner (it can be a simple RC) somewhere around 1 kHz if that's fast enough for you.

RE: measuring frequency

Hi folks!
I just rummaged through this thread for the first time and it is highly interesting.
I am far from being initiated into electronics. Hence, please excuse me if I am being irrelevent. But I can't help but suggest the following:
Convert the alternaing signal to a pulse using possibly a diode and associated circuitry which I suppose should not be complicated. Input this to an electronic switch compatible with Personal Computer (after moderating the pulse voltage/current values and/or matching the output and input impedences respectively of the circuit giving out pulse to that of the electronic switch). The switch then sends zeros and ones to the PC. And a suitable free software can count the pulses and the associated time and calculate the frequency.
This way, you can plot the graph, monitor continuously and format the display to your liking.
And foremost, a PC is the most likely available instrument anywhere.
Hope I am not too much off the mark.
With utmost humility.
Happy NEW YEAR to all.
sunny123

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources