Frequency Measurement using Arduino

Definition

Frequency is the number of complete cycles per second in alternating current direction. The standard unit of frequency is the hertz, abbreviated Hz.

Frequency Measurement

                Frequency Measurement is carried out by measuring the number of cycles in one second, this method requires time of one second. Other method is to measure time period of one cycle F = 1 / T.

In this example time from first rise to the second rise is measured using interrupt on Pin 2 (INT0). It is set to detect rising pulse and at every 100mSec measured frequency is displayed on serial monitor.

Circuit Diagram of Frequency measurement

It does not require any external components; you may connect pull down resistor of 100k on Pin 2 to avoid noise measurement when there is no input. Measurement is carried out on interrupt 0, Use only Pin 2 of Arduino.

Arduino Frequency Measurement Circuit
Arduino Frequency Measurement Circuit

Arduino Frequency Measurement Code

Frequency Measurement Result

Open Serial monitor and give some frequency input to Pin2 of Arduino and Observer the result.

For testing this circuit just take Pin2 wire near AC Supply cable, it will show line frequency.

Frequency Measurement Result
Frequency Measurement Result

3 thoughts on “Frequency Measurement using Arduino

  1. Recently I have acquired your book about measurements, thinking that perhaps the circuits were more developed in the book, but I see that they are as they appear on the web. In particular this circuit interests me especially and I have the doubt of which is the correct scheme, because my English is not good and I am worried about destroying the Arduino. When you say “For testing this circuit just take Pin2 wire near AC Supply cable, it will show line frequency” I’m not sure if it means that I can put AC on an Arduino pin or if I have to put that pin close to an cable with the AC that I want to measure.
    Greetings .
    Translated with Google translator.

    Original
    Recientemente he adquirido su libro sobre medidas, pensando que quizás los circuitos estaban mas desarrollados en el libro, pero veo que son tal cual aparecen en la web. En concreto este circuito me interesa especialmente y tengo la duda de cual es el esquema correcto, por que mi ingles no es bueno y me preocupa destruir el Arduino. Cuando dice usted “For testing this circuit just take Pin2 wire near AC Supply cable, it will show line frequency” no tengo claro si se refiere a que puedo poner AC en un pin de Arduino o que si tengo que poner ese pin cerca de un cable con la AC que quiero medir.
    Saludos .

    Traducido con Google translator.

Leave a Reply