digital frequency meter with lcd display free sample

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:

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.

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.

If you"ve ever worked with electronics before, it"s likely you"ll already know the functions of many of the parts required, so I"ll just go over the more complicated bits.

Inverters are digital logic gates that convert a "True" condition to a "False" condition. For TTL, +5V is generally "True" or HIGH, and 0V is "False" or LOW. An inverter simply negates the truth of its input.

NOR gates are OR gates with an inverted output. An OR gate adds two bits together, A + B = Q. It adds in the logical NON-ALGEBRAIC sense, as in 1 + 1 = 1. If A is true OR B is true, then at least one of them is true.

Counters do exactly what you think they do. When you input a series of pulses to a counter input, the outputs reflect the number of pulses the input has received. All digital counters count in binary, but they can have different limits for their maximum count. A standard 4bit counter counts from 0 to 15 (0000 to 1111 in binary). A BCD (Binary Coded Decimal) counter is intended for math involving decimal (base ten), so they only count from 0 to 9 (0000 to 1001). This obviously wastes bit capacity, but it makes certain things easier. Inputting a constant frequency into a counter results in the division of the frequency. A one-bit counter will divide the input frequency by 2. A 4 bit counter can divide the input frequency by 16. A BCD counter divides the input frequency by 10.

These are used to select between up to 8 input lines. A thee bit address is fed to the multiplexer, which selects the desired input. Then whatever signal is on the selected input appears at the output. They are the digital equivalent of an 8 position rotary switch.

These are almost infinitely useful in digital electronics. In fact, many components can be decomposed into a combination of D-Flip Flops. They are, in essence, a one bit counter. An input is given on D and the FF does nothing until a clock pulse is given, then the FF places the input value on the output Q. That"s it. They are used as a one bit memory for this reason. 1. Input bit to be stored, 2. command storage, 3. stored bit appears on output until overwritten. The two FFs in this project are used as a sort of "shift register", which propagates a single command bit along a line of D-FFs.

This chip converts a binary coded decimal address (from the counters) into a pattern that correctly lights up a 7-segment decimal display. It takes a TON of logic gates to do this, so having it all on one chip is really nice. These also come equipped with several neat features such as a BLINK pin and a LATCH pin. Blink shuts off the outputs when the blink pin is held low. This is used to very quickly turn the displays on and off at low duty cycle to conserve power (they draw about .6A at continuous on, and get quite hot). Latch is used to capture the counts of the BCD counters and hold that number until the next latch command. This is so we only see the final count instead of 0,1,2,3,4...final count,0,1,2... etc.

This is what enables the frequency counter to get an accurate measurement. We have to compare the thing we"re measuring to SOMETHING. Crystal oscillators are highly precise, with typical frequency errors of 20-40 ppm. That means this crystal would lose about 15 minutes after 1 year of operation. They"re not perfect, but for this project, they"re actually kind of overkill. But they"re also cheap, cheap, cheap. They operate on the piezoelectric effect. When they receive a voltage, they physically expand very slightly (on the order of nanometers). Then when they contract due to their own elasticity, they generate a new voltage. Since the expansion oscillation is 90 degrees out of phase with the voltage oscillation, we can use it in combination with some capacitors to get an oscillation that is 180 degrees out of phase with the driving voltage. When this condition is met, positive feedback ensues and we get a stable oscillation. The crystal"s shape and mass ensures that it oscillates at exactly 100kHz. Manufacturers make crystals in thousands of different frequencies, 100kHz is just convenient for this project.

Once you get your parts, you should probably play with them. If you don"t have a breadboard, you should definitely invest in one. Digital components are robust, it"s actually pretty hard to fry them in my experience, especially these simpler chips. The one thing you should NEVER do is connect two outputs together. You don"t want one chip trying to hold it"s output HIGH while the other is trying to hold it"s output LOW. Not only is this bad for the chips, it"s logically abhorrent! You can connect all the inputs you want together, but never, ever put two outputs on the same line unless the chips have what"s called a Three-State Output. But none of these chips have that, so just don"t do it. Anything else is pretty much ok.

Plug your chips into power and see what they do when you give them different inputs. Test the truth table for the inverters and NOR gates. Try measuring the count after manually giving a counter a clock signal. Make sure the multiplexer works as described. You"ll learn way more from playing with these components than you ever will by reading about them. If you have access to an oscilloscope and function generator, you will have a MUCH easier time examining your chips.

