Frequency Counter Schematic using Microcontroller AT89C51 is a simple yet mostly used frequency counter schematic used. The reason behind its simplicity also lies somewhere in the fact that this project uses only two components-AT89C2051 microcontroller and a 16*2 LCD.
Frequency is a crucial subject matter in every project. Precise and accurate frequency generation is another challenge we face in varieties of project design. As per the design of this project, this circuit can withstand frequency ranges in between 1Hz to ~16.5Mhz and rest depends on the characteristics of pin.
Working Principle and Circuit Description of Frequency Counter Schematic
The circuit diagram of frequency counter schematic using microcontroller AT89C51 is shown in figure 1.
What is frequency? It is the number of cycles per second made by the signal. This is the core principle used in every frequency measuring projects and we did the same. The 8051 microcontroller comes equipped with two inbuilt timers- timer 0 and timer 1, both of which are configured to be used for different purpose. The first timer 0 is employed to sample the input signal and is fixed at a single second delay. Talking about the other one; timer 1, it represents a counter that keeps record of number of cycles covered in a single second delay. Considering the case of overflow, another register is assigned to handle that situation. The overflow register is also termed as high byte of frequency since it holds higher value of frequency.
Pin P3.5/T1 (pin 9) which is timer 1 external input pin of microcontroller, fetches input signal as it is applied at that port. The port 1 of microcontroller is used to interface LCD in 4-bit mode for this project. Here we have used 2-line LCD. However, this project can also be used along with a single line LCD with proper configuration.
On the course of programming, timer 0 is initialized in 16-bit mode with 50 mS delay value. A tick value of 20 is programmed to be equal to total delay of 1s (50 x 20 = 1000 mS). Timer 1 in counter mode is programmed in 16-bit mode. During first 1 second delay, sample of input signal is extracted and timer 1 calculates the number of cycles and hence the frequency of input signal is determined and high byte of frequency if recorded. Frequency is stored as TH1:TL1. In total 3 bytes value is obtained which is then converted into a decimal equivalent represented in hex. This result is displayed on LCD and same process repeats again and again unless the signal is sampled completely and frequency is calculated.
PCB Diagram: The actual size PCB diagram for circuit Frequency Counter Schematic Using Microcontroller is shown below
Figure 2: Solder Side PCB diagram
Figure 3: Component Side PCB diagram
Software: Software for frequency counter schematic using microcontroller is given here in link Click Here To Download Source Code . You can directly download and burn it into microcontroller.
PARTS LIST OF FREQUENCY COUNTER SCHEMATIC USING MICROCONTROLLER
|Resistors (all ¼-watt, ± 5% Carbon)|
|R1 = 10 KΩ
R2 = 47 Ω
VR1 = 10KΩ
|C1 = 100 nF|
C2, C3 = 33 pF
|IC1 = LM7805|
IC2 = AT89C51
|LCD1 = 16X2 Alpha numeric LCD|
SW1 = Push to on switch
XTAL1 = 12MHz crystal oscillator