UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Other Discussions > Homebrew Equipment

Notices

Homebrew Equipment A place to show, design and discuss the weird and wonderful electronic creations from the hands of individual members.

Closed Thread
 
Thread Tools
Old 9th Nov 2016, 3:46 pm   #1
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Homebrew frequency counter

A little diversion from the oscilloscope project which is awaiting my patience to return after winding a large transformer for it. I decided I needed a new frequency counter as I'm currently using a DMM with a somewhat low 5 digit resolution, so I scanned the Internet for something with a decent feature set and built one. This is a bit high tech compared to a lot of stuff on here. I was going to build one with 74-series logic and sweat but if I'm honest I couldn't be bothered to wire the whole thing! Plus the one I found has some interesting features including the ability to do some basic mathematical operations on the measured frequency to add or subtract various IFs. It has 10MHz and 455KHz pre-programmed which is very handy. Not something you get on a TTL design.

After some arguments with programming a PIC, something I haven't done for a few years, it works nicely. Construction is dead bug/PCB box style. No prizes for pretty but the RF parts are short and the rest is convenient. Lid is awaiting more FR4 stock. Legend is Inkscape generated with Futura font stuck on with scotch tape.

Build photos below. Please excuse the quality. My DSLR is in for repair so I'm stuck with awful phone camera

Original source: http://www.hamradio.in/circuits/freq_counter_lcd.php. I built the PIC16F628 version as I had some of them on hand already. The original design was from VU3CNS. Highly recommended. Seems to work perfectly.

Note: I had to modify the source code as I had a 16x2 display available only and this was for a 16x1 display. This consisted of naively removing all 0xc0 writes to the display, assembling it and crossing fingers.

Now this got me interested in obtaining a frequency reference so I'm going to go and research PLLs locked to Radio 4!
Attached Thumbnails
Click image for larger version

Name:	fc-1.jpg
Views:	575
Size:	68.4 KB
ID:	132496   Click image for larger version

Name:	fc-2.jpg
Views:	611
Size:	47.6 KB
ID:	132497  
MrBungle is offline  
Old 9th Nov 2016, 10:30 pm   #2
Radio Wrangler
Moderator
 
Radio Wrangler's Avatar
 
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,896
Default Re: Homebrew frequency counter

I'm not sure radio 4 is as closely controlled as it once was. You may be better off with 60kHz from Anthorn, or else something locked to the 1 second ticks from most GPS chipsets.

David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done
Radio Wrangler is offline  
Old 9th Nov 2016, 11:24 pm   #3
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

Its carrier is locked to a rubidium standard still. Good enough and it's pretty good excuse for me to play with PLLs.
MrBungle is offline  
Old 10th Nov 2016, 11:28 am   #4
Al (astral highway)
Dekatron
 
Al (astral highway)'s Avatar
 
Join Date: Nov 2006
Location: London, UK.
Posts: 3,496
Default Re: Homebrew frequency counter

Nice concept and build , like it!! Can you post pix of the readout and front panel when you have them ??

Cheers
__________________
Al
Al (astral highway) is offline  
Old 10th Nov 2016, 11:49 am   #5
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

Yes. Here you go. Signal source (function generator) is set to ~135KHz in all the examples below and the IF is selected as IF 9 (10MHz). Hard coded IFs are supported as follows:

D = direct frequency measurement
0 = 455KHz (AM typical IF)
1 = 4915KHz
2 = 9MHz
3 = 10MHz
4 = 10.7MHz (FM typical IF)
5 = 4333KHz
6 = 10.245MHz
7 = 10MHz
8 = 10MHz
9 = 10MHz

I've picked IF 9 (10MHz) and gate time of 1s for these as it's easy to see it working. You can pick a 125ms gate time at loss of precision.

Mode = >D direct measurement. 125ms gate time VFO = 135KHz.

Click image for larger version

Name:	1.jpg
Views:	330
Size:	29.9 KB
ID:	132546

