Build and test a common PIC-based frequency counter kit.
Not that I really need another frequency counter, but it is interesting to see how this one is constructed.
Julian’s investigation of the circuit was thorough, including the discovery that the kits available are deritative from original work by Wolfgang “Wolf” Büscher, DL4YHF, in his Frequency counter with a PIC and minimum hardware.
From seller product information pages:
- Color: Red, Simple Construction , compact design, easy to install and debug. Designed to measure the frequency of oscillation of most crystal oscillators. Based on PIC microcontroller can measure the frequency of 1 Hz to 50 MHz. Five digits of precision, for example kHz x.xxxx, MHz or xx.xxx x.xxxx MHz. General for feeding USB interface can be used for power supply, AC adapter or a battery of 9 V can be used too, it is used. Color: Red, Simple Construction , compact design, easy to install and debug.
- Designed to measure the frequency of oscillation of most crystal oscillators.
- Based on PIC microcontroller can measure the frequency of 1 Hz to 50 MHz.
- Five digits of precision, for example kHz x.xxxx, MHz or xx.xxx x.xxxx MHz.
- General for feeding USB interface can be used for power supply, AC adapter or a battery of 9 V can be used too, it is used.
- Optional mode of power saving: can automatically convert the display if the frequency does not change significantly in 15 seconds
- Very small number of components: a PIC16F628, 5, 7-segment LED screens, a 20 MHz crystal and some resistors
- Frequency range: 1 Hz-50 MHz
- Glass Test Range: 4 KHz-48 KHz
- Built Item Size: 8 * 5.5 * 0.7 cm / 3.2 * 2.2 * 0.3 inches
|IC2||7550A-1 5V regulator||1|
|LED1-5||5161AS 7-segment LED, common-cathode||5|
|C2||10-40pF variable capacitor||1|
|C5||102 1nF capacitor||1|
|C6||104 100nF capacitor||1|
|Q1||S9014 NPN transistor||1|
The PCB is a nice 2-layer layout:
The circuit in this kit is based on Construction - Variant 2 by Wolfgang “Wolf” Büscher, DL4YHF. Modifications:
- addition of the crystal tester circuit
- variable capacitor on one leg of the crystal
- 5V regulator on the power supply
Here is my redrawing of the schematic used in the actual kit:
Julian and others have reported issues with the frequency counter (temperature effects; failure to register). However in my tests I didn’t see any of these problems. I tested crystals from 4MHz to 16MHz and got quite accurate results in all cases. Here’s an example of a 7MHz crystal under test:
With a function generator, I also got accurate readings form 1kHz to 24MHz (the upper limit of the function generator). The input signal is a 0V to 5V square wave:
The press-button is used to access a control menu for the device. To get good results, I had to make two changes:
- “Zero” - resets the frequency offset. When I first tried the device, it had a 5MHz offset which needed clearing.
- “PSave” - enables/disables power save feature. When I first tried the device, power save was enabled, which causes the device to keep turning off (may be misleading and make you think it is not working).
Input connections are not fully documented. Here’s how they seem to work. The connector and pin identifications refer to the schematic:
|J1||1||crystal leg 1; ground|
|J1||3||crystal leg 2|
|J2||1||frequency input; direct connect to PIC pin 3|
|J2||2||VIN / bypass power|
|J2||3||ground / bypass power|
|J3||1||VIN / power jack|
|J3||3||ground / power jack|
|J3||4||ground / bypass power|
J2 and J3 and configured to allow by-pass power supply. J3 is the barrel jack - when power is plugged in here, it by-passes any power supply connected on J2. For my tests, I just had power connected on J2.
Next Steps and Improvements
One of the issues with the counter is that it requires an input signal that registers across 0-5V as it is fed as a direct input to the PIC. This can be problematic:
- no over-voltage protection
- unable to read small signals
- AC-coupled signals may not have sufficient high-side amplitude
The preamplifier described by DL4YHF looks like an interesting addition.
So perhaps next things I’ll do with this kit:
- add a pre-amplified stage, perhaps with over-voltage protection
- mount in a case with a BNC connector for input frequency
- add a switch and battery connected on J2 (so can be mounted with a battery in a case, with external power bypass on J3)
Credits and References
- Frequency counter with a PIC and minimum hardware - original circuit design and description by Wolfgang “Wolf” Büscher, DL4YHF
- 50 MHz Crystal Oscillator Frequency counter Testers DIY Kit - similar product from an aliexpress seller
- Fairly Easy - Frequency Counter - Electronic Kit Build (part 1)
- Fairly Easy - Frequency Counter - Electronic Kit Build (part 2)
- Fairly Easy - Frequency Counter - Electronic Kit Build (part 3)
- PIC16F628 datasheet
- SC56-11 Datasheet - similar LED 7-segment display
- S9014 datasheet
- S9018 datasheet - parts.io
- HT7550A-1 datasheet
- ..as mentioend on my blog