Basic Level     Skills: Not specified    
Author email
Author website


Project tested and working perfectly

A very simple easy to make Frequency counter project. This project is powered with small AT89C2051 microcontroller with LCD. Block Diagram of circuit is shown below. It can support a wide range of frequency input starting from 1Hz to ~16.5Mhz, rest depends on pin characteristics.

Theory of Operation
As we all know frequency of a signal is number of cycle per second. I made use of this logic to calculate frequency of the input signal.
8051 has two timers, Timer 0 is configured for 1 second delay to sample the input signal and Timer 1 is used as a counter to calculate number of cycles in that 1 second. If timer1 overflows then the overflow is counter in another register which is considered as the high byte of Frequency. Input signal is provided at P3.5/T1 which is input for Timer 1 in counter mode. LCD is connected to microcontroller port 1 in 4-bit mode. Currently program is using 2 Line LCD but it can be used for 1 line LCD too.

Program initializes the Timer0 in 16-bit mode with 50mS delay value, a tick value of 20 is loaded to have total delay of 1s (50 x 20 = 1000 mS). Timer 1 is configured in 16-bit counter mode. After a sample of 1 sec, we get the number of cycles hence the frequency of input signal from timer1 registers (TH1:TL1) and high byte of Frequency. So total 3 byte value is then converted to a decimal equivalent represented in hex. This decimal value is then updated to LCD. The whole process repeats again.

1. FreqCounter.asm - Main program
2. FreqCounter.hex - Hex file
3. frequency_counter.png - Block Diagram
4. Schematic.pdf - circuit

For any doubts and suggestions please use forum

Use the Download button below to download this project.
Tags Frequency Counter using AT89C2051 and LCDFrequency Counter using 8051

19.51 kB





sandeep kumar
15 Jul 2014: 06:55 AM
i need c code of this project kindly mail me on
01 May 2015: 03:09 AM
i need c code of this project
08 May 2015: 16:06 PM
C code is also there I think.. check download section.
Ogu Reginald
11 May 2015: 21:44 PM
This is a good project.
Please I need the c source code for the project.
Feel free to email me:

If the c source code is not available, I want the frequency to be divided by 7 and the final answer displayed on the LCD.
14 May 2015: 04:50 AM
@ Ogu Reginald, You can understand the concept and implement the same on your own in C. Its really simple.
13 Jul 2015: 13:30 PM
could u please send the C code to me?
Chinh 299
13 Jun 2020: 13:18 PM
can you give the flowchart and detail comment of there code ?
23 Nov 2020: 08:43 AM
hi, Your Code is working but i have a problem while simulation on proteus i am giving input frequency from generator of 1000Hz but on output LCD its showing 1085HZ plz help.
23 Nov 2020: 14:40 PM
You're using a 11.059MHz crystal and it should be 12.00MHz
(Required; Min length 5)
(Required; will not be displayed)


Mon Apr 19 2021, 04:30 AM
Hello superb website! Does running a blog similar to this take a lot of work? I've very little expertise in programming but I was hoping to start my own blog soon. Anyhow, if you have any suggestions or tips for new blog owners please share. I understand this is off subject nevertheless I just wanted to ask. Cheers! Williams
Sun Apr 18 2021, 05:31 PM
Brandy Levi
{{Looking for|Want to find|Want to get|Do you need} more {buyers|clients|people ready to buy|customers|serious customers|business} {for your site|for your website|for your website or online store|for your online business}? {We can provide|We can get you|We can deliver} {targeted|keyword targeted} {traffic|visitors|people} {specifically|precisely} {for your business model|for your specific type of business|for your business|for your type of business}
Fri Apr 16 2021, 08:49 AM
Maria Campbell
It looks like you've misspelled the word "temprature" on your website. I thought you would like to know . Silly mistakes can ruin your site's credibility. I've used a tool called in the past to keep mistakes off of my website.-Maria
Thu Apr 15 2021, 11:47 PM
Rachel Cohen
Wed Apr 14 2021, 07:42 PM



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 84, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123