DIY Equipment - Frequency Counter
Planning Stages
So I was at the local Chinatown electronics dealer, looking around, as I often do. The nice thing about being in this place is that the prices are very reasonable and the staff, while heavily accented, are helpful and friendly. I often go in for a few odds and ends and come out with a boxful of stuff.This was definately one of those days. While looking around, I saw this beautiful little instrument case, sitting in the stack of cases. Smaller than the case I purchased for the Osiris project. About right for a mid-sized instrument.
Well, think I, if I pick up this, and this, oh and a couple of these...
... Anyway, a stretched budget later, I was carrying home a bunch of new parts. As usual, feature creep came into play, so I picked up a nice little 2x18 backlit HD44780 LCD, the case, some switches, a bunch of assorted BNC and banana plug stuff, and a few other odds and ends.
So my first task was to come up with a design. I picked up a protoboard out of my collection (a nice fibreglass one, this time around), and laid out the positions of the IC's.
I decided on a PIC18F1320, almost arbitrarily, since it was the only 18-pin PIC 18F I had on hand. I added a power supply and some sockets for prescaling with standard logic to extend the upper bound on the frequency range.
The board is set up to take a set of LCD headers, a front panel control header, a power input header, and an In-Circuit Serial Programming (ICSP) header to allow programming of the microcontroller in-system, without removing it or even turning it off.
The Enclosure
The next step was, of course, to wire up the front panel controls. I like to make my designs look professional inside and out, and to this end, there are several components often seen in my designs.I use heat-shrink tubing on any junction that makes sense to use it on. In this case, I used it on the LED wires and on the two wires that were spliced instead of simply soldered through. I also use vinyl zip-tie wire ties to bundle cables and keep them from interfering with one another. As for the mauve wire, well, that just looks pretty.
Oh, and the secret to making pre-punched circuit boards mount on pre-punched cases of different spacing is to use a small piece of plexi between the case and the board. Just drill 8 holes, and everything is good.
At this point, the front panel was entirely connected, and the basic menuing system works. The basic framework of the software, including the math code, is all in place. The menu system allows user-configurable backlight setting (extra PWM pins are fun), and several other options which were not completed by this point.
Input Amplifier
The first attempt at an input amplifier was only a partial success, and I will be redesigning it from scratch. The design is relatively straightforward, consisting of a capacitatively coupled clamping net, followed by a class-A BJT amplifier. Unfortunately, the BJT is not biased nor bypassed correctly, and suffers poor gain. Also the clamping leaves much to be desired, as do the resistor ratios.I won't bother posting schematics of this input amp, because you probably don't want to build it. It has poor sensitivity and bad frequency response. Incoming signals have to be over 1Vptp, and it fails to read over 300kHz. That said, it does work, and it let me test the firmware, so it was quite helpful.
The next design will likely operate to a much higher frequency than the device is capable of reading. I'll eventually post more about this later.
LCD Bezel
Finally it was time to add the LCD bezel to the front of the instrument. I had trouble procuring one, so I built one.


