jiristepanovsky.cz

Return to Index


Frequency meter - 2016

This meter measures frequencies from 0Hz to about 40MHz and displays the measured value on a 16x1 alphanumeric display. It is powered by a USB and uses a common 3.5mm connector for the input signal. Inside, there is an Atmega88 and some 74HCT logic to scale down higher frequencies, which could not be measured directly.

Frequency meter

The input signal from the 3.5mm connector is protected by a couple of schottky diodes and then brought to the input buffer. Some meters use a high-pass filter with an amplifier/comparator to reject the DC offset of the input signal and lower the minimum required amplitude. That, however, has a negative effect on lower frequencies, so I rather opted for a direct connection, used a 74AHCT1 gate as my input buffer, and sacrificed the rejection of the input's offset. The 74AHCT1 transitions between logical 0 and 1 at about 1.5V, which is perfectly fine for my use to measure crystals, clocks, and other mainly 3V and 5V logic signals.

Frequency meter schematic

The frequency measurement is done by the Atmega88 microcontroller clocked at 20MHz. Because of Nyquist's theorem, the maximum measurable frequency is only 10MHz in theory, but in practice, it is likely 5MHz top. So to measure higher frequencies, there is a 74HCT393 clock divider and a 74HCT151 multiplexer, through which the microcontroller can select the correct input clock divider. The maximum measurable frequency is therefore limited by HCT logic gates, not the microcontroller, and gets to around 40~50MHz.

Frequency meter maximum frequency

The measurement in the Atmega88 is done by a 16-bit TIMER1 clocked by an external pin connected to the multiplexer. The microcontroller then selects the most precise clock divider possible, which makes the input still reasonably below Nyquist's frequency. Calibration was done by soldering some ~pF capacitors to the 20MHz crystal to make it oscillate more or less accurately.

Frequency meter construction

The schematic, PCB layout, and firmware can be downloaded here.