Mode = >9N IF+VFO, IF = 10MHz, VFO = 135Khz

Click image for larger version

Name:	2.jpg
Views:	199
Size:	30.8 KB
ID:	132547

Mode = >9N VFO-IF, IF = 10MHz, VFO = 135Khz

Click image for larger version

Name:	3.jpg
Views:	296
Size:	31.5 KB
ID:	132548

Mode = >9N IF-VFO, IF = 10MHz, VFO = 135KHz

Click image for larger version

Name:	4.jpg
Views:	289
Size:	31.8 KB
ID:	132549

Mode = >9N IF+VFO, IF = 10MHz, VFO = OFF

Click image for larger version

Name:	5.jpg
Views:	362
Size:	30.0 KB
ID:	132550
MrBungle is offline  
Old 10th Nov 2016, 5:21 pm   #6
kellys_eye
Octode
 
Join Date: Jan 2014
Location: Oban, Scotland, UK.
Posts: 1,129
Default Re: Homebrew frequency counter

Very nice project. I admire your skills with circuit-board casing!

It is certainly a good project for those not yet converse with using PIC processors and the methods used to program them.

The website of the original article also has a DDS VFO project. I've built a cut-down version of it (using only the rotary encoder, no keyboard) to make an RF signal generator. Works very well.

Working my way through their other articles right now!
kellys_eye is offline  
Old 10th Nov 2016, 5:38 pm   #7
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

It looks better in the photos

I only had a serial programmer and no serial ports so had to bodge a programmer with an arduino and some other hacks. I don't recommend this but it worked.

Interesting with the DDS. I'm in the process of breadboarding an RF generator but fully analogue. Just waiting for my spectrum comms delivery for the tuning capacitors. Didn't fancy dealing with a DDS stack after the counter as my day job is software and that makes it a busman's holiday.

Last edited by MrBungle; 10th Nov 2016 at 5:52 pm.
MrBungle is offline  
Old 11th Nov 2016, 12:54 pm   #8
kellys_eye
Octode
 
Join Date: Jan 2014
Location: Oban, Scotland, UK.
Posts: 1,129
Default Re: Homebrew frequency counter

Fortunately my DDS VFO conversion doesn't involve any changes to the original programming - simply don't fit the unused parts (keyboard, second PIC etc) and use the rotary encoder to select the required digit to increment/decrement and then 'push-to-set' !!!

A simple 50ohm manually switched 1-2-4-8.... resistive attenuator and Robert's your mother's brother.

If/when I get around to it I'll add my own VCA and properly calibrate the output.

I hate unnecessary complications!
kellys_eye is offline  
Old 11th Nov 2016, 1:28 pm   #9
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

I'll take a look at the design actually. It might be less frustrating and more stable than a traditional tuned circuit. I've almost got a working generator on the bench but annoyingly i managed to design the ranges badly so I've got a range break right at 10MHz in the middle of an IF which makes filter sweeps difficult. Back to the drawing board!

Switched attenuator is next project. Plan is to get this to kick out constant 10dBm with an AGC circuit and then attenuate what I need off.
MrBungle is offline  
Old 11th Nov 2016, 8:40 pm   #10
G0HZU_JMR
Dekatron
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 3,077
Default Re: Homebrew frequency counter

There was a similar '628 PIC based counter in Radcom a few years ago By Eamon Skelton and this had an 8 digit display, an 80MHz range and resolved down to 1Hz with a 1 second gate time. It might be worth a look if you want the extra digit and resolution? It uses the same PIC chip.

http://homepage.eircom.net/~ei9gq/counter.html

Quote:
Now this got me interested in obtaining a frequency reference so I'm going to go and research PLLs locked to Radio 4!
I designed and built my own offair standard about 25 years ago for 198kHz R4 and it is still working fine today. It has a homebrew 10MHz VCXO inside that locks to the 198kHz signal from R4 using a tuned receiver, and a crude PLL circuit. For the first 20 years or so it lived loosely in a cardboard shoebox as a storage box or 'enclosure' as it never got past the ugly prototype stage. I built it dead bug style on some old scrap PCB sections.