The positioning of your chips and other components is an important detail. Finding a layout that has a good functional flow and also minimizes connection length can be tricky. The layout I used is attached below in PDF form, but feel free to choose your own. I ended up with a protoboard that was 7.5x11cm that perfectly held all of my components.

This is easily the most tedious step. One of the nicest things about digital electronics is that almost no calculations are required. Each chip performs a specific task and is designed to work with just about all other types of digital electronics. However, the number of connections is muchhigher than most of the analog projects you"ll encounter.

To make all the other connections, I recommend using wire wrapping techniques. Wire wrapping tools and wire are available at Radio Shack. Follow the images to get an idea of what to do. The basic idea is that we"d like to be able to make all these tiny little connections consistently and cleanly, without the use of solder. Soldering has several problems. First, you only want to apply soldering heat to sensitive ICs if it"s absolutely necessary. Second, for ICs soldering is pretty much permanent. Have you ever tried to desolder an IC? You don"t want to have to do that. When all the connections are made and the thing works, then you get to solder your ICs.

Like I said, this step is highly tedious. Just keep at it. Play some music. Eventually you"ll have so many wires that the back of the board almost feels furry. Don"t forget to install the 2x20 pin block that will allow you to connect the ribbon cable to the mainboard. Make sure you know which pins are which, and number them on the mainboard so they sync up with the 7 segment displays. You don"t want to wire everything up and realize you forgot to mirror the numbering on the backside...

Take the length of 40 connector ribbon cable and find a way to strip all the wires evenly. I did this by scoring both sides with a utility knife, then firmly pulling on this score mark with a flat head screw driver. With enough work, the insulator should begin to come away from the rest of the cable, leaving 40 evenly spaced, exposed wires. You need to feed these wires into a 3 x 7.5cm chunk of protoboard. To do this I had to twist all the little wires by hand, then tin them with solder to make them solid. Since the ribbon cable"s wires are spaced by 0.05 inch, and the protoboard is spaced every 0.10 inch, you"ll have to systematically place every other wire in one row of holes, with the other wires in the next row of holes. Doing this for 40 wires all at once is a little tricky, but it can be done. Solder them in place as soon as you can. You don"t want to lose all that work.

Place the 3-digit and 1-digit 7 segment displays into the little chunk of protoboard. I left 5 holes between the large and small displays. Later I"ll be putting a label in this space indicating that the small digit is an order of magnitude multiplier.

Use wire wrap to connect the displays to the ribbon cable. I decided to call the red wire on the ribbon "1", and number upward after that, with each number corresponding to the pin number of the large display. The large display has 28 pins, so the 29th wire connects to pin 1 of the small display. The small display has 10 pins, so the total number of wires required is 38. I chose to ignore the fact that there are redundant pins and unused decimal point pins at this stage. I just wanted the ribbon cable to be systematic and easy to connect.

So, you"re done making all your connections? Ha. I doubt it. A nice thing about digital electronics is that it doesn"t really matter. Connect it to power!

In all likelihood you will at least have a few numbers displaying zero correctly. Use the working numbers to find and fix your errors in the other numbers.

Now it"s time to hook up the signal input to some sort of function generator. You should have some way of telling if the frequency counter is doing its job well. Ironically, you"ll need a frequency counter for that. If you don"t have access to a function generator that displays frequency, then you"ll need to find some other way to determine the accuracy of your frequency counter. You may be able to use your computer to generate a known frequency, for example.

When I tested the accuracy of my counter with a laboratory function generator, I found that all the measurements were more or less spot on. The frequency counter worked exactly as I expected. Except for the the highest order of magnitude. I found that, when measuring frequencies higher than about 100kHz, the count is too low by 10% or so. The reason for this has to do with the use of a 100kHz crystal as the reference signal. There is a shift register in the frequency counter that performs two operations, one right after the other. This is done to prevent the counters from being erased before the counts can be latched to the 7-segment display encoders. However, it causes a very slight delay on the order of two clock pulses. When measuring high frequencies, this delay becomes significant, while low frequencies are still measured quite accurately.

