This is a small project based on Atmega168pb that is measuring the frequency applied on PB0 pin
The Atmega168PB has external quartz at 16 MHz and can measure signal from 300Hz to 10kHz. The measured signal must be above 2.4V in order to be measured if not you can make a small signal amplifier to have the required input voltage.
The full code can be found here :
https://github.com/microelectronica-eu/Atmeg168PB-Timer-Capture.git