{"id":582,"date":"2017-02-22T20:32:07","date_gmt":"2017-02-22T20:32:07","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=582"},"modified":"2019-10-20T18:24:52","modified_gmt":"2019-10-20T18:24:52","slug":"arduino-clapper-sound-activated-light-or-relay","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=582","title":{"rendered":"ARDUINO Clapper, sound activated light or relay"},"content":{"rendered":"<h1>This tutorial will show you how to make a clap or loud sound activated light or relay.<\/h1>\n<h2>click on video below for full tutorial<\/h2>\n<p><iframe loading=\"lazy\" title=\"ARDUINO Clapper, sound activated light or relay\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/5C9gn0SE27o?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h1><strong><a href=\"https:\/\/www.facebook.com\/zarduino\/\">Check us out on Facebook!<\/a><\/strong><\/h1>\n<h1>Parts List:<\/h1>\n<p>affiliate links:<\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino board&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=1edbdb73e9fa3f00a379bedc192b1045\" target=\"_blank\" rel=\"noopener noreferrer\">ARDUINO Board<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino sound sensor&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=88fe8fc865a1158386d99e5f4af3fefd\" target=\"_blank\" rel=\"noopener noreferrer\">Sound Sensor Board<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino led&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=c287bfde25fba2055c7de16df6ed0c89\" target=\"_blank\" rel=\"noopener noreferrer\">Supper Bright Led<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino relay&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=544d8b22cfb1e570cab88c264d0929b5\" target=\"_blank\" rel=\"noopener noreferrer\">Relay<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=resistors&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=a36670f5ce7b86328d190eb3ae743ab5\" target=\"_blank\" rel=\"noopener noreferrer\">Resistor<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino jumper wires&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=af4e168a5fb21ec94878d8ccade14bf8\" target=\"_blank\" rel=\"noopener noreferrer\">Jumper wires<\/a><\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino bread board&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=e8e864ab78c6d365c1dfae3f8df5a75c\" target=\"_blank\" rel=\"noopener noreferrer\">Bread board<\/a><\/p>\n<h1>Schematic:<\/h1>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/audio_alarm_schem1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-587\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/audio_alarm_schem1.jpg?w=300\" alt=\"audio_alarm_schem\" width=\"603\" height=\"436\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/audio_alarm_schem1.jpg 1005w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/audio_alarm_schem1-300x217.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/audio_alarm_schem1-768x555.jpg 768w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/a><\/p>\n<h1>ARDUINO Code:<\/h1>\n<p>int val = 0;<br \/>\nint last = 0;<br \/>\n#define sound 3<br \/>\n#define light 9<\/p>\n<p>void setup() {<br \/>\npinMode(sound, INPUT);<br \/>\npinMode(light, OUTPUT);<\/p>\n<p>}<\/p>\n<p>void loop() {<br \/>\nval = digitalRead(sound);<\/p>\n<p>if (val == 1 &amp;&amp; last == 0)<br \/>\n{<br \/>\ndigitalWrite (light, HIGH);<br \/>\nlast = 1;<br \/>\ndelay(500);<br \/>\n}<br \/>\nelse if (val == 1 &amp;&amp; last == 1)<br \/>\n{<br \/>\ndigitalWrite (light, LOW);<br \/>\nlast = 0;<br \/>\ndelay(500);<br \/>\n}<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to make a clap or loud sound activated light or relay. click on video below for full tutorial Check us out on Facebook! Parts List: affiliate links: ARDUINO Board Sound Sensor Board Supper Bright &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=582\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":10,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-582","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=582"}],"version-history":[{"count":3,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/582\/revisions"}],"predecessor-version":[{"id":1489,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/582\/revisions\/1489"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/10"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}