AVR frequency meter from 1Hz to 10MHz

Summary of AVR frequency meter from 1Hz to 10MHz


This article describes a low-cost, compact frequency meter capable of measuring 1Hz to 10MHz with 1Hz resolution. Designed for function generators or standalone use, it utilizes an AVR ATtiny2313 microcontroller to count input pulses over one second using Timer1 for accurate timing and Counter0 for pulse counting. The system employs seven 7-segment displays for output and requires minimal external components, making it easy to build and mount in panels.

Parts used in the Frequency Meter:

  • Seven 7-segment displays
  • AVR ATtiny2313 microcontroller
  • Transistors
  • Resistors

Frequency meter with some of quite good performance, capable of measuring frequencies from 1Hz to 10MHz (9,999,999 Hz) with a resolution of 1 Hz over the entire range. Ideal for function generators or as a standalone meter. It is cheap and easy to make, with parts that can be bought anywhere, and with a small size that allow it to be mounted in the panel on any device.
AVR frequenc meter
 
The circuit consists of seven 7-segment displays, AVR ATtiny2313  uController, and a few transistors and resistors. AVR does all the work and other ICs are not needed here. Its work is simple, AVR counts pulses on the input given at the time of 1 second and displays the result. The most important thing is very accurate time base, and this is handled by 16-bit Timer1 in CTC mode. The second, 8-bit timer counter operates as Counter0 and it counts pulses given to its input, the T0 pin. Every 256 pulses it causes the interruption, where program increases the multiplier. When we receive  the 1 second interrupt , the content of this multiplier is multiplied by 256 (shifted left by 8 bits). The rest of the pulses that counter got, are written down and added to the result of the multiplication. This value is then broken into single digits that can be displayed each on a single display. After that, just before leaving the 1 second interrupt,  both counters are reset at the same time and the measurement starts again. AVR in his spare time is multiplexing 7 displays. More details in the source code that I put in the attachment
For more detail: AVR frequency meter from 1Hz to 10MHz

Quick Solutions to Questions related to Frequency Meter:

  • What is the measurement range of this frequency meter?
    The device measures frequencies from 1Hz to 10MHz.
  • How does the project achieve its resolution?
    It provides a resolution of 1 Hz over the entire range.
  • Can this circuit be built easily?
    Yes, it is cheap and easy to make with parts available anywhere.
  • Does the design require multiple integrated circuits?
    No, only the AVR ATtiny2313 is needed as other ICs are not required.
  • How does the microcontroller process the input signals?
    The AVR counts pulses on the input during a time period of 1 second.
  • Which timer handles the accurate time base?
    The 16-bit Timer1 operating in CTC mode handles the time base.
  • What happens every 256 pulses received by Counter0?
    It causes an interruption where the program increases the multiplier.
  • How are the final digits displayed?
    The calculated value is broken into single digits and displayed on each of the seven displays.
  • Is the size of the project suitable for panel mounting?
    Yes, its small size allows it to be mounted in the panel on any device.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top