Fiverr gig
$15 — I will help you with your project and simulate it for you
Hire me
🌐 IoT Projects

Frequency counter Arduino UNO

EmbedLab TeamNovember 30, 20244 min read
Frequency counter Arduino UNO

Schematic FCAU


Description of the Arduino Frequency Measurement Code

This Arduino code utilizes a Liquid Crystal Display (LCD) to measure and display the frequency of a digital signal connected to an input pin. The LiquidCrystal library is used to manage the LCD, which is initialized with specific pins for communication. The program counts the number of pulses detected on the signalPin (A0) and calculates the frequency based on the timing of these pulses.

In the setup() function, the signal pin is set as an input to detect incoming pulses, and the LCD is initialized to show a static label indicating that it will display frequency measurements. The loop() function checks the state of the signal pin: when it detects a HIGH signal, it records the start time of the pulse. Once the signal goes LOW, the code calculates the duration of the pulse, increments the pulse count, and computes the frequency in Hertz. The calculated frequency is then displayed on the second row of the LCD.

This project is ideal for electronics enthusiasts interested in learning about frequency measurement, LCD interfacing, and Arduino programming. It provides a practical application of pulse counting and timing, making it a valuable hands-on project for beginners.



SCHEMATIC:

Frequency counter Arduino UNO

CODE:

#include <LiquidCrystal.h>

// Initialize the LCD object with the Arduino pins used for communication
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);

// Define the input pin for the signal
const int signalPin = A0;

// Variables to track pulse timing, count, and calculated frequency
unsigned long pulseStartTime = 0; // Stores the start time of the current pulse
unsigned long pulseCount = 0; // Counts the number of pulses detected
float frequency = 0.0; // Stores the calculated frequency in Hz

void setup() {
// Configure the signal pin as an input to detect pulses
pinMode(signalPin, INPUT);

// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);

// Display a static label on the LCD to indicate the frequency
lcd.print("Frequency(Hz):");
}

void loop() {
// Check if the signal pin is HIGH (start of a pulse)
if (digitalRead(signalPin) == HIGH) {
// If this is the start of a new pulse, record the time
if (pulseStartTime == 0) {
pulseStartTime = millis();
}
} else {
// Check if the pulse has ended
if (pulseStartTime != 0) {
// Increment the pulse count
pulseCount++;

  // Calculate the duration of the pulse (in milliseconds)
  unsigned long pulseDuration = millis() - pulseStartTime;
  // Calculate the frequency in Hz
  // Frequency = 1000 ms / average pulse duration
  frequency = 1000.0 / (pulseDuration / (pulseCount - 1));
  // Reset the pulse start time for the next pulse
  pulseStartTime = 0;
}

}

// Move the cursor to the second row, column 9 on the LCD
lcd.setCursor(9, 1);

// Display the calculated frequency with 4 decimal places
lcd.print(frequency, 4);

// Add a short delay to stabilize the display updates
delay(100); // Changed to 100 ms for readability }


  • Arduino projects
  • Frequency measurement tutorial
  • Liquid Crystal Display (LCD) interfacing
  • Arduino programming for beginners
  • Digital signal processing
  • DIY electronics projects
  • Pulse counting with Arduino
  • Electronics projects for beginners
  • Arduino signal measurement
  • LCD display projects
ET

EmbedLab Team

Embedded systems engineer and educator. Writes weekly tutorials at EmbedLab to help beginners ship real hardware.

Related projects

Arduino UNO and ESP32 Blink IoT project with Blynk app
🌐 IoT Projects

Arduino UNO Blink IoT Guide — ESP32 Arduino, Blynk App & Arduino IDE Code

Complete Arduino UNO Blink IoT guide using ESP32 Arduino and the Blynk app: free Arduino IDE code, Arduino library and LED wiring — the easiest Arduino IoT project for beginners to download and try online.

Oct 27 9 min
Blynk IoT app controlling Arduino UNO and ESP32 over Wi-Fi
🌐 IoT Projects

Blynk IoT with Arduino UNO & ESP32 — Free Arduino IDE, Library & App Tutorial

Complete Blynk IoT tutorial for Arduino UNO and ESP32 Arduino: install the Arduino IDE, add the Blynk Arduino library, wire LEDs, LCD and sensors, and control everything from the Blynk app over Wi-Fi — a free, beginner-friendly Arduino IoT project.

Nov 19 6 min
Simple Arduino UNO counter
🌐 IoT Projects

Simple Arduino UNO counter

Description of the Arduino 7-Segment Display Code This Arduino code controls a 7-segment display to show numbers from 0 to 9 based on a button press. The segmentPins array defines the pins connected t

Nov 30 3 min
Top 5 IoT projects with Arduino UNO and ESP32 — Blynk app, Wi-Fi and smart home
🌐 IoT Projects

Top 5 IoT Projects with Arduino UNO & ESP32 — Blynk, Wi-Fi & Smart Home Tutorials (2026)

The top 5 IoT projects every Arduino UNO and ESP32 maker should build in 2026 — Blynk IoT control, Wi-Fi blink, ESP-WROOM-32 dev board guide, ESP32 Proteus 8 simulation and an Arduino smart home parking system. Each pick links to the full tutorial with free Arduino IDE code, library and wiring.

May 30 8 min
How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide
🌐 IoT Projects

How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide

&nbsp; How to Control LEDs Using Blynk and Arduino Uno: A Complete Guide Controlling LEDs remotely using Blynk and an Arduino Uno is a simple yet powerful project for IoT (Internet of Things) enthusia

Apr 4 4 min
Browse all 50+ projects