I am building a device that measures the frequency of the home power supply.Is lm331 is ideal for the purpose ? Since the output wave form of the supply is somewhat similar to a sinusoidal signal with distortions is it good to use lm331 or are there any other ic's i can use ?
220-235V and frequency 50-60Hz ....But from what i observed lm331 requires more circuit elements and i could do my job by a zero crossing detector.Is there any precision wise advancement in using lm331 for measuring frequency of a signal ?
LM331 or any other general purpose comparator is O.K. It should be used in a circuit with positive feedback to create some hysteresis. A low pass in front of the comparator might be necessary in some cases to filter higher frequency interferences.
LM331 is not a comparator, instead it is a voltage-to-frequency converter.
In the datasheet there are design examples of frequency-to-voltage converters.
I assume this is what the OP wants to do. But indeed he tells about nothing...
For mains frequency measurement I recommend a microcontroller with capture periferal.
(Measure time from one rising edge to the next rising edge, filter it and calculate frequency)
It needs a signal forming zero cross detection or a simple comparator in front of the capture input.
If the uC runs from a Xtal oscillator it is a very accurate and precise measurement device.
Why do you want to measure the electrical frequency? If you live in a civilized country then the frequency should be extremely accurate, maybe more accurate than your measuring circuit.
Oh, your home is far from civilization and your electricity comes from a battery powered inverter? Then its frequency accuracy might be very poor.
My multimeter measures frequency with very good accuracy. Right now it measures 60.00Hz.