However, a few years ago I finally upgraded it to an enclosure made from an ice cream tub The same two ugly prototype PCBs are in there but I did clean all the dust off it and tidy the PCB layout a bit. It works very well and it takes less than 1 minute to lock to within about +/- 0.02Hz of 10MHz (typical).

If I average the readings over a longer time it can deliver better performance than this but I am happy with a quick plug/play readout within 0.02Hz of 10MHz. I use it maybe once or twice a year to check all the OCXO references in my RF test gear. I don't use it as a 'real' day to day reference to control/lock all my RF test gear as it's too noisy for one thing and I just use it to check stuff annually.
__________________
Regards, Jeremy G0HZU
G0HZU_JMR is offline  
Old 11th Nov 2016, 10:00 pm   #11
jimmc101
Heptode
 
jimmc101's Avatar
 
Join Date: Mar 2009
Location: Portsmouth, Hampshire, UK.
Posts: 674
Default Re: Homebrew frequency counter

It makes me realise how fast time flies when I remember that most of the PIC based counters are based on a Microchip application note published nearly twenty years ago. (AN592 - Frequency Counter Using PIC16C5x).

Jim
jimmc101 is offline  
Old 11th Nov 2016, 11:13 pm   #12
Radio Wrangler
Moderator
 
Radio Wrangler's Avatar
 
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,896
Default Re: Homebrew frequency counter

There's always the PW 'Robin' counter project.... by a certain Swordholder once of these pages and sadly missed.

David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done
Radio Wrangler is offline  
Old 11th Nov 2016, 11:35 pm   #13
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

I saw the PW Robin counter design. That was where I started but I couldn't trade off the design with a cheap PIC. It's a remarkable piece of equipment however. Sad to hear that the creator is no longer with us.

AN592 was actually inspiration for this incarnation many years ago, I think around 1998. Unfortunately quashed by lack of funds and time and the destruction of a serial port by a poorly constructed JDM programmer (oops!). I found a reference to it in a notebook from back then and decided to have a look around for similar projects as things must have improved. Turns out they had!

Quote:
Originally Posted by G0HZU_JMR View Post
There was a similar '628 PIC based counter in Radcom a few years ago By Eamon Skelton and this had an 8 digit display, an 80MHz range and resolved down to 1Hz with a 1 second gate time. It might be worth a look if you want the extra digit and resolution? It uses the same PIC chip.

http://homepage.eircom.net/~ei9gq/counter.html
Interesting. Lots of similarities to this design. Very minimalist thanks to the nice async timers in the PIC. I've managed to get 40MHz out of this with a TTL oscillator module I had lying around and it does a full 8 digit count with 1Hz resolution. I am only interested in the HF spectrum at the moment so as long as I'm good to 30MHz for now I'm good. I can prescale anything higher later for version 2. I've actually got a design in my head for a slightly better one using a Cypress PSoC with ARM core in the future when time allows but that's getting a little too close to the day job.

Quote:
Originally Posted by G0HZU_JMR View Post
Quote:
Now this got me interested in obtaining a frequency reference so I'm going to go and research PLLs locked to Radio 4!
I designed and built my own offair standard about 25 years ago for 198kHz R4 and it is still working fine today. It has a homebrew 10MHz VCXO inside that locks to the 198kHz signal from R4 using a tuned receiver, and a crude PLL circuit. For the first 20 years or so it lived loosely in a cardboard shoebox as a storage box or 'enclosure' as it never got past the ugly prototype stage. I built it dead bug style on some old scrap PCB sections.

However, a few years ago I finally upgraded it to an enclosure made from an ice cream tub The same two ugly prototype PCBs are in there but I did clean all the dust off it and tidy the PCB layout a bit. It works very well and it takes less than 1 minute to lock to within about +/- 0.02Hz of 10MHz (typical).

