This project detects and displays the frequency of an input digital signal using an Arduino. It counts input pulses over a fixed time interval to calculate and report the signal frequency in Hertz (Hz).
- Detects frequency of square wave or digital pulses
- Simple and efficient code using interrupts or polling
- Frequency output via Serial Monitor
- Arduino Uno, Nano, or compatible board
- Signal source (function generator or 555 timer)
- Jumper wires
- USB cable
freq_detector.inoβ Main Arduino sketch
- Connect the signal to a designated digital input pin (e.g., D2).
- Arduino counts pulses over a set time (e.g., 1 second).
- Frequency is calculated as:
frequency = pulseCount / timeInterval;
- Frequency is printed to the Serial Monitor.
- Open
freq_detector.inousing the Arduino IDE. - Upload the code to your board.
- Connect an input signal (0β5V square wave) to pin D2.
- Open Serial Monitor (9600 baud) to view frequency output.
Open source and free for academic or hobby use.