Confessions Of A Reformed Frequency Standard Nut

Do you remember your first instrument, the first device you used to measure something? Perhaps it was a ruler at primary school, and you were taught to see distance in terms of centimetres or inches. Before too long you learned that these units are only useful for the roughest of jobs, and graduated to millimetres, or sixteenths of an inch. Eventually as you grew older you would have been introduced to the Vernier caliper and the micrometer screw gauge, and suddenly fractions of a millimetre, or thousandths of an inch became your currency.  There is a seduction to measurement, something that draws you in until it becomes an obsession.

Every field has its obsessives, and maybe there are bakers seeking the perfect cup of flour somewhere out there, but those in our community will probably focus on quantities like time and frequency. You will know them by their benches surrounded by frequency standards and atomic clocks, and their constant talk of parts per billion, and of calibration. I can speak with authority on this matter, for I used to be one of them in a small way; I am a reformed frequency standard nut.

That Annoying Final Counter Digit

Tuned circuits in a radio IF transformer. Chetvorno [CC0].
Tuned circuits in a radio IF transformer. Chetvorno [CC0].
You might ask how such an obsession might develop. After all, who needs a frequency standard accurate to an extremely tiny fraction of a Hz on their bench? The answer is that, unless your job depends upon it, you don’t. If you are a radio amateur, you really only need a standard good enough to ensure that you are within the band you are licensed to transmit upon, and able to stay on the frequency you choose without drifting away. But of course such sensible considerations don’t matter. If you’ve bought a frequency counter, you have an instrument with nagging seventh and eighth digits that show you how fast that crystal oscillator you thought was pretty stable is drifting. And there you are, teetering on the edge of that slippery slope.

The first electronic radio frequency oscillators used turned circuits, combinations of inductors and capacitors, to provide their frequency stability. A tuned circuit oscillator can be surprisingly stable once it has settled down, but it is still at the mercy of the thermal properties of the materials used in that tuned circuit. If the temperature goes up, the wire in the inductor expands, and its inductance changes. Older broadcast radios sometimes required constant manual retuning because of this, and very few radio transmitters rely on these circuits for their stability.

The answer to tuned circuit instability came in the form of piezoelectric quartz crystals. These will form a resonator with similar electrical properties to a tuned circuit, but with a much lower susceptibility to temperature-induced drift. They are stable enough that they have become the ubiquitous frequency standard behind most of today’s electronics: almost every microprocessor, microcontroller, or other synchronous circuit you will use is likely to derive its clock from a quartz crystal. Your 1957 FM radio might have needed a bit of tuning to stay on station, but its 2017 equivalent is rock-stable thanks to a crystal providing the reference for its tuning synthesiser.

A crystal oven installed in a Hewlett-Packard frequency counter. Yngvarr [CC BY-SA 3.0].
A crystal oven installed in a Hewlett-Packard frequency counter. Yngvarr [CC BY-SA 3.0].
Crystals are good — good enough for most everyday frequency reference purposes — but they are not without their problems. They may be less susceptible than a tuned circuit to temperature-induced drift but they still exhibit some. And while they are factory-tuned to a particular frequency they do not in reality oscillate at exactly that frequency. Crystal oscillators seeking that extra bit of accuracy will therefore reduce drift by placing the crystal in a temperature-regulated oven, and will often provide some means of making a minor adjustment to the frequency of oscillation in the form of a small variable capacitor.

If you have a crystal oscillator in an oven, you’re doing pretty well. You’ve reduced drift as far as you can, and you’ve adjusted it to the frequency you want. But of course, you can’t truly satisfy the last part of that sentence, because you lack the ability to measure frequency accurately enough. Your trusty frequency counter isn’t as trusty once you remember that its internal reference is simply another quartz crystal, so in essence you are just comparing two crystals of equivalent stability. How can you trust your counter?

