Frequency counter with PIC and 4- to 5-digit LED display (2024)

This document describes the construction of small frequencycounter with a cheap PIC microcontroller and a few seven-segment LED digits.The main features of the frequency counter are:
  • frequency range 1 Hz ... 50 MHz (prototype worked up to 60 MHz but this exceeds the PIC's timing specifications)
  • four or five digits resolution (display for example x.xxx kHz, x.xxx MHz, or xx.xx MHz); or 6 digits with F8FII's modification
  • automatic range switching with different gate times
  • optional addition or subtraction of a frequency offset (programmable)
  • optional preamplifier for the input signal
  • can be built on a single-sided 'breadboard-style' circuit board
  • firmware available for common-cathode as well as commom-anode displays
    (2016: Not sure which of these are used by the "anonymous clones" recently sold on Ebay)
  • very low component count: a PIC 16F628,
    4 or 5 7-segment LED displays,
    a 4-or 20-MHz crystal and a few resistors,
    optionally one transistor and a few diodes to drive the 5th digit,
    optionally one other transistor for the preamplifier.
  • since 2006-05: preprogrammed frequency offset for transceivers with 4.0 MHz IF
    (see the author's experiences with "Miss Mosquita", a 40 meter QRP transceiver)
  • optional (configurable) power-saving mode which automatically turns the display off
    if the frequency didn't change significantly within 15 seconds

Contents of this document:

  • Construction : Variant 1 (my very first prototype)
  • Construction - variant 2 (second, other prototype, layout and schematics)
  • Preamplifier (optional)
  • Driving the 5th digits (optional, with wired-NAND gate)
  • Power consumption
  • Frequency display ranges (auto-ranging)
  • How to add or subtract an offset frequency
  • How it works - Firmware function description
  • Short description in german language (Kurzbeschreibung auf Deutsch)
  • Links and other people's frequency counters ( for inspiration ;-)

The PIC firmware for the frequency countercan be downloaded from this link (includeshex file for all display variants and the assembly sourcecode).
A PIC programmer which you need to programyour PIC 16F628 is available on DL4YHF's website. Please do not ask me tosend programmed PICs or even circuit boards to you, my spare time is tooshort - and you will find anything you need on these "do-it-yourself" pages! If your counter shows a strange frequency initially, entersetup mode to set the frequency offset to zero(it sometimes happens that PIC programmers don't erase the EEPROM where thefrequency offset is stored).

Construction - Variant 1

The first prototype with very old, low-efficiency 7-segment displays lookedlike this:

Frequency counter with PIC and 4- to 5-digit LED display (1)
(PIC frequency counter prototype, connected to a grid dipper)

A flashing decimal point indicates a frequency in kilohertz, a steady pointindicates a frequency in Megahertz - which is more common for the intendeduse in dip meters and QRP transceivers.

The circuit diagram is so simple that I didn't make a complete Eagleschematic for it yet (other builders did, see links).The first prototype was built on a breadboard with round pads. A very similardesign could be used for a single-sided printed circuit board. Four bridges(drawn in red colour below)must be soldered on the board before fittingthe seven-segment displays. Note that the crystal is mounted on the bottomside ! Some of the display signal are routed with thin enamelled copper wire,especially those between two pads.

Frequency counter with PIC and 4- to 5-digit LED display (2)
(suggestion for building the counter on abreadboard. Use firmware "counter1.hex" for thiscircuit, and a 4-MHz crystal)

The resistors R4..R11 set the brightness and the power consumption. If youfind some suitable low-current displays, use 1 kOhm or even more. Very olddisplays require more current, use 390 Ohms in that case. The PIC's outputports can source and sink 20 mA per pin, so the digit drivers area slightly overloaded with 390 Ohm resistors per segment when displaying"8.". If you don't have to care for power consumption and want to use olddisplays with high current, use four PNP (!) transistors in the cathode(!)drivers as non-inverting emitter followers, no base resistors are required(base to PIC, collector to ground, emitter to common cathode).

For the displays "SC39-11SRWA" by Kingbright it is unnecessary to use drivertransistors, these high-efficiency displaye are bright enough with 1 kOhmcurrent limiting resistor per segment. In Germany you can -or, at least,could-order these displays at Reichelt, look for "SC 39-11 RT"intheir catalogue (in fact, these used to be SC39-11SRWA displays; aka "superbright" / high-efficiency display. Do NOT use the low-efficiency types likeSC39-EWA. You will be disappointed by a dark display, at least with the resistorvalues stated above).
Beware, other distributors of electronic components (like C..) sell suchdisplays for much higher prices !

Construction - Variant 2

For the second prototype, a 5-digit display was made on a single layer PCBshown below. The segment resistors were used to connect the display boardwith the PIC board (which is usually mounted in a 90° angle behind thedisplay). To make connection between PIC and display board easier, a secondfirmware variant was created with slightly modified pin assignment. On thisoccasion, the PIC's clock frequency was increased to 20 MHz to have a betterresolution at higher frequencies.

Schematics of the PIC board (display variant 2)

Frequency counter with PIC and 4- to 5-digit LED display (3)

Component values for variant 2 (as shown above): R1...R8 = 1k, R9=R10=10k,D1..D4=1N4148, T1=BC547 or similar, C1=C2 about 22pF (select them to tunethe crystal to exactly 20 MHz), C3=100nF, Q1=20 MHz, PIC: 16F628 programmedwith firmware "counter2.hex".

Layout of the PIC board (display variant 2). The board contains the decoderfor the 5th digit, and some breadboard area for the preamplifier (if needed).Print this image with exactly 300dpi, which can be achieved with IrfanViewand other utilities. The image is 700 * 300 pixels large, so the board dimensionswill be 2.33 * 1 inch, or 5.93 * 2.54 cm (check this before etching..).The display is mounted on the lower side of the PIC board as shown below.The square pads near the display are the cathode connectors (from left toright: d1..d4 are outputs directly from the PIC, d5 is driven by transistorT1).

Frequency counter with PIC and 4- to 5-digit LED display (4)

Placement of the components on the PIC board (Ridiculously simple, isn'tit ? But don't forget to place the bridge under the PIC socket before soldering!).

Frequency counter with PIC and 4- to 5-digit LED display (5)

Here is one suggestion for a layout for the display board (display variant2, also print this with exactly 300 dpi) :

Frequency counter with PIC and 4- to 5-digit LED display (6)

This board is quite universal, I plan to use it for a PIC-based DDS generatortoo. For the frequency counter, the connector pads "g","a","f","b" are notused because these four resistors R5..R8 are connected from the PIC boarddirectly to the backside of the first seven-segment digit (see below).The letters on the left side are the segments. The 5 cathodes are not routedto the side of the display PCB - it was impossible with such a small single-layerPCB. Use short pieces of wire to connect the square cathode pads on the displayboard to the square pads d1...d5 on the PIC board.

To save space on the front panel, the connector between PIC- and display-boardcan be omitted, and resistors R5..R8 on the PIC board soldered to the pinsof the leftmost 7-segment display (digit 1). Resistors R1..R4 are solderedto the lower 4 connector pads on the display board. See photo of the secondprototype, with the PIC still mounted on a raster board:

Frequency counter with PIC and 4- to 5-digit LED display (7)Frequency counter with PIC and 4- to 5-digit LED display (8)

Well, using the resistors to connect the CPU board with the display isn'treally nice - feel free to do better (many others did - see links).
BTW this prototype perfectly fits in a miniature QRP transceiver calledMiss Mosquita !

Common-cathode or common-anode display ?

The two display variants (COUNTER1 and COUNTER2) described above are for7-segment displays with common cathode (CC). But the downloadable softwareachive also contains a third firmware file (COUNTER3.HEX) for common-anodedisplays (CA).

COUNTER3 uses the same pins as COUNTER2, but the control outputs areinverted. In the circuit, use PNP transistors for the CA display insteadof NPN for T1 to drive the 5th digit, furthermore connect D1..D4 with reversepolarity, and connect D4 to Vsupp (positive supply voltage) instead of GND.

Preamplifier

Frequency counter with PIC and 4- to 5-digit LED display (9)Thepreamplifier consists of a single HF silicon transistor. I used a cheap BF199from the junk box, it works well up to 30 MHz and with reduced sensitivityup to 50 MHz. Make the connection from the collector to the PIC counter input(pin 3 = T0CKI) as short as possible, because every pF of capacitance counts.

With a BF199 in the preamp, R2 is 27 kOhm (+/-), and R3 must be as low as560 Ohm to achieve the necessary bandwidth. The DC voltage at the collectorand the voltage across R3 should almost equal - if not, adjust R2.

To save area on the breadboard, you can leave away the preamplifier. If youwant to feed the counter with a TTL signal, leave the preamplifier away,which saves another 4 mA. If the maximum frequency in your circuit is below10 MHz, you may increase the value of R3 and R2 by the same factor (say R3=1.2k, R2=56k) to save some current when using the counter in a battery-powereddevice. R1 sets the input impedance and also the sensitivity. With R1=330Ohm, the prototype required an input voltage of 600 mVpp (peak-to-peak) at40 MHz and 150 mVpp at 15 MHz. If you need a higher input resistance, adda FET buffer before the bipolar transistor. Or use a fast integrated comparatoras input stage if you find one in your junk box.

Added 2006-04: You will find a preamp with high input impedance on the pagesof the DL-QRP-AG - see links !

Driving the fifth digit (optional)

Frequency counter with PIC and 4- to 5-digit LED display (10)ThePIC firmware always drives a fifth digit as the least significant digit,if the measured frequency is above 10 kHz.Because there was no freeoutput pin available on the PIC 16F628 to drive another digit, a logiccombination from the first four digit multiplexer outputs was used (digits1 ... 4).

When all digit multiplexer outputs are passive (digits 1...4 = high), theoptional fifth digit is driven. The schematics on the left side show onesuggestion for a simple 'decoder' for the fifth digit, which basically isa four-input NAND gate realized with a few diodes, one resistor, and an NPNtransistor.

The diode between the emitter and ground is used because without it, thetransistor may conduct unwantedly if its base-emitter threshold voltage(typically 0.5 to 0.6 V) was less than the forward voltage of the other diodesin this stage (which will be about 0.6 to 0.7 V for a 1N4148). Of courseone could use Schottky diodes with lower forward voltages to eliminate theemitter diode, but 1N4148 are more likely to be found in a junkbox than BAT41's(or similar).

If you don't need it, leave the 5th digit away to save some current and afew components. For this reason, the 'single zero' (if no input signal ispresent) is not displayed in the 5th, but in the fourth digit.

Power consumption

The prototype (with R4..R11 = 390 Ohm) drew an average supply current of40 mA (with 5 low-efficiency digits). With high-efficiency or low-currentdisplays this can be significantly reduced. With 1kOhm segment resistors,the display draws a total current below 20 mA (with 5 digits "SC39-11").The PIC itself draws about 4 mA at 20 MHz, and less than 1 mA when runningat 4 MHz - so the preamp draws more current than the controller itself !

Display ranges

The display range is automatically switched to give the maximum readout accuracy(with 4 digits). The gate time is also selected automatically as listed inthe following table:

Frequency range Display Gate time Decimal point
0 ... 9.999 kHz X.XXX 1 second flashing (which means "kHz")
10 ... 99.99 kHz XX.XX(X) 1/2 second flashing
100 ... 999.9 kHz XXX.X(X) 1/4 second flashing
1 ... 9.999 MHz X.XXX(X) 1/4 second steady (which means "MHz")
10 ... 50.00 MHz XX.XX(X) 1/4 second steady

(On this occasion: "MHz" is Mega-Hertz, "mHz" would be milli-Hertz, but that'sanother story...)

Adding or subtracting an offset frequency

If the counter is used in a shortwave receiver or transceiver, you may wantto add or subtract an offset value from the measured frequeny. The offsetfrequency is the same as the intermediate frequency in many cases, becausethe counter is usually connected to the receivers VFO (variable frequencyoscillator). For this purpose, a programming mode (aka"setup mode") has been implemented in the firmwareso you can enter an offset frequency without reprogramming (or even reassembling)the PIC firmware.

The signal RA5 (pin 4 of the PIC 16F628) will is used to switch from normalcounter mode into programming mode. Usually the level on RA5 is high becauseit is connected to the supply voltage via pullup resistor (10k to 22k). Ifyou will never need to add or subtract a frequency offset, connect it permanentlywith the supply voltage (there must be a defined level on RA5, unfortunatelyit has no internal pullup resistor). By pulling RA5 low (connect pin 4 andpin 5 of the PIC with a small screwdriver), the firmware will be instructedto use the currently measured frequency as the new offset value. In otherwords, you must apply the offset frequency to the counter's input,wait until the value is displayed correctly, and then enter the programmingmode as explained below.

Frequency counter with PIC and 4- to 5-digit LED display (11)The program flow chart on the left shows how to enter programmingmode, how to select a menu, and how to execute the associated function. Toenter programming mode, press and hold the programming key (or connect pin4 and 5 of the PIC with a small screwdriver), until the PIC shows "ProG"on the LED display. Then release the "key". You are now in the first menuof the programming mode.
To select the next menu, press the key for a short time (less thana second). To execute the selected function, press the key for a longer time(more than a second). The menu functions are :

  • "Quit" : Aborts programming mode without changing anything.

  • "Add" : Saves the previously measured frequency permanently, so it will be added in future.

  • "Sub" : Saves the previously measured frequency permanently, so it will be subtracted in future.

  • "Zero" : Sets the frequency offset to zero, so the display will show the measured frequency without offset. The previously programmed offset will be lost.

  • "Table": Allows you to select a predefined offset value from a table. The table itself is also located in the PIC's data EEPROM, so you may find different values in it. When skipping through the table, the frequencies are shown in numeric form, like 455.0 (kHz), 4.1943 (MHz), 4.4336 (MHz), 10.700 (MHz). After selecting an entry (long keypress), you will be taken back to the main menu to select "Add" or "Subtract".

  • "PSave" / "NoPSV": turns the power-saving on/off. In power-saving mode, the display is turned off after 15 seconds of no "significant" change in frequency, and on again as soon as the frequency changes by more than a few dozen Hertz (in the 3..4 MHz measuring range). Added in May 2006 for battery-powered equipment like QRP transceivers.

Note:

There may be more menu items than shown here, but the principle remains the same.

The frequency offset values are saved as a 32-bit integer numbers in thePIC's data EEPROM (at the EEPROM's first four memory locations, high-bytefirst, low-byte last). If you have no signal generator to produce the offsetfrequency for programming, or cannot tap the BFO frequency of your homebrewshortware receiver, you can enter the offset value with a suitable PIC programmer(like DL4YHF's WinPic). Use ascientific pocket calculator to convert the frequency (in Hertz, positiveor negative) into a hexadecimal number, and enter this value in the PICprogrammer's EEPROM DATA memory window. If you use WinPic, enable the HEXeditor before typing the values into the memory window. Some examples:

4.194304 MHz : Add= 00 40 00 00 Subtract= FF C0 00 00 (yes,so simple)
4.433619 MHz : Add= 00 43 A6 D3 Subtract= FF BC 59 2D
0.455000 MHz : Add= 00 06 F1 58 Subtract= FF F9 0E A8
10.70000 MHz : Add= 00 A3 44 E0 Subtract= FF 5C BB 20

If the subtracted offset is higher than the counter's input frequency, theresult of the subtraction is negative. The frequency counter makes the resultpositive before displaying it. This way, you can use the counter also inreceivers where f_IF = f_RX + f_LO, or f_RX = f_IF - f_LOwhichmeans increasing LO frequency means decreasing RX frequency (the counterwill seem to "run backwards" but that's no mistake).
Example for DL2YEO's 30 meter band QRPtransceiver: f_RX = f_LO - f_IF = 14.314 MHz - 4.194 MHz= 10.120 MHz,which is the calculation inside the counter (f_LO=measured input, f_RX=displayvalue, f_IF=programmed offset). If you don't need the 10-MHz-digit on thedisplay, set the offset to -14.194 MHz instead of -4.194 MHz. This will givebetter display resolution, so you only need 4 digits (f_RX=10.120 MHz willbe displayed as 120.0 kHz, which is sufficient because the receiver's tuningrange is only 20 kHz anyway).

Some commonly used IF frequencies can be recalled from the "Table" menu,so you don't have to measure or enter them yourself. In many cases, there is a BFO for the last mixer (at the output of the IF amplifier) which produces a frequency close enough to the desired value.

How it works


Basically the program runs in an endless loop, with the exception of theinitial lamp test, programming mode, and power-saving mode which are notexplained here. In the main loop the following steps are performed:
  1. Prepare a coarse frequency measurement for the automatic range switching: Program the asynchronous prescaler to divide by 64, so the highest external frequencies can be detected (theoretically 64 MHz, but this exceeds the PIC's specification).

  2. Count the input pulses for 1/16 second, using the PIC's TIMER0 module in counter mode. During this time, the display multiplexer keeps running. In fact, the counting loop takes exactly 50 microseconds, including the multiplexer routine. 1250 counting loops result in a gate time of 1/16 seconds.
    In the sourcecode, this is done in the subroutine 'count_pulses'.

  3. Decide which prescaler and which measuring interval should be used, depending on the coarse frequency measurement from step 2.

  4. Reprogram the counter's prescaler so the divided input frequency is below 1 MHz (which is the maximum input frequency for the hardware counter, if the PIC is clocked with 4 MHz).
    If the coarse measured frequency is way below 1 MHz, the prescaler is turned off to get the best possible frequency resolution.

  5. Count the pulses during the measuring interval (alias gate time), which is 0.25, 0.5, or 1 second. During this time, the display multiplexer keeps running. Overflows of the 8-bit timer register ("hardware") are counted by software in two other 8-bit registers, so the effective pulse counter has 24 bits (8 hardware bits plus 16 software bits while counting).

  6. Gate time finished -> stop counting pulses.

  7. If the hardware prescaler was active while counting (see step 4), multiply the pulse count with the prescaler ratio so we don't have to care for the prescaler setting in the following steps.
    If you know a bit about assembler programming: The multiplicator is always a power of two, so instead of a multiplication, the pulse count value (now expanded to 32 bit) is shifted left which is much easier on a PIC.

  8. If the gate time was 0.5 seconds, multiply the pulse count by 2; if the gate time was 0.25 seconds, multiply the pulse count by 4. The result is the input frequency in Hertz, no matter which prescaler ratio or gate time was used. Like in the previous step, this "multiplication" is in fact a simple bit-shifting operation.

  9. (Optional) Add the programmed frequency offset. If the result is negative, make it positive.

  10. Split the frequency into eight (!) decimal digits. This is tricky with a PIC, see sourcecode. It is realized by repeatedly subtracting powers of ten from the 32-bit frequency value, beginning with ten millions (because the highest, theoreticallypossible frequency is 64 MHz).

  11. Skip leading zeroes, and insert a decimal point after the kHz- or MHz digit (the kHz-point is ANDed with a blink flag)

  12. Beginning with the first non-zero digit, convert five digits from binary code into seven-segment-patterns, and copy the result into the "display registers". The display multiplex routine which is executed while counting will write these registers to the LED display in steps 2 and 5 of the next main loop.

  13. Poll the 'programming function' input ("RA5"). If this digital input is low, enter programming mode (not explained here). If not, go to step 1 to begin the next measurement.

Sounds tricky ? Well, you don't have to understand the internal functionas long as you don't want to modify the firmware !

Links and other people's frequency counters

The DL-QRP AG use this counter in their "Super Dipper" (an interesting principleby the way). A description of the dipper -which contains the counter andpreamp schematics- is available onlinehere. Thefrequency counter is on a separate PCB, which is available as a kit fromthe DL-QRP-AG, seewww.qrpproject.de/UK/DL4YHFcounter.html. Later, a second version with smaller display board is available; ideallysuited for small monoband QRP transceivers. Unfortunately the QRP-shop (www.qrp-shop.biz) closed at the end of 2022, so neither the "Super Dipper" not the digital counter for Miss Mosquita can be ordered as a kit from their site anymore.

My own counter prototype still does a nice job inMiss Mosquita (a neat littleQRP transceiver). A short description of the counter in german language ishere .

In 2022, Aniello (IU8NQI) ported the PIC assembler sourcecode from the old MPASM syntax (PIC assembler used with MPLAB, not MPLAB-X) to Microchip's "pic-as" (assembler used with MPLAB-X, not MPLAB), and added a new intermediate frequency (10.695 MHz) to the IF table.
See github.com/StarNiell/PIC16F628A_AS_DL4YHF.X for details, and the github repo with modified sources and hex file.

In 2018, Harry Lythall (SM0VPO) created a new circuit board and simplified variant (without the pushbutton for programmable offsets) for his students. The project is described on Harry's site (on his main site, it's under projects / useful circuits / PIC Freq Counter). The boards for display and CPU are separated for flexibility, and there's a display board for some nice large high-efficiency 14-mm high 7-segment displays.

In 2017, Nigel Kendrick modified the counter firmware to use an oscillator module rather than a simple crystal. This freed another I/O pin, so the fifth digit can now be driven without the discrete NAND-gate (transistor with diodes). The modified sources are available on Nigel's Github repository.

In 2011, Krzysztof (SQ3NQJ), madethis variant of the counter firmware.It can be used with an external prescaler (divide by a power of two), to allowfrequency measurements up to several hundred MHz (as much as the externalprescaler allows). The external prescaler ratio can be configured in a new entry in the counter's setup menu. Thanks Krzysztof - several users had asked for such a feature !
Since Krzysztof's provider disappeared and the above link doesn't work anymore, use this backup (copy) instead.

Don, KC7ZOW, has moredetailed constructionnotes, and screenshots of the config mode which may help you troubleshootingthe display.

Erich, VK5HSE, added support for other crystal oscillator frequencies in his firmware variant. In July 2015, his modifications could be downloaded from github.com/erichVK5/DL4YHF-FrequencyCounterVK5Mods, along with Gerber data for a printed circuit board.

Lutz (DK3WI) built a portable counter which he describeshere(in german language) .

Richard (VA3NDO) has some photos of his counter onhiswebsite. Like all the others mentioned below, his board looks much cleanerthan my prototype !

V. Kocka-Amort made a variant with a divide-by-four prescaler, using 74AC74high-speed flip-flops, Schmitt-Trigger inputs, and a preamplifier with BFS17A.The circuit diagram, PCB (for Eagle Version 5.9.0 'free edition'), modifiedfirmware, and photos are in this zippedarchive. It was tested up to 172 MHz, but may possibly work up to 200MHz.

Lukasz (SQ2DYL) made a nice PCB for the counter, and translated the descriptioninto Polish language. His project can be found on thiswebsite of the SP-QRP group.

Renato (PY2RLM) made his own PCB of the keyer, which is a bit larger thanmine but has everything on the board (not using the resistors as 'wires'between CPU and the display. The link to his website ishere.

Jose Renato (PU2VFW) pointed me to thissite with an articlein portugese language. It contains a number of photos of the PCB, and theassembed kit.

Luciano, PY2BBS, putuphis site in2010 with updated plans - also in portugese language, including Renaud's6-digit variant (see below).

Rahul (VU3WJM) created a new, single-sided PCB for the counter with 5 digits.He kindly made his layout available: You can download thecopper tracks, thecomponent overlay (with component values),and the solder stop mask as PDF files from here.(Note: the transistor drives the first digit, not the last one; but I don'thave an up-to-date design).

Renaud (F8FII) made a modified version of the counterwhich drives 6 digits, for the expense of the auto-ranging function (it usesthe former decimal point output to drive the extra digit; the decimal pointson Renaud's display are hard-wired). Description of the modified hardware,and the modified firmware are onF8FII's website.

Jaak built this counter,with a more sensitive input amplifier using an NE592 .

Jan Panteltjie modified the counter firmware to send the measured frequencythrough the RS-232 port. Details are onJan'swebsite.

Joe (K3JLS) built a counter for his Century 21 transceiver - see picturesand description on hiswebsite .

Shig (JA1XRQ) translated the manual, and the construction details, into Japanese. The translated document is available in PDF format on his website.

Andrew (ZL2PD) has notes about the updated '5-digit frequency counter and crystal tester' widely sold as a kit from China. He also made a nice 3D printed enclosure for the kit, so check his website at zl2pd.com/xtalchecker.html.

Chetan (KG6NFG) built the counter with a single 4-digit module. Here aretwo pictures of his counter :

Frequency counter with PIC and 4- to 5-digit LED display (12)

... and here how it glows in the dark :o)

Frequency counter with PIC and 4- to 5-digit LED display (13)

'Anonymous clones' of the DL4YHF frequency counter on Ebay


Since 2016, there seem to be other 'successful builders', selling almost 1:1 reproductionsof the 'DL4YHF counter' on Ebay & Co (some with the minor addition of a simple crystal test oscillator).I don't mind doing that, as long as those kits are offered for a fair price (which they were, at least in February and November 2016). But unfortunately all those kit makers / sellers "forgot" to leave a note about the original developer and where they "found"the sourcecode, firmware, and original circuit diagram.
If you found this sitein a search engine, looking for...
  • "1Hz-50MHz Digital LED DIY Kits Crystal Oscillator Frequency Counter Tester"by "Banggood", or
  • "DIY Kits 1Hz-50MHz Crystal Oscillator Frequency Counter Meter" from "SainSmart", or
  • "TOOGOO(R) 50 MHz Quarzoszillator Frequenzzaehler Tester DIY Kit", or
  • "KKmoon Frequenzmesser Frequenzzähler Hohe Empfindlichkeit", and finally
  • "Frequenzzähler/Quarztester DIY Kit (Bausatz)", DARC Verlag GmbH, Baunatal, Germany,
you will know the rest of the story.
If you have problems with the kits mentioned above: Please don't ask me to help you out, if there is something wrong with the counter (or the firmware), or have trouble getting the cloned kit to work. In some cases, the PICs had been programmed erratically, with non-functional data EEPROM, not being programmed at all,or the kit was delivered with the wrong seven-segment displays.
The "Crystal Oscillator / Quarzoszillator Tester Kit" sold on Ebay/Amazon/etc by "Banggood"/"Sainsmart"/"TOOGOO"/etc etc seems to directly expose the PIC's frequency counter input to the 'outside world' without any protection, and without any preamplifier. I can only speculate that some of the "developers" of the various clones didn't read the original article carefully enough (so far, only 'KKmoon' / 'Frequenzmesser Hohe Empfindlichkeit' seems to have realized the importance of the preamplifiers, which not only boosts the input level but also limits the input voltage to a safe level for the PIC). Thus, the following warning may, or may not, apply to the kit you bought for less than 5 Euros:
The input level of any signal input to the PIC (microcontroller) may only range from 0 Volts (= ground) to the supply voltage, i.e. 5 Volts. But this is only true if the PIC is really supplied with 5 Volts (I don't know, I never bought any of these kits). If the supply voltage is only 3 or 4 Volts from a battery, but 5 Volts are fed to the PIC's counter input - ZAP ! A body diode conducts, and if the current isn't limited, it causes a Latch-up, in other words: R.I.P. my dear little chip). Anything more negative than 0 Volt, and anything more positive than the PICs supply voltage can instantly kill the chip !
Again, to clarify this: I (Wolfgang "Wolf" Büscher, amateur radio callsign DL4YHF) am not the kit maker or -seller, but the developer of the original circuit, and (more important for the entire project) the firmware that makes the PICact as an auto-ranging frequency meter.
Frequency counter with PIC and 4- to 5-digit LED display (2024)
Top Articles
Latest Posts
Article information

Author: Carmelo Roob

Last Updated:

Views: 6640

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.