Frequency Counter
Gerry Shand
Posts: 45
Hi All:
It has been awhile having been kept busy with a few project assignments but I managed to make it back.
I was wondering if anyone has been successful in using a BS-2 to create a frequency counter capable of measuring pulses between 1 - 10 Hz down to 3 decimal places? The intent is to read the signal for a pre-determined length of time (either 0.25 seconds or 1 second) and display the results on a LCD.
I have the circuitry required to convert the signal into a proper square wave (using a LM-339) and the pulse's duty cycle will vary. I also·have the program for the LCD as well.
Looking through the manual, I could use either the FreqIn or Count command but I am wondering about long·pulse width times versus the resolution.
Any advice?
Thanks in advance.
Regards,
Gerry Shand
It has been awhile having been kept busy with a few project assignments but I managed to make it back.
I was wondering if anyone has been successful in using a BS-2 to create a frequency counter capable of measuring pulses between 1 - 10 Hz down to 3 decimal places? The intent is to read the signal for a pre-determined length of time (either 0.25 seconds or 1 second) and display the results on a LCD.
I have the circuitry required to convert the signal into a proper square wave (using a LM-339) and the pulse's duty cycle will vary. I also·have the program for the LCD as well.
Looking through the manual, I could use either the FreqIn or Count command but I am wondering about long·pulse width times versus the resolution.
Any advice?
Thanks in advance.
Regards,
Gerry Shand
Comments
The COUNT statement will count the number of pulses seen in a time interval, but it gives an integer result. You'd have to count pulses for several minutes to get any sort of resolution.
The PULSIN statement will measure pulse width, but not frequency.
You could use calibrated loops to count pulses during a fixed interval. This would use a combination of PAUSE statements and the execution time of other statements to count pulses (edges) seen during a time interval. I don't think you could get the sort of accuracy you want with a BS2. The BS2 only executes about 4K statements per second
What you can do is measure the interval between two consecutive pulses, in microseconds for example, and then you will have the period in microseconds, from which you can compute the frequency [noparse][[/noparse]this conversion is left as an exercise for the student, as is the determination of the expected accuracy].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
Post Edited (Carl Hayes) : 4/15/2009 9:20:07 PM GMT
This is just a thought.
If Your 1-10Hz signal was used to enable the output of an external oscillator at Let's say 10kHz. ((10kHz value just for round numbers) " I haven't done the math" for what You need exactly.))
The output from the external OSC. would start on the raising edge of Your 1-10Hz pulse, The OSC. would send out pulses @ 10kHz to the BS2 COUNT PIN until Your 1-10Hz went low or falling edge.
With some experimenting with the external OSC. and the sample rate on the COUNT PIN on the BS2, The accuracy You want should be obtainable.
This will take some " tweaking ", But I think it would work.
_____________$WMc%__________
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············································ BoogerWoods, FL. USA
If the external clock is fast enough, you can get the resolution you need; and if its frequency is accurate and stable enough and your detection of the rising edge is precise enough, you can get the required accuracy, too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net