Frequency Counter

Arduino Uno or Nano 6 MHz Frequency Counter with LCD. As accurate as the crystal.

Sep 1, 2017

27912 views

6 respects

Components and supplies

1

pot 10K

1

RGB Backlight LCD - 16x2

1

Arduino UNO

Project description

Code

counter

c_cpp

counter

c_cpp

Downloadable files

Counter

Counter

Comments

Only logged in users can leave comments

jammybagel

a year ago

I tried to set this up using tinkercad and it is only displaying hi and not displaying the frequencies at all it has the frequency input put into pin 5 but no code there to activate pin 5

Anonymous user

2 years ago

I hooked this up to my Arduino and It worked ok but checking the frequency at 5,000,000 Hz it was off by about 1900 Hz. What can I change in Arduino program code to adjust for the 1900 Hz or this is the best it will read.

moty

2 years ago

The reason for the error is the code in line 58. Every 32768 counts of the input the line of code is executed and stops the count for the duration. A good solution would have been for the counter to reset itself but the hardware doesn't have this option. I wanted the math in the code to look sensible so I left this error. You can change the number in line 54 (OCR1A = 32767;) to 32755 or another near number to correct the displayed frequency readings. Check the readings of several input frequencies to make sure it works for you.

Anonymous user

2 years ago

Very interesting project. I'm sure to try it out in future projects. Thanks for sharing this with us.

Anonymous user

4 years ago

Very interesting project. I'm sure to try it out in future projects. Thanks for sharing this with us.

Anonymous user

5 years ago

Hi, i wire up this circuit but i got error in this circuit in my stimulation CAD software, please help me to resolve it. The error was like ",m" this specific word displayed in my LCD. I want to design the circuit regarding for 30 Khz frequency meter in an accurate level. please help me. Also please give the accurate coding and the diagram.

Anonymous user

7 years ago

I hooked this up to my Arduino and It worked ok but checking the frequency at 5,000,000 Hz it was off by about 1900 Hz. What can I change in Arduino program code to adjust for the 1900 Hz or this is the best it will read.

moty

2 years ago

The reason for the error is the code in line 58. Every 32768 counts of the input the line of code is executed and stops the count for the duration. A good solution would have been for the counter to reset itself but the hardware doesn't have this option. I wanted the math in the code to look sensible so I left this error. You can change the number in line 54 (OCR1A = 32767;) to 32755 or another near number to correct the displayed frequency readings. Check the readings of several input frequencies to make sure it works for you.