At this point, we’re done with frequency standards based on physical dimensions of materials, and have to move up a level into the realm of atomic physics. All elements exhibit resonant frequencies that are fundamentals of the energy levels in their atomic structure, and these represent the most stable reference frequencies available: those against which our standard definitions of time and frequency are measured. There are a variety of atomic standards at the disposal of metrologists with large budgets, but the ones we will most commonly encounter use either caesium, or rubidium atoms. The caesium standard forms the basis of the international definition of time and frequency, while rubidium standards are a more affordable and accessible form of atomic standard.

Raise Your Own Standard

My trusty Heathkit crystal calibrator.
My trusty Heathkit crystal calibrator.

One of the oldest and simplest ways to calibrate an oscillator to a standard frequency is to perform the task against that of a broadcast radio transmitter. You will hear an audible beat tone in the speaker of a receiver when the frequency of the oscillator or one of its harmonics is close enough to the station for their difference to be in the audible range, so it is a simple task to adjust the oscillator to the point at which the beat frequency stops. The lower frequency limit of human hearing allows a match to within a few tens of hertz, and a closer match can be achieved with the help of an oscilloscope.

A 100 kHz crystal calibration oscillator used to be a standard part of a radio amateur’s arsenal, and it could be matched to any suitable broadcast frequency standard worldwide. For a Brit like me back in the day it was convenient to use the caesium standard BBC Radio 4 long wave transmitter on 200 kHz to calibrate my 100 kHz oscillator, but sadly for me in 1988 when the ink was barely dry on my licence they reorganised long wave frequencies and moved it to 198 kHz.

When I was at the height of my quest for a pure frequency standard, the next most accessible source was to take a broadcast standard and use that as the reference source to discipline a crystal oscillator by means of a phase-locked loop. You could buy off-air frequency standard receivers as laboratory instruments, but as an impoverished student I opted to build my own.

Here in the UK, I had the choice of the aforementioned 198 kHz Radio 4 transmitter or the 60 kHz British MSF time signal, and I chose the former as I could cannibalise a long wave broadcast receiver for a suitable ready-wound ferrite rod antenna. This fed an FET front-end, which in turn fed a limiter and filter that provided a Schmitt trigger with what it needed to create a 198 kHz logic level square wave. Then with a combination of 74-series logic dividers and the ever-versatile 4046 PLL chip I was able to lock a 1 MHz crystal oscillator to it, and be happy that I’d created the ultimate in frequency standards. Except I hadn’t really. Despite learning a lot about PLLs and choosing a long time constant for my loop filter, I must have had an unacceptably high phase noise. Not the only time my youthful belief in my own work exceeded the reality.

A handy GPS module from Adafruit. Oomlout [CC BY-SA 2.0]
A handy GPS module from Adafruit. Oomlout [CC BY-SA 2.0]
Off-air standards are still an accessible option for the would-be frequency afficionado, but it is rather improbable that you would build one in 2017 because a far better option now exists. The network of GPS and similar navigation satellites is an accessible source of high-accuracy timing for everybody, with a multitude of affordable GPS hardware for all purposes. Thus it is simpler by far to opt for a GPS-disciplined crystal oscillator, and indeed we have seen them from time to time being used in the projects featured here.

GPS is very good, and the only way to get fancier is to go atomic. The once-impossible dream of having your own atomic standard is now surprisingly affordable, as the proliferation of mobile phone networks led to a large number of rubidium standards being deployed in their towers. As earlier generations of cell towers have been decommissioned, these components have found their way onto the second-hand market, and can be had from the usual sources without the requirement to mortgage your children.

The modules you can easily buy contain a crystal oscillator disciplined by reference to the rubidium standard itself. The standard monitors the intensity of monochromatic light from a rubidium lamp through a chamber of rubidium gas exposed to radio frequency matching the resonant frequency of the transition between ground states of the rubidium atom, and locks the radio frequency to the resonance observed as a dip in that intensity.

