{"id":25080,"date":"2019-09-03T09:35:29","date_gmt":"2019-09-03T16:35:29","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=25080"},"modified":"2020-12-21T11:23:01","modified_gmt":"2020-12-21T19:23:01","slug":"my-first-oscillator-the-astable-multivibrator","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/my-first-oscillator-the-astable-multivibrator\/","title":{"rendered":"My First Oscillator: The Astable Multivibrator"},"content":{"rendered":"<p>I recently compiled and <a href=\"https:\/\/digilent.com\/blog\/pushing-the-envelope-detector-exploring-demodulation-am-and-fm-signals\/\">posted a project<\/a> on <a href=\"https:\/\/www.hackster.io\/\">Hackster.io<\/a> describing how a Theremin (an electronic musical instrument) can be built with the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2,<\/a> the <a href=\"https:\/\/digilent.com\/shop\/analog-parts-kit-by-analog-devices-companion-parts-kit-for-the-analog-discovery\/\">Analog Parts Kit<\/a>, and a beverage can. I wanted to be able to break down the circuit into smaller stages, so I could understand what was going on and help readers understand as well. However, what I considered to be the \u201cfirst stage\u201d turned out to be quite a conceptual challenge for me, and it is still putting me through the ringer.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25176\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/11713640484_3096608d9f_b.jpg\" alt=\"\" width=\"683\" height=\"1024\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/11713640484_3096608d9f_b.jpg 683w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/11713640484_3096608d9f_b-400x600.jpg 400w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/p>\n<p>Deep thinking. Picture from:&nbsp;<a href=\"https:\/\/www.flickr.com\/photos\/archer10\/11713640484\">https:\/\/www.flickr.com\/photos\/archer10\/11713640484<\/a><\/p>\n<p>This stage was presented to me as a \u201cVariable-Frequency Oscillator.\u201d A small op amp circuit with 3 resistors and a capacitor, this generated an oscillating output. The fixed capacitor was placed in parallel with a beverage can, and a hand-held wire for the Theremin effect. I asked myself \u201cwhat is the input to this stage, how does this op amp generate an oscillating output with only DC voltage supplies, and what\u2019s the function of this capacitor?\u201d This is when I fell down the rabbit hole.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25177\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/311526846_24b03feedf_z.jpg\" alt=\"\" width=\"500\" height=\"375\"><\/p>\n<p>Follow the white rabbit. Picture from:&nbsp;<a href=\"https:\/\/www.flickr.com\/photos\/valkyrieh116\/311526846\">https:\/\/www.flickr.com\/photos\/valkyrieh116\/311526846<\/a><\/p>\n<p>The parallel capacitance formed by the beverage can and the handheld wire changed the frequency of the output. This was noticeable using an oscilloscope and supported the variable-frequency title. But why was there an oscillating output to begin with? Here is a schematic for the circuit I was using:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25114\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/1-astable-multivibrator.png\" alt=\"\" width=\"684\" height=\"520\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/1-astable-multivibrator.png 684w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/1-astable-multivibrator-600x456.png 600w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>What I have gathered in an attempt to understand the cause of this oscillation, is that it still seems like magic and really does reflect the fact that every circuit component is imperfect in its own little special way (just like all of us). In theory, or ideally, the plates of the capacitor would be the exact same in every way, the resistor values would be the exact same in every way, and the transistors in the integrated circuit would be exactly the same in every way. The positive and negative voltages applied to the op amp would be exactly equal and opposite and applied at the same exact instantaneous moment, and the environment would have no bearing on functionality. However, as you may be expecting, this is not reality.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25178\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/17182506391_f397c692e1_b.jpg\" alt=\"\" width=\"1024\" height=\"685\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/17182506391_f397c692e1_b.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/17182506391_f397c692e1_b-600x401.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/17182506391_f397c692e1_b-768x514.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/17182506391_f397c692e1_b-800x535.jpg 800w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Hashing it out before reality puts you in your place. Picture from:&nbsp;<a href=\"https:\/\/www.flickr.com\/photos\/bryanalexander\/17182506391\">https:\/\/www.flickr.com\/photos\/bryanalexander\/17182506391<\/a><\/p>\n<p>Tiny imperfections and variations among like components, in conjunction with environmental electrical and magnetic noise, are the driving forces to this oscillator. Since instantaneous voltage changes are impossible, and the signal path to bias the circuit will vary between the two supplies, one plate of the fixed capacitor will begin to favor one of the voltage supplies, and start charging towards that value.<\/p>\n<p>Now what happens is a magical juggling act? The charging capacitor biases BJT transistors that are in the op amp that passes either a positive or negative voltage to the output. However, when the capacitor charge gets close to the value of one of the power supplies, this causes a switch-like behavior in some of the op amps transistors, rebiasing, and causes the capacitor to begin discharging and recharging towards the other power supply value. This continues to flip-flop on it&#8217;s own, hence the astable title. The oscillating output is characteristic of a square wave. Here is a screen shot of the oscillation in <a href=\"https:\/\/digilent.com\/shop\/waveforms-previously-waveforms-2015\/\">Waveforms<\/a>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25115 alignnone\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot.png\" alt=\"\" width=\"1600\" height=\"860\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot.png 1600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot-600x323.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot-768x413.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot-1024x550.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/frequency-measurement-VFO-screen-shot-800x430.png 800w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p>There are also monostable and bistable multivibrators where one or two of these states are externally controlled. I cannot fully explain this phenomenon with the op amp circuit, but some easier to understand examples of discrete multivibrator circuits exist online with better explanations. &nbsp;I will need much more time to think about this before I develop a confident understanding. &nbsp;This is some crazy cool physics! Check out these pages for tutorials that helped me begin to wrap my mind around this phenomenon, they use the same discrete circuit:<\/p>\n<p><a href=\"https:\/\/www.electronics-tutorials.ws\/waveforms\/astable.html\">https:\/\/www.electronics-tutorials.ws\/waveforms\/astable.html<\/a><br \/>\n<a href=\"https:\/\/www.electrical4u.com\/astable-multivibrator\/\">https:\/\/www.electrical4u.com\/astable-multivibrator\/<\/a><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-25080 jlk' data-task='like' data-post_id='25080' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-25080 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-25080 jlk' data-task='unlike' data-post_id='25080' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-25080 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-25080 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Delve deeper into Ian&#8217;s beverage can Theramin project with this examination of an oscillator. <\/p>\n","protected":false},"author":49,"featured_media":25114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4325,4327,4312,1561],"tags":[1736],"ppma_author":[4459],"class_list":["post-25080","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debug-validation-test","category-projects","category-usb-scopes-analyzers-generators","category-applications","tag-analog-discovery-2"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/1-astable-multivibrator.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4459,"user_id":49,"is_guest":0,"slug":"ian","display_name":"Ian Etheridge","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/04e89e2073e59253a0b117ef28da1c647ca307c1e5f7bf024c1c3e8289c2e026?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=25080"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25080\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/25114"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=25080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=25080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=25080"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=25080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}