In generally, frequency means no of cycle per second .Here we used a Schmitt trigger circuit for measuring frequency of connected (a.c main) system. The output waveform of the schmitt trigger circuit is square wave which is 180º out of phase with the applied sine wave. Hence also square wave frequency equal to applied sine wave.
Circuit diagram for Frequency measurement
Fig-A : Frequency measurement by Microcontroller
Description of Frequency measurement circuit:
The two comparators of the 555 timer which are inputs (Pin 2 & 6) are tied together are biased at Vcc/2 through a voltage divider R3 & R4. Since the threshold comparator will trip at 2Vcc/3 and the trigger comparator will trip at Vcc/3, the bias provided by the resistors R3 & R4 is centered within the comparators trip limits.
Fig-B: Input & Output wave form of schmitt trigger circuit.
A sine wave input of sufficient amplitude to exceed the reference levels causes the internal flip-flop to be set and reset. In this way, it creates a square wave at the output. So long as R3 is equal to R4; the 555 will be automatically biased correctly for almost any supply voltage. The output waveform is 180º out of phase with the applied sine wave.
The output of the schmitt trigger circuit is connected with the 13 and 14 number of pin of microcontroller AT89C51 and 7-segment displays are connected with the microcontroller as shown in figure-02. The microcontroller compute the no of PGT of equivalent output as square wave of Schmitt trigger circuit per second, which is equal to the input sinusoidal (connected system)signal frequency, and display this value by 7-segment arrangement . When connected system frequency below 48 Hz and above 52 Hz then LED which is connected at 17 no pin of microcontroller is lighted.
The no of PGT of equivalent output as square wave of Schmitt trigger circuit per second is equal to the input sinusoidal signal frequency which we used in our programme,. But in practically the value of PGT are always integers that our measuring frequency is always integer value.Such as 12H,49Hz,50Hz,51Hz,54Hz etc.