If I average the readings over a longer time it can deliver better performance than this but I am happy with a quick plug/play readout within 0.02Hz of 10MHz. I use it maybe once or twice a year to check all the OCXO references in my RF test gear. I don't use it as a 'real' day to day reference to control/lock all my RF test gear as it's too noisy for one thing and I just use it to check stuff annually.
That sounds excellent. It's roughly like what I'm heading towards actually. I've sketched a few ideas so far. Nothing breadboarded yet. I have lots of respect for your enclosures - most of my stuff ends up in poundland tupperware!

On that subject, I have my head in a 1st edition copy of Art of Electronics reading about PLLs at the moment. They have a lab experiment in the accompanying lab manual that gives you a full rundown of building a PLL based frequency multiplier with a 4020 and a 4046. I am awaiting an RS delivery on Monday to play with this idea.

Last edited by MrBungle; 11th Nov 2016 at 11:40 pm.
MrBungle is offline  
Old 12th Nov 2016, 4:47 pm   #14
G0HZU_JMR
Dekatron
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 3,077
Default Re: Homebrew frequency counter

There are a few niggles with respect to the design of this type of offair standard which you probably already know but I'll list them anyway.

The R4 signal is modulated with AM and other LF information and this means it can be difficult to design a loop filter that can cope with this and settle reliably. It took me quite a few attempts to find the right filter. Also, the lock performance varies depending on the time of day. During the day my offair std generally performs at its best but there can be times in late afternoon and into the evening where it really struggles to settle reliably. So I tend to choose my moment to use it depending on reception quality. I only live about 25 miles from the transmitter which helps but even then the performance can suffer under certain conditions. Also, the performance can degrade if there are any modern gadgets like laptop or camera PSU/chargers or modern lamps running.

I designed my offair standard as a crude experiment back in about 1991/2 to see if I could hard limit the signal enough to get a stable lock. So my system consists of a tuned ferrite rod antenna, a JFET preamp followed by a tight BPF made from high Q RM4 based inductors and then another amp and hard limiter ahead of a comparator. This then feeds a /99 divider made from a HEF4059 programmable divider and the PLL is a classic 4046 with a PD freq of 2kHz and I used 74HC390 dividers to divide the 10MHz VCXO down to 2kHz.

At the time some of my more experienced colleagues reckoned it would never work but I tried and it worked well enough for my needs. At the time I just needed to check my counter at home was within a few Hz of 10MHz to prove I could adjust a typical ham/CB radio to be on frequency. The performance turned out to be much better than this once I'd spent some time messing with various loop filter settings. The idea was always to make a neat/proper version in a decent enclosure but it never happened. I just kept it in a cardboard box and dug it out once a year and usually it worked OK unless a wire fell off. It was just a fragile prototype after all. Now that it is in the ice cream tub I think I will never bother to make the neat/proper version. It has been very reliable since it found its new home (sponsored by Walls ice cream).
__________________
Regards, Jeremy G0HZU

Last edited by G0HZU_JMR; 12th Nov 2016 at 5:02 pm.
G0HZU_JMR is offline  
Old 12th Nov 2016, 6:55 pm   #15
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

I'm listening. Any gotchas and dragons I'd like to know about beforehand so any pointers are indeed appreciated. Thanks for the tip regarding the radio data. I'm not sure what phase shift modulation will do to this. I'm not after extreme accuracy (a couple of Hz either way is fine) but confidence in the measurements I'm making with the counter.

That's pretty close to the design I did on paper this morning actually. I dumped the 4046 idea as the max frequency is getting a bit tight on that series of CMOS devices. Therefore I've now got a 1MHz crystal tunable with a varactor, or a 36v zener pretending to be a varactor with some fingers crossed about the tuning linearity! The frequency divider does a /5, /10, /10 with a couple of 74hc390's and this is mixed with the carrier. Loop filter I will play with at the time of construction. Phase detector; it looks like you can get away with a 74hc00 for that. I still need to fully understand how that works. The RX is a simple TRF with ferrite antenna with a TA7642 (ZN414 clone) being the brains of the outfit. I built one a few years back that worked here in London.

