First of all, if you like this project, please vote for me in the Hurricane Laser Competition and the LED Contest!
Have you ever needed to find out how quickly something is oscillating? For things like hamster wheels and ocean waves, this is easy. You just count how many times the wheel goes around in a certain amount of time, then do some math, and you have the frequency. But what if you're dealing with something a little less tangible like audio waves or electronic signals? That's where digital electronics saves the day.
This Instructable will show you how to build a digital frequency counter capable of measuring events up to 250kHz and will attempt to explain some of the electronics theory behind it. The project costs about $30US, assuming you already have all the tools and equipment required.
This is actually my term project in a Digital Electronics course at the University of Oregon. It's intended as an addition to my term project from the winter term, which was a Function Generator I also posted to this site.
A frequency counter is a device that measures a periodic signal and determines its frequency in Hertz (Hz or s-1). But how does it do it? If you were trying to determine the frequency of a wheel manually, you might follow this operation:
1. Mark a spot on the wheel, then let it spin.
2. Start a timer.
3. Count how many times the spot on the wheel reaches the top.
4. Stop the timer.
5. Divide the number of rotations by the amount of time that passed while you were counting.
The result of the division would be the frequency of rotation of the wheel. This build actually follows the same steps, but it does all the operations automatically, repetitively, and it doesn't actually do any math. The math is built into the way the frequency counter counts.
This frequency counter actually follows these steps:
1. Generate a stable, known, reference time period.
2. Count the number of periods of the signal you're measuring.
3. At the end of the reference time period, display the number of counts and reset the count to zero.
These steps can be completed very quickly and repetitively using digital electronics methods. It's a very "dumb" process. The accuracy of the output frequency depends wholly on the accuracy of the reference time period and the speed of the counting chips. Using quartz crystal oscillators, we can generate reference periods with an error of about 20ppm, or 0.002%. Digital electronics can typically handle up to 30MHz signals, so this project is actually quite accurate.
The key to keeping any math out of the device is to make the reference periods base ten (decimal). Digital electronics is all base two (binary) so we need some chips that let us do some decimal conversion. What would be really nice is to just have a 1 second reference period. Then we could just count the number of pulses from the measurement in one second and display that and we'd automatically have Hz. That's actually what's going on.
But there are only three digits for display. How do we keep the display from rolling over? Let's say we have a frequency of 1,234Hz that we want to measure. If we counted for one second, the display would show 234 since it would roll over once. That's no good. But what if we only count for 1/10th of a second? Then we would get a count of 123 since 1234Hz * 0.1s = 123.4 (the .4 gets rounded, digital only deals in integers). If we KNOW we're only counting for a tenth of a second, we just multiply this count by 10 to get 1230Hz. This works for higher frequencies too. If you know the order of magnitude of the reference period, you can just do some easy 10^n multiplication and get a three-significant-digit result.