Site icon Circuit Ideas for You

Building a Simple Pulse Frequency Counter Circuit with Arduino

Pulse frequency counter count signal in hertz (Hz).

It is an important tool in electronics.

Now Arduino and other microcontroller make counter easy and cheap.

This article for Simple Pulse Frequency Counter Circuit with Arduino show how to make this easy circuit with few parts.

We have used IC 555 to make pulse, IC 7809 for control voltage and one LED to show signal.

Code:

[Arduino]          [IC 555]          [IC 7809]
   Pin 2 <------- Pin 3
 
volatile unsigned long pulseCount = 0;
unsigned long frequency = 0;

void setup() {
    Serial.begin(9600);
    pinMode(2, INPUT); // Pin connected to IC 555 output
        attachInterrupt(digitalPinToInterrupt(2), countPulse, RISING);
}

void loop() {
    pulseCount = 0; // Reset pulse count
    interrupts(); // Enable interrupts
    delay(1000); // Count pulses for 1 second
    noInterrupts(); // Disable interrupts

    frequency = pulseCount; // Store the frequency count
    Serial.print("Frequency: ");
    Serial.print(frequency);
    Serial.println(" Hz");
    digitalWrite(13, frequency > 0 ? HIGH : LOW); // Turn LED on if frequency > 0
}

void countPulse() {
    pulseCount++; // Increment pulse count
}

Code Explanation:

Circuit Working:

Parts List:

ComponentValueQuantity
Resistors1k 1/4 watt1
220Ω 1/4 watt1
Potentiometer 100k1
CapacitorElectrolytic 1μF 25V1
Ceramic 0.01μF1
SemiconductorsArduino Uno Board
IC 7809 Voltage Regulator1
IC 555 Timer For pulse generation1
LED Red 5mm 20mA any color1

This pulse counter project work good because of IC 7809.

Arduino Uno and IC 555 need stable power to work.

IC 7809 take high voltage like 12V and give steady 9V output.

Arduino for reading pulses and IC 555 for making pulses both need this 9V to work right.

Potentiometer control the pulse speed (frequency) from IC 555 in astable mode and it make square wave signal.

Arduino count pulses by checking rising edge of square wave using interrupt.

Arduino uses this frequency to turn LED ON/OFF and show number on serial monitor.

Formulas:

Formula to find frequency from pulse time is:

Frequency (Hz) = 1,000,000 / Pulse Duration (µs)

Pulse duration is how long one pulse stays.

It is measured in seconds (s).

Example: 0.001 second = 1 millisecond (ms).

Sometimes it mean total time of many pulses in some time range.

Frequency means how many times something happen in 1 second.

In pulse signal it mean how many pulses in 1 second.

Pulse time is often in microseconds (µs) so we use 1,000,000 to change µs to seconds.

This is useful because microcontrollers often work in microseconds.

How to Build:

For Building a Simple Pulse Frequency Counter Circuit with Arduino follow the below steps:

Conclusion:

This Building a Simple Pulse Frequency Counter Circuit with Arduino is a simple and fun project to learn frequency and signal checking.

Arduino count pulses and IC 555 make pulse signal.

Together they make useful tool for testing and checking signals.

This circuit is a good project to learn basic electronics and how Arduino help in many small tasks.

References:

Pulse counter – using internal comparator?

Exit mobile version