The whole point of this project for me was to install the frequency counter into the function generator I made, so that I"d have an actual function generator of reasonable quality that I could use for my electronics projects. That meant finding room inside the already packed ATX power supply case I had used. I had to push wires out of the way, make sure nothing would short, and fit the frequency counter board into the cavity above the function generator"s board. Then I had to tap into the +12v and ground lines to power the frequency counter"s 5v regulator. Then I connected the high impedance signal output of the function generator to the signal input of the frequency counter. When this was tested, it worked just fine.

Then I had to cut into the ATX power supply case with a Dremel tool to make rectangular openings for the LED display. This was pretty tricky, and quite messy. If you"re doing the same thing, I highly recommend cutting this hole before painting and installing knobs and buttons into the casing.

I also needed to drill holes for the screws that would hold the display in place, as well as holes for the two momentary buttons that control order of magnitude and latch override.

when i had started the build it was the most complicated thing i had tried. After a few weeks of trouble shooting I got it to work as it should (two bad solder joints were a bit of work to find. Also i had to drop my supply voltage because the latch was being sparatic and erratic counter readings. ended up with supply voltage of 3.5volts). Built the board with solid core welding wire(use what you have lol.)

I"m trying to design a frequency counter that measures beats. I have a band pass filter that will pass the frequencies of two musical notes. When not equal, they will pulsate. The signal will fluctuate between almost quiet to audible. Can this be counted by your device? I imagine a device that has a sort if squelch control that the user turns until the count looks probable. Is your counter"s sensitivity adjustable like that?0

