I finally managed to gather the parts, time, and motivation to work on my soundcard-based frequency counter.
The idea (by PA2OHH) is simple: allow the to-be-measured RF signal to trigger a binary ripple counter chip (74HC4060AP) that acts as a frequency divider
. According to the datasheet, bit 14 divides the input signal by 16384, so bit 12 will divide the input signal by 4096. Take the output from bit 12 as AF, feed it into a computer soundcard, and process the digital sound data to determine the audio frequency, from which the original RF can be calculated by multiplying by 4096.
I was planning to implement the DSP part on my TI eZdsp development board, which has a built-in LED display that can be used for displaying the frequency, but then decided to implement the DSP on my Android phone instead. This gives a smaller, self-powered, more portable, and more flexible solution -- though I'll eventually program the eZdsp unit also for use in my non-portable rigs.
Here's a photo of it all in action:
freqcounter.jpg [ 173.34 KiB | Viewed 195 times ]
For power I use 2 AAA batteries giving 2.4 volts; according to the datasheet, the chip will work down to 2V. I tried running the chip off of 1.2 volts but the crystal oscillator wouldn't start (it's possible however that the counter is still working in this state). (edit: it seems I should use at least 4.5V supply voltage or else the counter's high frequency performance may suffer.) The crystal oscillator is for calibration purposes only and generates a 2 MHz test signal to drive counter's input pin. The piezoelectric earphone connects to the output bit 12 of the binary counter so I can aurally verify that AF is really being produced. Also, the AF output goes through the alligator clips to a hacked cable with a TRRS (tip-ring-ring-sleeve) connector that plugs into the headset jack of my Android phone. I created the cable with the TRRS connector by slicing up one of my Android microphone-enabled headsets. The wires are really fine inside the headset cable which led to some initial confusion as to which wires were responsible for the microphone (I initially failed to identify the wire connecting to the sleeve, mistaking it for a non-conducting insulator only). After finally figuring out the plug wiring, and with some trepidation, I connected the circuit to my phone, hoping not to destroy any sensitive phone circuitry with my breadboarded circuit.
And it works! The AF signal that I hear in the earphone is processed by my program on the phone to determine the audio frequency (by counting the zero crossings), which is then multiplied by 4096 to give the RF, which as you see is displayed as 2000 kHz on-screen (the Hz label is a typo in my program). To be really precise I need to calibrate the system by measuring the actual crystal oscillation frequency (with say my FT817) and adjust the 4096 multiplier to something like 4095.95 or 4096.03 to give the exact oscillation frequency of the crystal. But for a first lash-up, the results are good enough: the 2 MHz crystal properly shows up as 2 MHz.
The next step is to figure out exactly how to drive this counter with the feeble RF signal from my regen. I did some experiments long ago with a 3-stage broadband amplifier connecting to a small link winding, but looking back, I'm pretty sure the amplifier must have been parasitically oscillating due to my poor construction practices and the intermittent results.
If the attainable frequency measurement is accurate enough, it should be possible, using the phone's AF output to somehow generate a control voltage, to make a huff-and-puff stabilised regen or VFO.
Another advantage of using my smartphone for the DSP is the wide range of options I have for displaying the frequency. In addition to simply printing the frequency as plain digits, one can think of all sorts of retro-looking analog display schemes: linear dial, circular dial, nixie-tube display, etc.