See also a complete product for 100MHz https://www.electronics-lab.com/project/100mhz-frequency-counter-with-pic16f628a-2/
OLED CONTERS MOVED TO oled_counter.php
For signal lower than 5V use high speed comperator: eBay
LCD-I2C FREQUENCY COUNTER 6MHz ATtiny45/85
Counter uses ATtiny85/45, frequency up to 6Mz and period displayed. LCD 16x2 I2C interface add-on board and driven by software I2C. For frequency below 1000Hz the period is displayed in us, period is calculated.
ATtiny can be programmed using Arduino IDE and Arduino as ISP, see Technical Tips Burning bootloader with setting "Clock Source 16MHz external", this makes the CPU work at the crystal frequency.
The frequency is displayed by 7 digits with leading zeros removed down to 3 digits. Signal input is a TTL type. The
time base is generated by the 16MHz crystal oscillator.
The counting resolution is 1 Hz for frequencies up to 6 MHz.
The LCD module has to be HD44780 compatible.

LCD-I2C FREQUENCY COUNTER 16MHz PIC12F1822
The PIC12F1822 microcontroller is programmed to count the input frequency during accurate 1 second by dividing the 8 MHz crystal. The CPU runs at 32MHz from a PLL. The counter measures the frequency for 0.1sec first, if the frequency is greater than 2MHz TMR0 prescaler divides by 4 to increase the input frequency range to 16MHz with resolution of 4Hz, when the frequency is below 2MHz TMR0 is set for no prescaling and the measurement is with resolution of 1Hz. The frequency is displayed with leading zeros removed down to 3 digits.
LCD 16x2 I2C interface add-on board and driven by software I2C. For frequency below 1000Hz the period is displayed in us, period is calculated.
The LCD module has to be HD44780 compatible.

LCD-I2C FREQUENCY COUNTER 2MHz PIC12F629
The PIC12F629 microcontroller is programmed to count the input frequency during accurate 1 second by dividing the watch 32768Hz crystal. The CPU runs at 4MHz from an internal clock. TMR0 is set for no prescaling and the measurement is with resolution of 1Hz. The frequency is displayed with leading zeros removed down to 3 digits.
LCD 16x2 I2C interface add-on board and driven by software I2C. Period is not displayed in this counter.
The LCD module has to be HD44780 compatible.

LCD FREQUENCY COUNTER 6MHz ATtiny88
Low cost Arduino NANO with ATtiny88. The LCD and driver module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus. The frequency is displayed on line 1 by 7 digits. Signal input is a TTL type. The
timebase of 1 second is generated by the 16MHz crystal oscillator using Timer1. Timer0 is the counter.
The measurement is with resolution of 1Hz up to 6MHz.
Period is displayed on line 2. The period is calculated.
Contrast 10K trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
ATttiny is programmed using Arduino IDE. Use these instructions https://handsontec.com/dataspecs/module/Arduino/Arduino%20Tiny%2088.pdf
The LCD module has to be HD44780 compatible.
 
LCD FREQUENCY COUNTER 6MHz ATtiny84
The LCD and driver module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus. The frequency is displayed on line 1 by 7 digits. Signal input is a TTL type. The
timebase of 1 second is generated by the 16MHz crystal oscillator using timer1. Timer0 is the counter. ATtiny44 can be used too but I didn't test it.
The measurement is with resolution of 1Hz up to 6MHz.
Period is displayed on line 2. The period is calculated.
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
ATtiny can be programmed using Arduino IDE and Arduino as ISP, see Technical Tips Burning bootloader with setting "Clock Source 16MHz (external)" and Pin Mapping : "Clockwise".
The LCD module has to be HD44780 compatible.

ACCURATE LCD FREQUENCY COUNTER 4MHz PIC16F1827
PIC16F1827 counter uses Real Time Clock 2 PPM crystal oscillator. The PIC sets the DS3231 module to output accurate 1 Hz which is used to gate the input frequency, I use this module because it is cheaper than other 2 PPM crystal oscillators. The 3V battery isn't needed. Measuring the 32768 Hz output of the module gives exact readings.
The frequency is displayed on line 1 by 8 digits with leading zeros removed down to 3 digits. Signal input is a TTL type.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with. Included C code and circuit diagram. The LCD and driver module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus.
The LCD module has to be HD44780 compatible.
 
LCD MILLIHERTZ COUNTER PIC16F1827
Counter uses PIC16F1827 . The frequency range is 0.25Hz to 10KHz displayed in millihertz. Included C code and circuit diagram. The LCD and driver module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus. The frequency is displayed on line 1 by 8 digits with leading zeros removed down to 4 digits.
The software counts the number of pulses of 1MHz oscillator during 1 cycle of the input and then calculates 1 billion divided by counts and the result is in milliHz.
The input is connected to the inverting input of the comparator and the non inverting input is connected internaly to 2.5V. The input signal can be down to 0.1VAC and 2.5VDC.
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
The LCD module has to be HD44780 compatible.

LCD FREQUENCY COUNTER 16MHz PIC16F1827
Counter uses PIC16F1827 . Included C code and circuit diagram. The LCD and driver module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus.
The frequency is displayed on line 1 by 8 digits with leading zeros removed down to 3 digits. Signal input is a TTL type. The
time base is generated by the 8MHz crystal oscillator using timer1 and CCP1.
The counter measure the frequency for 0.1sec first, if the frequency is greater than 2MHz TMR0 prescaler divides by 2 to increase the input
frequency range to 16MHz with resolution of 2Hz, if the frequency below 2MHz TMR0 is set for no prescaling and the measurment is with resolution of 1Hz.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
The LCD module has to be HD44780 compatible.


LCD FREQUENCY COUNTER 16MHz PIC16F628A
Counter uses PIC16F628A. The LCD module is a 2 lines 16 characters. The LCD
is driven by 4 bits data bus. The LCD module has to be HD44780 compatible. First the frequency is counted for 0.1 seconds, if it's below 4MHz the counting repeated for 1 sec, else TIMER0 is set tio divide by 8 and the count is repeated.
The frequency is displayed on line 1 by 7 digits with leading zeros removed down to 3 digits. Signal input is a TTL type. The
time base is generated by the 20MHz crystal oscillator using timer1 and the CCP.
Timer0 is used to count the input frequency up to 4MHz with resolution of 1Hz, above 4MHz the sesolution is 4Hz.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.

ARDUINO LCD FREQUENCY COUNTER
see also
Frequency Counter for ANDROID
The project is for Arduino Uno or Nano. The Arduino generates an accurate 1 second time base for the counter by
cascading timer0 and timer2. The link between digital inputs 3 and 4
connects the output of timer2, 250 Hz, to input of timer0. The software
waits for the output of timer0 to go positive to start the count of
frequency input to timer1. Timer1 is a 16 bits timer, it overflows at the
count of 2 power of 16, that in turn advances over-flow register. At the end
of the 1 second the 16 bit register is recorded. The Arduino then calculates
the frequency and period and displays them on the LCD.
There is a big selection of LCD modules, and they are very similar
in characteristics . The LCD module has to be HD44780 compatible.
The
frequency input is TTL signal levels. The MCU spects recommend input up to 6 MHz, I tested it at 2 MHz.
Contrast trimmer can set contrast from zero to max, set the trimmer to about middle to start with.
You are free to use the circuit diagram and the software with no
limitations.
|