{"id":356,"date":"2017-03-03T18:05:52","date_gmt":"2017-03-03T23:05:52","guid":{"rendered":"http:\/\/www.circuitcrush.com\/?p=356"},"modified":"2021-06-30T21:26:50","modified_gmt":"2021-07-01T01:26:50","slug":"crystal-oscillator-tutorial","status":"publish","type":"post","link":"https:\/\/www.circuitcrush.com\/crystal-oscillator-tutorial\/","title":{"rendered":"Let\u2019s Get Crystal Clear: A Primer on Crystal Oscillators"},"content":{"rendered":"<p>The crystal oscillator is everywhere. The need for precise frequency control sets the stage. Crystals ensure not only accurate timing for microprocessors and microcontrollers, but also in setting the frequencies of any radio or wireless device.<\/p>\n<p>Sure, you can make an oscillator out of capacitors, inductors, and resistors but their limitations are severe.<!--more--> Things like time, temperature, and other physical conditions can wreak havoc on their accuracy, causing the output to drift off frequency. A crystal oscillator is much more stable. We\u2019ll delve more into that soon.<\/p>\n<p>Quartz is the material of choice for most crystals, however, cheaper (albeit less accurate) ceramic resonators can sometimes take the place of quartz in a crystal oscillator.<\/p>\n<p>Crystal oscillators operate on the principle of something called the piezoelectric effect. Let\u2019s go into a bit of detail about the piezoelectric effect.<\/p>\n<h1><strong>What is the Piezoelectric Effect?<\/strong><\/h1>\n<p>First demonstrated in 1880, the piezoelectric effect is an interesting phenomenon. Materials which exhibit a piezoelectric effect are part of a larger class of materials known as ferroelectric ceramics.<\/p>\n<p>Quartz is a crystalline material. Some crystalline materials have unit cells (think of these as the smallest possible \u201ccrystal\u201d within the larger crystal, like splitting a grain of salt to its smallest size before it splits into single atoms) that are not symmetrical. This asymmetry causes small electric dipoles to form.<\/p>\n<p>To get an idea of what the piezoelectric effect looks like on an atomic level, consider the picture below.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-359\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials.jpg\" alt=\"How a piezoelectric material works\" width=\"1017\" height=\"466\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials.jpg 1017w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials-600x275.jpg 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials-150x69.jpg 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials-300x137.jpg 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Piezoelectric-Materials-768x352.jpg 768w\" sizes=\"(max-width: 1017px) 100vw, 1017px\" \/><\/p>\n<p>In this material there will be an excess of positive charge on one end and negative charge on the other. This is due to the polarization, or electric dipoles we talked about earlier.<\/p>\n<p>Section (<em>b<\/em>) of the picture shows the crystal with a mechanical force applied to it. We can also see that the distance <em>d<\/em> between the dipoles is smaller. This changes the charge density at the ends of the crystal, which induces a voltage difference between the ends if they are insulated from each other.<\/p>\n<p>Section (<em>c<\/em>) shows an electric field (voltage) applied across the crystal. This causes the dimensions of the crystal to change (distance <em>d<\/em> is larger in the picture) in the direction of the electric field. Because the positive plate of the battery makes the top more positive and negative plate makes the bottom more negative, the dipoles are stretched. The negative end of the dipoles are attracted to the positive charges and vice versa.<\/p>\n<p>Unfortunately, you cannot look at a crystal with the naked eye and see the size change; this happens on microscopic scales.<\/p>\n<p>In summary, the piezoelectric effect is an electromechanical effect by which mechanical forces on a ferroelectric material (like quartz) produces an electrical response, or electrical forces a mechanical response. Some other common applications for piezoelectric materials are small speakers and igniters on grills and lighters.<\/p>\n<h1><strong>Crystal Oscillator Basics<\/strong><\/h1>\n<p>Now we know that crystals mechanically \u201cvibrate.\u201d The greatest vibration occurs at the crystal\u2019s natural resonant frequency. This is determined by the physical dimensions and by the way the crystal is cut.<\/p>\n<p>Some standard values for crystal oscillators are 100 kHz, 1 MHz, 2 MHz, 4 MHz, 5 MHz, and 10 MHz. The full range of values spans from 10 kHz to 30 MHz.<\/p>\n<p>Manufacturers know how to cut the quartz to optimize its performance to meet certain metrics like frequency, stability, etc. Some common cuts are the X-cut, Y-cut, CT-cut, AT-cut and there are others. Though you likely won\u2019t need to concern yourself with this, it\u2019s good to know.<\/p>\n<p>Crystals usually consist of a quartz wafer mounted between two electrodes. A metal can protects the whole package.<\/p>\n<p>The picture below shows some crystals with the metal can removed. Opening the protective can contaminates the quartz, which ruins the crystals, but it\u2019s interesting to see the inside nonetheless.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-360\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1.jpg\" alt=\"A peek inside a crystal oscillator\" width=\"653\" height=\"495\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1.jpg 792w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1-600x455.jpg 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1-150x114.jpg 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1-300x227.jpg 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Oscillators1-768x582.jpg 768w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/p>\n<p>Crystal oscillators are desirable because they are very stable with time and temperature and also highly selective. They have a very high Q, so the resonant frequencies of the crystal are sharply defined. Recall that the quality, or Q, of a circuit is equal to the bandwidth divided by the center frequency.<\/p>\n<p>You can build a simple crystal oscillator with just a transistor and a crystal, but crystal oscillators that come in one package (like an IC) are more common these days. They\u2019re also cheap, some less than $2.00 in quantities of one. With these units, the crystal is already wired into the on-chip oscillator. All we need to do is apply a DC voltage, then either a sine wave or rectangular wave pops out the other end.<\/p>\n<p>Quartz crystals have two usable resonant frequencies associated with them. One is F<sub>SERIES <\/sub>which &#8212; you guessed it &#8212; is a series resonance. The other is F<sub>PARALLEL <\/sub>and is a little higher in frequency. It also corresponds to a maximum impedance, whereas F<sub>SERIES <\/sub>corresponds to a minimum impedance.<\/p>\n<h3 style=\"text-align: center;\">Become the Maker you were born to be. Try <a href=\"https:\/\/learnarduinonow.com\">Arduino Academy<\/a> for FREE!<\/h3>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-4238\" src=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png\" alt=\"\" width=\"415\" height=\"158\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png 828w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-300x114.png 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-150x57.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-768x292.png 768w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><\/p>\n<p>Note that there isn\u2019t such a thing as a \u201cseries cut\u201d or \u201cparallel cut\u201d crystal. Rather, think of series and parallel as modes of operation instead of a \u201ccut\u201d of some sort. All quartz crystals are capable of resonating in both modes. Crystals (regardless of how they\u2019re cut) are made to be closest to their design frequency with the correct capacitance applied (external to the crystal) and when using the correct mode.<\/p>\n<p>We know that quartz crystal oscillators are very accurate. While a typical RC oscillator has an accuracy of about 0.1% and a typical LC oscillator has an accuracy of about 0.01% (at best), crystal oscillators boast accuracies that range from 0.01 \u2013 0.001 percent.<\/p>\n<p>A crystal&#8217;s error is expressed in parts per million or ppm. For example, a 10 MHz crystal with a deviation of 200 ppm (rather high) has an error of (200\/1,000,000) x 10,000,000 = 2kHz, which is a maximum error of 0.02%. This is an example of a \u201clower-end\u201d crystal.<\/p>\n<h2><strong>Types of Crystal Oscillators<\/strong><\/h2>\n<p>There are many types of crystal oscillators on the market today.<\/p>\n<p>The simplest one is the ordinary XO variety which comes in a fixed frequency with an accuracy of a few hundred parts per million. These crystals are good for non-critical applications like embedded controller clocks.<\/p>\n<p>Then there is the TCXO crystal. TC stands for temperature control. Since crystals are subject to slight frequency changes with temperature, these find their home in more critical applications. Special circuitry inside the oscillator consisting of a thermistor in a feedbaclk loop that drives a varactor corrects the frequency when it drifts. You may find this type in your cell phone.<\/p>\n<p>Yet another type is the VCXO, or voltage controlled crystal oscillator. Applications for this type of crystal include phase-locked loops and frequency multiplication or synthesis.<\/p>\n<p>Another type is the oven-controlled crystal oscillator or the OCXO. This oscillator is built into a thermally enclosed package with a small heating element that cycles on and off under closed loop control to maintain a constant temperature. These find their way into even more critical applications like cell base stations and telecommunications networks.<\/p>\n<h2><strong>The Quartz Crystal Oscillator Equivalent Circuit<\/strong><\/h2>\n<p>The quartz crystal equivalent circuit is a series-parallel RLC circuit like the image below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-361\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Equivalent-circuit-for-quartz-crystal.png\" alt=\"Quartz crystal equivalent circuit\" width=\"407\" height=\"211\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Equivalent-circuit-for-quartz-crystal.png 407w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Equivalent-circuit-for-quartz-crystal-150x78.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Equivalent-circuit-for-quartz-crystal-300x156.png 300w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/p>\n<p>The inductor L<sub>M <\/sub>is typically very high, ranging from 0.1 H to 1 H. Some people refer to C<sub>M <\/sub>as the motional capacitance and it is very low, in the femtofarad range. C<sub>S <\/sub>is simply the parasitic capacitance between the two terminals of the quartz. It is usually a couple of picofarads.<\/p>\n<p>The unusual values of L<sub>M<\/sub> and C<sub>M<\/sub> give us some insight into the accuracy and high-Q of the crystal. To recapitulate, the Q of a circuit is the bandwidth over the series resonant frequency. The extreme values of these components can yield quartz crystals with Q values of 100,000 or more.<\/p>\n<p>If you try to build a similar circuit out of discrete components, you\u2019d run into trouble. Try finding a 1 H inductor with a parasitic capacitance below one femtofarad and you\u2019ll see why.<\/p>\n<h2><strong>Series Resonance and Parallel Resonance<\/strong><\/h2>\n<p>At the series resonant frequency, L<sub>M<\/sub> and C<sub>M <\/sub> cancel leaving only the remaining series resistor, which is usually 100 ohms or less and determines the impedance of the crystal. The series resonant frequency is independent of the parasitic capacitance C<sub>S<\/sub>.<\/p>\n<p>Parallel resonance occurs when the inductive reactance of L<sub>M<\/sub> and the capacitive reactance of C<sub>S <\/sub>are equal, creating a classic LC tank circuit. This frequency is a bit higher (usually at least 1 kHz) than the series resonant frequency, but still close to it. Because of the tank circuit, the impedance of the crystal reaches its maximum value at this point.<\/p>\n<p>The image below specifies F<sub>PARALLEL<\/sub> as F<sub>P<\/sub>; you may also see this written as F<sub>A<\/sub> where the \u201cA\u201d means antiresonant. Technically, the term F<sub>P<\/sub> is reserved for when an external load capacitor is used since this will drop the resonant frequency a bit (more on this in minute). F<sub>A<\/sub> is the parallel resonant frequency without the external capacitor. Because of this, some of the plots you see may contain an F<sub>S<\/sub>, F<sub>P<\/sub>, and an F<sub>A<\/sub>. Don\u2019t let this confuse you. Either way, the values are essentially the same thing with little difference (roughly 0.1%).<\/p>\n<p>Looking below, we can see how the crystal behaves like a capacitor below F<sub>SERIES <\/sub>and more like an inductor above F<sub>SERIES. <\/sub>We can also see how it is purely resistive at F<sub>SERIES<\/sub>, where it crosses the horizontal axis. Notice also the vertical asymptote at F<sub>PARALLEL<\/sub> which suggests that the crystal\u2019s impedance is very high (ideally infinite) when operated in this mode. It\u2019s also interesting to view the graph on the right where we can see the impedance dip at F<sub>SERIES<\/sub> and then peak at F<sub>PARALLEL<\/sub>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-363\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency.jpg\" alt=\"Quartz crystal behavior with frequency\" width=\"853\" height=\"352\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency.jpg 853w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency-600x248.jpg 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency-150x62.jpg 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency-300x124.jpg 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Crystal-Behavior-vs-Frequency-768x317.jpg 768w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><\/p>\n<p>As we now know, in parallel mode the parasitic capacitance of C<sub>S <\/sub>influences the resonant frequency. Because C<sub>S <\/sub>is the capacitance between the terminals of the crystal, any external capacitor will influence the resonant frequency, as it will be in parallel with C<sub>S<\/sub>. Crystals that are meant to be used in parallel mode should show the value of the external capacitor in the specs. The crystal won\u2019t behave as expected if you use a different capacitor value.<\/p>\n<h2><strong>Speaking in Overtones<\/strong><\/h2>\n<p>Earlier, we learned that crystal oscillators are available in frequencies from 10 kHz to 30 MHz.<\/p>\n<p>This is only a half-truth though.<\/p>\n<p>The design of some crystals allow them to work in overtone mode where the frequency can go as high as 250 MHz or above.<\/p>\n<p>The overtone frequencies are usually close to three, five, or seven times the fundamental resonant frequency. It\u2019s important to note that these overtones are not electrical harmonics of the two resonant frequencies, rather they are mechanical overtones (hence the name) where the crystal vibrates in more complex ways. In other words, the third overtone frequency is not exactly three times the fundamental frequency, though it can be close.<\/p>\n<h2><strong>No Hocus Pocus<\/strong><\/h2>\n<p>Now we know that crystals aren\u2019t just for jewelry aficionados or psychics. In fact, it\u2019s hard to find an electronic device these days that doesn\u2019t contain the often-misunderstood components.<\/p>\n<p>Hopefully, this post has removed some of the mystery surrounding crystals and crystal oscillators.<\/p>\n<p>There\u2019s a lot more to say about crystals and the circuits and oscillators that contain them. A future post may go into more detail about crystals and the circuits that use them.<\/p>\n<p>How often do you use crystals in your projects? Comment and let us know.<\/p>\n<h2 style=\"text-align: center;\">Become the Maker you were born to be. Try <a href=\"https:\/\/learnarduinonow.com\">Arduino Academy<\/a> for FREE!<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4238\" src=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png\" alt=\"\" width=\"828\" height=\"315\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png 828w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-300x114.png 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-150x57.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-768x292.png 768w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/p>\n<p><em>Crystal Oscillator References:<\/em><\/p>\n<ol>\n<li>Smith, William F. &amp; Hashemi, Javad. <em>Foundation of Materials Science and Engineering, 4th Ed.<\/em> McGraw-Hill, 2006. Print.<\/li>\n<li>Horowitz, Paul &amp; Hill, Winfield. <em>The Art of Electronics, 3rd Ed. <\/em>Cambridge University Press, 2015. Print.<\/li>\n<li>Lacoste, Robert. &#8220;Let\u2019s Be Crystal Clear.&#8221; <em>Circuit Cellar<\/em> June 2008: 70-77. Print.<\/li>\n<\/ol>\n<a target=\"_blank\" href=\"https:\/\/www.drpeterscode.com\/index.php\"><img src=\"https:\/\/www.circuitcrush.com\/wp-content\/plugins\/dpabottomofpostpage\/apixel1x1.jpg\" ><\/a><table><\/table>","protected":false},"excerpt":{"rendered":"<p>The crystal oscillator is everywhere. The need for precise frequency control sets the stage. Crystals ensure not only accurate timing for microprocessors and microcontrollers, but also in setting the frequencies of any radio or wireless device. Sure, you can make an oscillator out of capacitors, inductors, and resistors but their limitations are severe.<\/p>\n","protected":false},"author":1,"featured_media":367,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[55],"tags":[58,56,57],"class_list":{"0":"post-356","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-crystals","8":"tag-crystal-oscillators","9":"tag-crystals","10":"tag-quartz-crystals","11":"entry"},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Quartz-Crystals.jpg","_links":{"self":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":1,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"predecessor-version":[{"id":4349,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/356\/revisions\/4349"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/media\/367"}],"wp:attachment":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}