Seekers of the ultimate in standard frequency accuracy now have several options when it comes to calibration sources. Making an off-air standard is more trouble than a GPS-based one, and the more adventurous among you can find a rubidium-disciplined source. Or perhaps you already have. There’s no shame in excess precision, but we’re curious: do you really need such an accurate source of timing information? Or are you chasing that last digit just because it’s there?

A Gas Model Made of Magnets

Magnets are great stuff and everyone loves them, there are so many things you can do with them, including creating a model of the crystalline structure of solids, just as [Cody´s Lab] did using a bunch of magnets inside a pair of plexiglass sheets.

Crystal structure of ice. Image from Wikemedia Commons.

Many materials have their atoms arranged in a highly ordered microscopic structure — a crystal — including most metals, rocks, ceramics and ice, among others. The structure emerges when the material solidifies looking for the minimum energy configuration. Every atom interacts with its neighbors via microscopic forces forming several patterns depending on the specific material and conditions.

In his macroscopic world, [Cody´s Lab] used the magnets as his “atoms” and the magnetic repulsion between them represent the microscopic forces. Confining the magnets inside two transparent walls, one can see the formation of the crystal structure as magnets are added one by one.

This is an excellent teaching resource and also a fun way to play with magnets if you want to give it a try. Or if you want another magnet hack, we have tons of them, including implanting them in your body, or making your own with 3D printing.

Continue reading “A Gas Model Made of Magnets”

So Long, and Thanks for all the Crystals

There was a time when anyone involved with radio transmitting — ham operators, CB’ers, scanner enthusiasts, or remote control model fans — had a collection of crystals. Before frequency synthesis, became popular, this was the best way to set an accurate frequency. At one time, these were commonly available, and there were many places to order custom cut crystals.

One of the best-known US manufacturers of quartz crystals still around is International Crystal Manufacturing (ICM). Well, that is, until now. ICM recently announced they were ceasing operations after 66 years. They expect to completely shut down by May.

In a letter on their website, Royden Freeland Jr. (the founder’s son), committed to fulfilling existing orders and possibly taking some new orders, raw materials permitting. The company started making products out of Freeland’s father’s garage in 1950.

Another big name that might still be around is Jan Crystals. We say might, because although their website is live, there’s not much there and the phone number is not quite disconnected but it is “parked.” There are also some posts on the Internet (where everything is true) indicating they are out of business.

Even if you didn’t do radio work, crystals are a staple in digital systems where an accurate clock is necessary and some types of filters, too. Of course, you can still get them, you just may not be able to get them made in the United States soon.

If you want to know more about the technology behind crystals [Jenny] has you covered. Crystals are one of those things that have not changed much in a long time, so you might enjoy the very 1960’s vintage U. S. Air Force training film below.

Continue reading “So Long, and Thanks for all the Crystals”

Understanding The Quartz Crystal Resonator

Accurate timing is one of the most basic requirements for so much of the technology we take for granted, yet how many of us pause to consider the component that enables us to have it? The quartz crystal is our go-to standard when we need an affordable, known, and stable clock frequency for our microprocessors and other digital circuits. Perhaps it’s time we took a closer look at it.

The first electronic oscillators at radio frequencies relied on the electrical properties of tuned circuits featuring inductors and capacitors to keep them on-frequency. Tuned circuits are cheap and easy to produce, however their frequency stability is extremely affected by external factors such as temperature and vibration. Thus an RF oscillator using a tuned circuit can drift by many kHz over the period of its operation, and its timing can not be relied upon. Long before accurate timing was needed for computers, the radio transmitters of the 1920s and 1930s needed to stay on frequency, and considerable effort had to be maintained to keep a tuned-circuit transmitter on-target. The quartz crystal was waiting to swoop in and save us this effort.

Continue reading “Understanding The Quartz Crystal Resonator”

Fail More: The Story of [CNLohr]’s Clear Keytar