Unfortunately I'm allergic to lactose so no tubs of Walls for enclosures for me

On the subject of the counter, I'm actually redesigning the front end. The current one has a slightly unpredictable and low impedance input. I've designed a FET follower, amplifier and schmitt trigger in LTspice that appears to be good to about 75MHz and is slightly more sensitive (50mV instead of 160mV) with a constant 1M impedance. I'll document that when it works.
MrBungle is offline  
Old 13th Nov 2016, 12:49 am   #16
Radio Wrangler
Moderator
 
Radio Wrangler's Avatar
 
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,896
Default Re: Homebrew frequency counter

74HC4046 is a substantially faster part.

The VCOs in these things are pretty low-Q and noisy, but if you're only using it for the phase/frequency detector, then it's no problem.

David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done
Radio Wrangler is offline  
Old 13th Nov 2016, 12:57 am   #17
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

I had no idea there was a 74hc version of that. Will investigate. Thanks for the pointer.
MrBungle is offline  
Old 13th Nov 2016, 1:38 am   #18
G0HZU_JMR
Dekatron
 
Join Date: Sep 2010
Location: Cheltenham, Gloucestershire, UK.
Posts: 3,077
Default Re: Homebrew frequency counter

Yes, I used the 74HC4046 version of the 4046 in my offair standard. Also I used the HC versions of the 390 counters. The HEF4059 was an old device that could be programmed to divide by 99 using pullup/pulldowns to its parallel interface. So no need to have a micro to program it as it could be hard programmed to /99. I looked back through my records and I put it into the ice cream tub about 3.5 years ago. See below for a plot from last year when I logged the stability over several minutes.

This is a typical 'daytime' result. At night or if there are strange conditions it can be several times worse than this. But during the day it normally wobbles up and down as per the graph below. i.e. it usually stays within 0.04Hz and often stays within 0.02Hz of 10MHz. But you do sometimes get an erratic step away from 10MHz as you can see in the plot below. This is easily good enough for my needs.
Attached Thumbnails
Click image for larger version

Name:	offair_stability.jpg
Views:	229
Size:	42.3 KB
ID:	132722  
__________________
Regards, Jeremy G0HZU
G0HZU_JMR is offline  
Old 12th Dec 2016, 2:58 pm   #19
MrBungle
Dekatron
 
MrBungle's Avatar
 
Join Date: Jun 2016
Location: London, UK.
Posts: 3,687
Default Re: Homebrew frequency counter

That's actually quite amazingly stable. I've scrapped this idea in the short term as I've got my hands on a rather nice OCXO based counter which is good enough for what I need at the moment, especially as I've managed to beg a free cal against a rubidium standard with it

Back on the subject of frequency counters, after spending 5 hours on Sunday in the guts of my Marconi 2019A, now driven from the reference output from the above (serendipity at last!), as I've revived the attenuator module! Turned out there was an open resistor which had caused it to drop everything to about -80dBm, not enough to register on this homebrew counter.

So, I spent a few minutes pushing it as hard as possible and I can count reliably up to 27.5MHz with the design as shown above. This is fine for anything below the 10m band and conveniently with approval of SWMBO, living room table material unlike the big daddy counter.
MrBungle is offline  
Old 13th Dec 2016, 6:03 am   #20
Terry_VK5TM
Nonode
 
Terry_VK5TM's Avatar
 
Join Date: Oct 2010
Location: Tintinara, South Australia, Australia
Posts: 2,340
Default Re: Homebrew frequency counter

You might want to check the biasing on the input transistor. the collector should sit at 2.5V (with a 5V supply and no input).

I've built many 16F628 frequency counters and most count reliably to 50MHz (some even higher).

Terry
Terry_VK5TM is online now  
Closed Thread




All times are GMT +1. The time now is 1:14 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.