Avatar
DIY Simple Frequency Meter Up to 6.5MHz
Oct 03rd, 2020 | by: Rick Sanchez | Views 2299
Views 2299

Another simple to build useful instrument in you lab. The device presented in the video is a frequency meter made using an Arduino Nano microcontroller. It can measure the frequency of signals with rectangular, sinusoidal and triangular shapes. Credit to: Mirko Pavleski

Story

The device presented in the video is a frequency meter made using an Arduino Nano microcontroller. It can measure the frequency of signals with rectangular, sinusoidal and triangular shapes. Its measurement range is from a few hertz to 6.5 Megahertz. Three measurement time intervals are also available - 0.1, 1 and 10 seconds. If we measure only rectangular signals, then there is no need for a shaping amplifier and the signal is fed directly to the digital pin 5 from Arduino.

The Parts

The code is very simple thanks to the "FreqCount" library which you can also download below.

The device is very simple and consists of several components:

- Arduino Nano microcontroller

- Shaping amplifier board

- LCD display

- Input signal shape selector

- Input JACK

- and Time interval switch : we can choose three intervals 0.1 -1 -and 10 seconds.

As you can see in the video, the instrument is very precise in the whole range, and we can also calibrate the frequency meter with the simple procedure described below:

In the Arduino libraries folder find the FreqCount library,

in the FreqCount.cpp file find the lines:

#if defined (TIMER_USE_TIMER2) && F_CPU == 12000000L

float correct = count_output * 0.996155;

and replace them with:

#if defined (TIMER_USE_TIMER2) && F_CPU == 16000000L

float correct = count_output * 1.000000;

where 1.000000 is your correction factor, the

correction must be carried out by applying 1 MHz to the input of the frequency meter.

After changing the file, upload a new sketch to the Arduino board.

Finally, the frequency meter is built into a suitable plastic box and is another useful instrument in the electronic laboratory.

Schematics
Code

#include <FreqCount.h>//https://github.com/PaulStoffregen/FreqCount/archive/master.zip
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 6, 4, 3, 2);// RS,E,D4,D5,D6,D7
void setup() {
  lcd.begin(16, 2);// LCD 16X2
  pinMode(7,INPUT);
  FreqCount.begin(1000);
}
unsigned long f;float f0;
int x,n=3,r;

void loop() {  
  if(digitalRead(7)==HIGH){
    n++;x=0;delay(100);
    }
  lcd.setCursor(0,1);
  if(n==1){x++;if(x==1){FreqCount.begin(100);}r=-1;lcd.print("T = 0.1 s ");}
  if(n==2){x++;if(x==1){FreqCount.begin(10000);}r=1;lcd.print("T = 10 s ");}
  if(n==3){x++;if(x==1){FreqCount.begin(1000);}r=0;lcd.print("T = 1 s  ");}
  if(n>3){
    n=1;
    } 
  lcd.setCursor(0,0);
}


6 Comments

  • Noob 19129

    about 5 months ago

    Please try Google before asking about Recommended Product Site 0b59a70

    Noob 19129

    about 2 months ago

    Please try a hrefhttpswwwgooglecomGooglea before asking about a hrefhttpsprakardsodcomindexphptopic74newnewCool Product Tipsa 3d94c5f

    Noob 19129

    about 2 months ago

    Please try a hrefhttpswwwgooglecomGooglea before asking about a hrefhttpforumprolifeclinicsroviewtopicphppid561406p561406New Product Sitea f6c4aa0

    Noob 19129

    about 1 month ago

    Please try urlhttpswwwgooglecomGoogleurl before asking about urlhttpsbitcoinviagraforumcomshowthreadphptid186pid2233pid2233Top Product Guideurl 99f6c4a

    Noob 19129

    about 21 days ago

    Please try urlhttpswwwgooglecomGoogleurl before asking about urlhttpswww435ycomforumphpmodviewthreadtid5809pid21615page1extrapid21615Excellent Product Blogurl 099f6c4

    Noob 19129

    about 12 days ago

    Please try urlhttpswwwgooglecomGoogleurl before asking about urlhttpjunlinro520gaintwviewthreadphptid896375pid1283885page1extrapid1283885Best Product Blogurl 988595

Login or Sign Up to post comments on this tutorial.