please help me :( i need frequency counter circuit. it is my final project in signal spectra subject. frequency counter w/o using PIC :( please help me0

would it be possible to modify this to measure a low frequency (50Hz) accurately? I am guessing any rounding errors would be more of a problem? Thank you

This counter can really only handle a single frequency. There may be a way to measure a string of short pulses from a mic, but if you"re trying to separate out individual frequencies then you"ll need something much more complicated than this build.

What this counter would do on its own when given a microphone input is count half the number of times the audio wave crossed over zero. There wouldn"t be a way to determine which frequency components were contributing to the final count.0

Can you suggest me a circuit that can measure frequency of sound produced in real world environment? like human voice, tuning fork etc?Is it difficult to do? I have come across many such circuits but none of them specify if it will work with real world sounds.0

This build might be able to handle a tuning fork input because it is a single frequency. But a human voice is composed of many frequencies mixed together with different amplitudes for each. In order to decompose these frequencies you will need a circuit that performs a Fourier analysis. Fourier analysis is a pretty complicated thing for a homebuilt circuit to do accurately. It"s probably best to use a computer running Fast Fourier Transform software. That would tell you exactly how much of each frequency was included in your sound wave.

If all you want is to find the lowest frequency component (the fundamental frequency) of a human voice, then you might be able to get away with placing a low-pass filter on the front end of this circuit. Or even better, if you can find a very low bandwidth band-pass circuit whose center frequency can be adjusted, you could sweep the center frequency back and forth until you selected out a single frequency of the human voice. The output of the band-pass would be fed to the counter. But band pass filters aren"t perfect, they just lower the amplitude of frequencies outside their set range, and those low amplitude waves could still affect the counter.

Ok final idea: You could make a circuit that contains several band pass filters with different ranges, say one that passes 10-100Hz, 100-500Hz, 500-1kHz, 1kHz-5kHz, etc, etc. Then you would need a circuit on each output that determined the amplitude of the waves. Like an op-amp going to a diode-capacitor-resistor circuit that fed into an analog to digital converter which converted the voltage to a pattern that lights up an LED bar or something. With this circuit you"d be able to tell roughly which frequencies were in a sound wave, but it wouldn"t be very accurate.0

Thanks for the input. I didnt know human voice were this complicated....anyway I"m planning to do a frequency meter ( in Hz ) using PIC and LCD to output for college project. About tuning fork......can i use mic to input tuning fork sound and measure the frequency? Also i guess it can be used for setting frequency of musical intruments right?0

Yes, you could use a tuning fork and mic to measure the tuning fork"s frequency with this circuit, but you would need a pre-amp for the microphone. There should be plenty of simple circuits for that online. I haven"t worked much with audio amplification.

Setting the frequency of musical instruments will have the same issues as the human voice. The reason instruments sound different is because each one contains it"s own distinct combination of frequencies other than the fundamental you hear. When a piano plays an A, the majority frequency is 440Hz. But there are actually many overtones in the note you can"t quite hear with your ear. Those overtone frequencies are what makes the piano sound different from a trumpet or guitar. Those frequencies are what would make it difficult to use this counter to measure audio frequencies. A tuning fork might be ok, but that"s only because tuning forks have essentially no overtones. They are pretty much the purest sound you can get. Another instrument you might be able to measure is a flute. Flutes and tuning forks both have almost no overtones.

If you"re using a PIC or other micro controller, you may be able to program it to do a fast fourier transform of an incoming wave. That"s beyond what I"m able to help with, but maybe there is an instruct able about it.0

It"s me again. I need your suggestion.The digital frequency meter in this instructable is able to measure upto 250 kHz.Do you know how to increase the measuring range, like in the Mhz range? I"m doing a similar project using 8051 and according to it"s specs, it can measure upto 12 Mhz, but the circuit I have can do only upto 250 kHz. Do you know how I can modify the circuit to increase the measurement range?0

The frequency for this device isn"t determined by the digital electronics I used. Digital chips usually work up to at least several MHz. You can look up the data sheets for each chip and see for yourself. 10-30MHz is pretty standard for all of these. I think (and I stress THINK) that the frequency is being limited by stray impedance in the circuit. Each wire, solder joint, IC connection, etc, acts as a very small combination of a capacitor and inductor (often called impedance, for both in general). Stray impedance is death for high frequencies. When you add up all those small impedances, the incoming signal ends up being garbled. The stray impedance of this circuit is probably huge because of the wire wrapping method.

I think the best way to improve frequency response for this circuit is to order a nice, professionally etched PCB. PCB"s keep all connections in the same plane, use small wires, minimal connection length, etc, and that really does wonders for minimizing stray impedance.0

digital frequency meter with lcd display free sample

In this article we are going to construct a digital frequency meter using Arduino whose readings will be showcased on a 16x2 LCD display and will have a measuring range from 35 Hz to 1MHz.

At that point we would have realized that an oscilloscope is such a useful tool for measuring frequency. But, we all know that an oscilloscope is an expensive tool not all hobbyists can afford one and oscilloscope might be an overkill tool for beginners.

To overcome the issue of measuring frequency, hobbyist don’t need an expensive oscilloscope, we just need a frequency meter which can measure frequency with reasonable accuracy.

In this article we are going to make a frequency meter, which is simple to construct and beginner friendly, even noob in Arduino can accomplish with ease.

It means the number of times the amplitude of “something” goes up and down in ONE second. For example frequency of AC power at our residence: The amplitude of “voltage” (‘something’ is replaced by ‘voltage’) goes up (+) and down (-) in one second, which is 50 times in most countries.

“Time period” is also a term used while dealing with frequency. The time period is the time taken to complete “one cycle”. It is also the inverse value of frequency. For example 50 Hz has 20 ms time period.

The time period from arduino is obtained in microseconds. The arduino don’t sample the input frequency for entire second, but it predict the frequency accurately by analysing just one cycle’s time period.

The circuit consists of arduino which is the brain of the project, 16x2 LCD display, IC 7404 inverter and one potentiometer for adjusting contrast of LCD display.

The above diagram is self-explanatory, the wiring connection between arduino and display is standard and we can find similar connections on other arduino and LCD based projects.

Once you successfully constructed the project, it is necessary to check whether everything is working fine. We have to use a known frequency to confirm the readings. To accomplish this we are using arduino’s inbuilt PWM functionality which has frequency of 490Hz.

In the program pin #9 is enabled to give 490Hz at 50% duty cycle, the user can grab the input wire of the frequency meter and insert in pin #9 of arduino as shown in figure, we can see 490 Hz on the LCD display (with some tolerance), if the mentioned procedure was successful, you frequency meter is ready to serve you experiments.

digital frequency meter with lcd display free sample

The block diagram of the Frequency counter using Arduino is shown in the above figure. The circuit is simple, an LCD is interfaced with Arduino to display the measured frequency of the signal. The frequency generator circuit using 555 to generate the pules. The aim of the project is to design a simple digital frequency counter circuit using Arduino UNO and 555 Timer IC. The working of the project is very simple and is explained here. As mentioned earlier, the 555 Timer IC is configured to operate in Astable mode. Hence, the output of the 555 Timer IC (or rather the signal generator circuit) is a pulse with variable frequency (varied using potentiometer). This pulse is given as input signal to the Arduino UNO at one of its digital I/O pins. In the Arduino, we make use of a function called ?pulse In ();? The function pulse In can be used to read either LOW or HIGH pulse on a digital I/O pin and returns the length of the pulse in microseconds. For example, if the pulse In function is used to read a HIGH pulse on a pin, it waits for the pin to go HIGH. Once the pin goes HIGH, it starts the timer and runs until the pin goes LOW. The duration (in microseconds) of this HIGH pulse is then returned. In our project, we are calculating the duration of the HIGH pulse and LOW pulse and by adding them together, we get the period of the input signal. The inverse of this value gives the frequency of the signal which is displayed on the LCD. Frequency Meter can measure frequencies up to 20 KH.

digital frequency meter with lcd display free sample

A wide variety of digital panel frequency meter options are available to you, You can also choose from provided, digital panel frequency meter,As well as from new, {2}, and {3}. And whether digital panel frequency meter is easy to operate, {2}, or {3}.

digital frequency meter with lcd display free sample

Frequency Counter, as the name indicates, is an electronic device or component, which is used to measure the frequency of a signal. In case of a repetitive electronic signal, a frequency counter measures the number of pulses in that signal.

We generally use an oscilloscope to depict the signal, calculate the time period of the signal and finally convert it to calculate the frequency of the signal. But, oscilloscopes are very expensive and everyone cannot afford it.

Arduino UNO: The ATmega 328P microcontroller based Arduino UNO is the main part of the project. It captures the time period of the incoming signal and calculates the frequency of the signal.

16 X 2 LCD: The 16×2 LCD module is used to display the key information like welcome (or any custom) messages and the calculated frequency of the signal.

The design of the Frequency Counter using Arduino UNO can be divided in to two parts: The Arduino part, where the processing of the signal’s information takes place and the Signal Generator part, where the signal whose frequency to be measured is generated.

Arduino part of the project consists of Arduino UNO board and a 16 X 2 LCD Display. Pins 1 and 2 of the LCD (Vss and Vdd) are connected to ground and 5V supply respectively. Pin 3 (Vee), which is used to adjust the contrast of the display, is connected a Potentiometer.

Pins 11 to 14 (D4 to D7) i.e. the data pins of the LCD are connected to the digital I/O pins 4 to 7 of Arduino. Pins 15 and 16 of the LCD are supply pins of the backlight LEDs and are connected to ground and 5V (Pin 16 to 5V through a 1KΩ resistor) respectively.

A 100nF capacitor is connected between pin 6 and ground. By selecting this resistor, the frequency of the output signal, which can be taken from Pin 3 (Output), will be in the range of 480 Hz to 48 KHz.

The aim of the project is to design a simple digital frequency counter circuit using Arduino UNO and 555 Timer IC. The working of the project is very simple and is explained here.

As mentioned earlier, the 555 Timer IC is configured to operate in Astable mode. Hence, the output of the 555 Timer IC (or rather the signal generator circuit) is a pulse with variable frequency (varied using potentiometer). This pulse is given as input signal to the Arduino UNO at one of its digital I/O pins.

In the Arduino, we make use of a function called “pulseIn ();” The function pulseIn can be used to read either LOW or HIGH pulse on a digital I/O pin and returns the length of the pulse in microseconds.

In our project, we are calculating the duration of the HIGH pulse and LOW pulse and by adding them together, we get the period of the input signal. Inverse of this value gives the frequency of the signal which is displayed on the LCD.

A simple frequency counter, using simple components is designed that can be used to measure the frequency of a pulse without the need of an oscilloscope.

digital frequency meter with lcd display free sample

An electric signal can be represented as a sinusoidal waveform, where each wave has a positive edge and a negative edge. The basic parameters for measuring the strength of the wave is amplitude and frequency, where the amplitude is the maximum vibration taken from an equilibrium position of a sinusoidal wave and frequency is the reciprocal of the time period. Frequency can be measured using different types of frequency meters like deflection type which can measure frequency in the range of lower frequencies to 900Hz, Weston frequency meter which is usually not deflection type, it can measure frequency in the range 10 to 100Hz, and the advance frequency meter named digital frequency meter, which can measure the approximate value of frequency inbinary digit form up to 3 decimals and displays on the counter. The advantage of these kinds of frequency meter is that they can measure the lower value of frequency.

Definition: A digital frequency meter is an electronic instrument that can measure even the smaller value of frequency up to 3 decimals of a sinusoidal wave and displays it on the counter display. It counts the frequency periodically and can measure in the range of frequencies between 104 to 109 hertz. The entire concept is based on the conversion of sinusoidal voltage into continuous pulses ( 01, 1.0, 10 seconds) along a single direction.

Schmitt Trigger: The main purpose of the Schmitt trigger is to convert the analog signal into a digital signal in a pulse train form. It is also known as ADC and basically acts as a comparator circuit.

Time-Based Selector: Depending on reference the time period of signals can be varied. It consists of a clock oscillator which gives an accurate value. The clock oscillator output is given as input to Schmitt trigger which converts sinusoidal wave into a series of a square wave of the same frequency. These continuous pulses are sent to frequency divider decade which is in series that are connected one after the another, where each divider decade consists of a counter decade and the frequency is divided by 10. Each decade frequency divider provides respective output using a selector switch.

When an unknown frequency signal is applied to the meter it passes on to amplifier which amplifies the weak signal. Now the amplified signal is now applied to Schmitt trigger which can convert input sinusoidal signal into a square wave. The oscillator also generates sinusoidal waves at periodic intervals of time, which is fed to Schmitt trigger. This trigger converts sin wave into a square wave, which is in the form of continuous pulses, where one pulse is equal to one positive and one negative value of a single signal cycle.

The first pulse which is generated is given as input to the gate control flip flop turning ON AND gate. The output from this AND gate count decimal value. Similarly, when the second pulse arrives, it disconnects AND gate, and when the third pulse arrives the AND gate turns ON and the corresponding continuous pulses for a precise time interval which is the decimal value is displayed on the counter display.

The main purpose of Schmitt’s trigger is to convert an analog signal into digital signals in a pulse rating form. It is also known as ADC and it acts as a comparator circuit.

A frequency meter is used to measure the value of the frequency of a periodic signal. There are different types of frequency meters to measure frequency like Deflection type, Weston frequency meter, digital frequency meter. This article gives an overview of digital frequency meter which can measure smaller values of frequency in the range of 104 to 109 hertz. Every component of digital frequency meter has its own function, where the entire concept is based on converting the sinusoidal signal into a square wave and the AND gate turning ON and OFF based on the arrived signal at its input, which is used to determine the unknown value of frequency. The main advantage of this is it can measure smaller values of frequency.

digital frequency meter with lcd display free sample

This project is a simple frequency meter capable of measuring frequencies up to 100MHz with an accuracy of 0.002%. Based on an ATtiny414, it demonstrates the use of Timer/Counter TCD0 and the Event System:

I recently wanted to design a frequency meter that would measure up to 100MHz, so you can use it to test processor clocks and crystals. There are many designs for microcontroller-based frequency meters on the web; after all, it"s one of the applications that the timer/counters in most microcontrollers are designed for. However, most of them don"t go as high as 100MHz because the microcontroller"s own clock usually imposes an upper limit of half the clock frequency.

My plan was to use the Real-Time Clock peripheral, clocked by a 32.768kHz crystal, to generate a 1Hz interrupt. A second timer/counter, clocked by the frequency being measured, would then count the number of cycles in this one-second interval. The result would simply be the frequency, in Hz.

For my first prototype I used Timer/Counter TCB0 clocked from an input pin, with the capture triggered by the 1Hz from the Real-Time Clock peripheral. I confirmed that I could only measure up to half the clock frequency, or 10MHz, so I"d need a four stage prescaler to divide the 100MHz input frequency by 16 to bring it within the range I could measure. This led to me experimenting with using the CCL as a prescaler, which I wrote about in the earlier article Frequency Divider Using CCL.

It turned out that I could clock TCD0 at well over 100MHz, which would allow me to design this really simple frequency meter with the range I was looking for, without needing a prescaler.

Microchip now have three new ranges of AVR microcontrollers: the ATtiny 0-, 1-, and 2-series, the ATmega 0-series, and the AVR DA- and DB-series. They all have similar peripherals, so I could have chosen, for example, the ATtiny414, ATmega4809, or AVR128DA28, all of which can use an external 32.768kHz crystal for timing, and which include timer/counter TCD0. I tested a first version of the circuit with an AVR128DA28, but for the final version I chose the ATtiny414 because it has a more compact package, and I didn"t need the extra I/O lines.

I had the events working with the AVR128DA28, but then after switching to the ATtiny414 they no longer seemed to work, and the problem turned out to be the different terminology used on the earlier processors. I"m grateful to user kabasan on AVR Freaks for helping me out. If you want to learn about using the Event System I recommend starting with the AVR DA- or DB-series, which have more logical terminology.

Note, don"t confuse the ATtiny 1-series ATtiny414, released in 2020, with the older ATtiny441 which was released in 2014 as an enhanced version of the older ATtiny44.

I thought it would be useful to provide a crystal oscillator, to allow you to use the frequency meter to measure the resonant frequency of a crystal. One possible crystal oscillator design uses the Texas instruments unbuffered CMOS inverter LVC1GU04 and a few other components

In practice I found this worked perfectly on my prototype, without any additional components, with a range of crystals from 2MHz up to 25MHz. However, the capacitance of the breadboard might have been critical in getting the crystal to oscillate, so if you"re designing a PCB for this circuit I recommend including spaces for the passive components in case they are needed.

The crystal I used is a 32.768kHz cylindrical clock crystal with an accuracy of 20ppm and a load capacitance of 12.5pF L - CS), where CL is the load capacitance 12.5pF, and CS is the stray capacitance which is probably as high as 5pF on the breadboard, giving C=15pF. On a PCB the stray capacitance would probably be 2.5pF.

To measure the frequency of a signal connect it between In and GND on the circuit. With a 3.3V supply the frequency meter worked up to about 105MHz, and increasing the supply voltage to 5V increased the upper limit to 110MHz.

When writing code for the ATtiny414, and its peripherals, I found it useful to refer to the document AVR1000b: Getting Started with Writing C-Code for AVR MCUs. Also, when trying to guess what symbol to use for particular register settings it"s useful to look through the file iotn414.h, which you can find in the megaTinyCore installation on your computer.

The display interface uses the same routines as many of my earlier projects, such as Tiny Function Generator, which used a similar I2C OLED display. Text is plotted on the display using a 6x8 pixel character set, but at double the scale to give an effective character size of 12x16 pixels, using the smoothing routine I described in Smooth Big Text.

Note that on the ATtiny414 in megaTinyCore the I2C buffer is only 16 bytes, to save RAM, so I had to modify the ClearDisplay() and PlotChar() routines to send the data in smaller batches.

The main loop waits for the global variable Ready to be set, indicating that a capture has occurred. It then copies the Counter value to temp, with interrupts disabled to avoid the possibility that the value of Counteris changed by the interrupt service routine while it"s being displayed:

When there"s no input signal Timer/Counter TCD0 isn"t clocked, and the Counter value is never updated. To check for this situation there"s a one-second timeout which sets Counter to zero if Ready hasn"t been set. The value of zero is displayed as three dashes by the PlotInt() routine.

The accuracy of the meter primarily depends on the accuracy of the 32.768kHz crystal used to generate the 1Hz sampling signal. I used a cylindrical clock crystal which has a stated accuracy of 20ppm; this sounds good until you calculate that this is equivalent to ±2000Hz with a 100MHz input signal. In practice I found that its accuracy was generally about a factor of 5 or 10 better than this.

This circuit assumes that your input frequency is a logic-level square wave. In a practical workbench frequency meter you would ideally have an analogue front end to drive the counter, with input protection. One option would be a module based on a TLV3501 high speed comparator.

The pulse-counting technique used by this meter is most accurate for high frequencies. You could combine this approach with interval measurement for low frequencies, as described in my earlier article Frequency Probe.

digital frequency meter with lcd display free sample

The Siglent SDS1052DL is a 50MHz, two-channel, digital storage oscilloscope with a hardware frequency counter, a 500MS/s per channel sample rate, a 32kpts per channel record len…