• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Building a Simple Pulse Frequency Counter Circuit with Arduino

Building a Simple Pulse Frequency Counter Circuit with Arduino

Last updated on 25 September 2024 by Admin-Lavi Leave a Comment

A pulse frequency counter, which calculates a signals frequency in hertz (Hz), is a crucial instrument in electronics.

The development of microcontrollers such as the Arduino has made the process of creating a frequency counter more readily available and economical.

This article describes how to use an Arduino Uno and a few other parts to make a pulse frequency counter.

An IC 555 for pulse production, an IC 7809 for voltage regulation, and a basic LED indication will be part of the setup.

Code with Explanation:

[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
}

Explanation:

  • frequency saves the recorded frequency, and pulseCount counts the number of pulses.
  • Setup Establishes pin modes, starts serial connection, and creates an interrupt to count pulses on rising edges of the signal.
  • Loop sends data to the serial monitor, detects frequency, and resets the pulse count every second.
  • In addition, it uses pulse detection to operate the LED.
  • The countPulse() interrupt function increases pulseCount each time a pulse is detected.

Circuit Working:

Parts List:

ComponentValueQuantityRemarks
Resistor1k11/4 watt
Resistor220Ω11/4 watt
Potentiometer100k1
CapacitorElectrolytic 1μF 25V1
CapacitorCeramic 0.01μF1
ArduinoUno Board1
IC78091Voltage Regulator
IC555 Timer1For pulse generation
LED Red5mm 20mA1Any color

The pulse frequency counter projects dependability is greatly dependent on the IC 7809.

The Arduino Uno and the IC 555 in the circuit normally need a steady power source.

A greater input voltage, such as 12V, can be controlled by the IC 7809 to provide a steady 9 volt output.

The Arduino, which detects the pulse frequency, and the IC 555, which produces the pulse signal, both depend on this controlled voltage to operate correctly.

The potentiometer is used to regulate the frequency of a continuous square wave signal produced by the astable mode of operation of the IC 555.

The Arduino can count the number of pulses in a second by detecting the rising edges of the square wave through an interrupt.

The Arduino uses the detected frequency to drive the LED and shows the frequency count on the serial monitor.

Formulas:

The formula to calculate frequency from pulse duration is:

Frequency (Hz) = Total Pulse Duration (s)1​×106

This is the span of time when a pulse is present.

It is measurable in seconds (s).

For instance, 0.001 seconds would be the duration of a pulse lasting one millisecond (ms).

This is frequently the total amount of time that a series of pulses take inside a specific amount of time.

The frequency of an event is measured in hertz (Hz), which is the number of times it occurs in a given amount of time.

It represents the number of pulses that occur in a second within the context of a pulse signal.

The duration of the pulse is converted from microseconds (μs) to seconds using the 106 factor.

This is important when working with microcontroller timing functions that commonly operate in microseconds.

How to Build:

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

  • Gather all the components as mentioned in the above circuit diagram.
  • Connect a regulated IC 7809 to provide a regulated 9V DC to the Arduino board as per the above circuit diagram
  • Connect pin1 of IC 555 to the Arduino GND.
  • Connect Pin 2 of IC 555 to Pin 6
  • Connect pin 3 of IC 555 to an Arduino digital pin 2.
  • Connect resistor 220Ω and LED from pin 3 and GND.
  • Connect Pin 4 to Pin 8 to 5V on Arduino board.
  • Connect a capacitor 0.01μF from Pin 5 to GND for stability
  • Connect a capacitor 1μF from Pin 6 of IC 555 and GND.
  • Connect a resistor 1k from Pin 7 of IC 555 to positive supply.
  • Connect a 100k potentiometer 1st leg to pin 7 and middle leg to pin 6 of IC 555

Conclusion:

An easy and instructive project that offers insights into frequency measurement and signal processing is building an Arduino pulse frequency counter.

An Arduino may be used for counting and an IC 555 for creating pulses to build a flexible instrument that can be used for testing circuits and detecting signal frequencies, among other things.

This project gives users a hands-on introduction to fundamental electronic components while showcasing the versatility of Arduino in addressing electronic chores.

References:

Pulse counter – using internal comparator?

Filed Under: Arduino Projects, Meters and Testers

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Simple Arduino-Powered Running LED Circle Circuit
Next Post: Simple Adjustable Brightness Control Circuit for LEDs »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

  • Alarm Circuits (30)
  • Amplifier Circuits (67)
  • Arduino Projects (29)
  • Audio Circuits (93)
  • Automobile Circuits (19)
  • Battery Charger Circuits (48)
  • Free Energy (13)
  • Heater and Temperature Controllers (9)
  • Indicator Circuits (38)
  • Inverter Circuits (13)
  • LDR Circuits (13)
  • LED and Lamps (111)
  • Meters and Testers (27)
  • Motor Controllers (18)
  • Oscillator Circuits (32)
  • Power Supply Circuits (91)
  • Remote Control Circuits (6)
  • Security and Protection (23)
  • Sensors and Detectors (71)
  • Solar Circuits (16)
  • Timer Circuits (27)
  • Transistor Circuits (56)
  • Transmitter Circuit (12)
  • Tutorials (4)
  • Water Level Controller (4)

Copyright © 2025 | New Circuit Ideas