[CNLohr] is kinda famous round these parts; due to some very impressive and successful hacks. However, for his 20k subscriber video, he had a bit to say about failure.

Of course glass circuit boards are cool. Linux Minecraft things are also cool. Hacks on the ESP8266 that are impressive enough people thought they were an April Fool’s joke are, admittedly, very cool. (Though, we have to confess, posting on April 1 may have added to the confusion.)  For a guy who puts out so many successes you’d think he’d talk about the next ones planned; hyping up his growing subscriber base in order to reel in those sweet sweet Internet dollars.

Instead he shows us a spectacular failure. We do mean spectacular. It’s got beautiful intricate copper on glass key pads. He came up with clever ways to do the lighting. The circuit is nicely soldered and the acrylic case looks like a glowing crystal. It just never went anywhere and never worked. He got lots of people involved and completely failed to deliver.

However, in the end it was the failure that taught him what he needed to know. He’s since perfected the techniques and skills he lacked when he started this project a time ago. We’ve all had experiences like this, and enjoyed hearing about his. What failure taught you the most?

Continue reading “Fail More: The Story of [CNLohr]’s Clear Keytar”

The (Copper) Crystal Method

One of the staples of kitchen chemistry for kids is making sugar crystals or rock candy. Why not? It is educational and it tastes good, too. [Science with Screens] has a different kind of crystal in mind: copper crystals. You can see the result in the video below.

To grow pure metal crystals, he used copper wire and copper sulfate. He also used a special regulated power supply to create a low voltage to control the current used to form the crystal. The current needed to be no more than 10mA, and an LM317 holds the voltage constant. However, that regulator only goes as low as 1.25V, so diodes cut a volt off the output.

Continue reading “The (Copper) Crystal Method”

Atmel Removes Full-Swing Crystal Oscillator

It is one of our favorite chips, and the brains behind the Arduino UNO and its clones, and it’s getting a tweak (PDF). The ATmega328 and other megaX8-series chips have undergone a subtle design change that probably won’t affect you, but will cause hours of debugging headaches if it does. So here’s your heads-up. The full-swing oscillator driver circuitry is being removed. As always, there’s good news and bad news.

The older ATmega chips had two different crystal drivers, a low-power one that worked for lower speeds, and higher-current version that would make even recalcitrant crystals with fat loading capacitors sing. This “full-swing” crystal driver was good for 16 MHz and up.

The good news about the change is that the low-power crystal driver has been improved to the point that it’ll drive 16 MHz crystals, so you probably don’t need the full-swing driver anymore unless you’re running the chip at 20 MHz (or higher, you naughty little overclocker).

This is tremendously important for Arduinos, for instance, which run a 16 MHz crystal. Can you imagine the public-relations disaster if future Arduinos just stopped working randomly? Unclear is if this is going to ruin building up a perfboard Arduino as shown in the banner image. The full-swing oscillator was so robust that people were getting away with a lot of hacky designs and sub-optimal loading capacitor choices. Will those continue to work? Time will tell.

The bad news is that if you were using the full-swing oscillator to overcome electrical noise in your environment, you’re going to need to resort to an external oscillator instead of a simple crystal. This will increase parts cost, but might be the right thing to do anyway.

Whenever anyone changes your favorite chip, there’s a predictable kerfuffle on the forums. An Atmel representative said they can get you chips with the full-swing driver with a special order code. We’re thinking that they’re not going to let us special order ten chips, though, so we’re going to have to learn to live with the change.

The ATmega328 has already gotten a makeover, and the new version has improved peripheral devices which are certainly welcome. They don’t have the full-swing oscillator onboard, so you can pick some up now and verify if this change is going to be a problem for you or not. We don’t have any of the new chips to test out just yet.

Thanks to [Ido Gendel] for tipping us off to the change in our comment section! If you have any first-hand experience with the new chips, let us know in the comments and send in a tip anytime you trip over something awesome during your Internet travels.