{"id":20,"date":"2013-04-08T21:10:24","date_gmt":"2013-04-08T21:10:24","guid":{"rendered":"https:\/\/giggingarduino.wordpress.com\/2013\/04\/08\/201348doh-about-those-buttons"},"modified":"2013-04-08T21:10:24","modified_gmt":"2013-04-08T21:10:24","slug":"201348doh-about-those-buttons","status":"publish","type":"post","link":"https:\/\/mrgadget.nexus\/giggingarduino\/2013\/04\/08\/201348doh-about-those-buttons\/","title":{"rendered":"D&#8217;oh! About those buttons&#8230;"},"content":{"rendered":"<p>I was going to save doing this next post as &#8220;here are the electronics to glue everything together&#8221; post&#8230; but&#8230;<\/p>\n<p>After the last post I placed yet another order for a bunch of resistors, and some &#8220;headers&#8221; that I&#8217;m thinking about using to plug stuff into the Arduino, and for that matter another breadboard seeing as the postage was more than the components, and thought to myself, right that&#8217;s it for the electronics. Uhm, yeah that was premature.<\/p>\n<p>There is commonly an issue with pushbuttons, something that might not immediately spring to mind, and that is they &#8220;bounce&#8221;. You think it&#8217;s a clean on\/off, especially with a tactile button that resists pressing until suddenly &#8220;click&#8221; it&#8217;s pushed, but it rarely is that simple.<\/p>\n<p>It&#8217;s possible to &#8220;de-bounce&#8221; with software, but it&#8217;s also possible to do it with hardware. There are plenty of articles online, but for me, now I&#8217;m going down the button route, I think I&#8217;ll go for hardware. The method I&#8217;ve seen and like the look at works like this.<\/p>\n<p>Take your &#8220;current&#8221; and run into a resistor (hey look a pull-up resistor), put that into your button and put a capacitor &#8220;across&#8221; the button, and hooked to ground. Thus the capacitor &#8220;charges&#8221; when the button is up and discharges when the button is down. To get back to a digital signal (rather than the suddenly distinctly analogue voltage this creates) the &#8220;output&#8221; of the resistor capacitor series is fed into something called an inverting Schmitt trigger (ooh, at least one more IC). Thus when the capacitor is suitably discharged you suddenly get a &#8220;high&#8221; meaning &#8220;button pressed&#8221;.<\/p>\n<p>I have a collection of links to articles, videos, products and the like in Evernote, even &#8220;mistakes&#8221; and things I&#8217;ve decided against, and I think I need to tidy it up and reformat before I miss anything else. At least at this early test\/development stage.<\/p>\n<p>B.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was going to save doing this next post as &#8220;here are the electronics to glue everything together&#8221; post&#8230; but&#8230; After the last post I placed yet another order for a bunch of resistors, and some &#8220;headers&#8221; that I&#8217;m thinking about using to plug stuff into the Arduino, and for that matter another breadboard seeing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrgadget.nexus\/giggingarduino\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}