{"id":1081,"date":"2018-11-24T18:29:58","date_gmt":"2018-11-24T18:29:58","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=1081"},"modified":"2018-11-24T18:29:58","modified_gmt":"2018-11-24T18:29:58","slug":"how-to-make-a-capacitive-touch-sensor-switch-out-of-anything-metal-using-an-arduino","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=1081","title":{"rendered":"How to make a capacitive touch sensor switch out of anything metal using an Arduino"},"content":{"rendered":"<h1 style=\"text-align:center;\">Today I will show you a simple and easy way to turn almost anything that&#8217;s metal into a capacitive touch sensor switch using only an Arduino and one resistor.<\/h1>\n<p><iframe loading=\"lazy\" title=\"How to make a capacitive touch sensor switch out of anything metal using an Arduino\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/lqg_Ze_OiiY?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<p>&nbsp;<\/p>\n<h1><a href=\"https:\/\/www.facebook.com\/zarduino\/\">Check us out on Facebook!<\/a><\/h1>\n<h1>ARDUINO Code:<\/h1>\n<p>#include &lt;CapacitiveSensor.h&gt;<br \/>\nCapacitiveSensor Sensor = CapacitiveSensor(4, 6);<br \/>\nlong val;<br \/>\nint pos;<br \/>\n#define led 13<\/p>\n<p>void setup()<br \/>\n{<br \/>\nSerial.begin(9600);<br \/>\npinMode(led, OUTPUT);<br \/>\n}<\/p>\n<p>void loop()<br \/>\n{<\/p>\n<p>val = Sensor.capacitiveSensor(30);<br \/>\nSerial.println(val);<br \/>\nif (val &gt;= 1000 &amp;&amp; pos == 0)<br \/>\n{<br \/>\ndigitalWrite(led, HIGH);<br \/>\npos = 1;<br \/>\ndelay(500);<br \/>\n}<\/p>\n<p>else if (val &gt;= 1000 &amp;&amp; pos == 1)<br \/>\n{<br \/>\ndigitalWrite(led, LOW);<br \/>\npos = 0;<br \/>\ndelay(500);<br \/>\n}<\/p>\n<p>delay(10);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I will show you a simple and easy way to turn almost anything that&#8217;s metal into a capacitive touch sensor switch using only an Arduino and one resistor. &nbsp; Check us out on Facebook! ARDUINO Code: #include &lt;CapacitiveSensor.h&gt; CapacitiveSensor &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=1081\">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-1081","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1081","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=1081"}],"version-history":[{"count":0,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1081\/revisions"}],"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=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}