{"id":911,"date":"2018-02-05T04:04:54","date_gmt":"2018-02-05T04:04:54","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=911"},"modified":"2020-10-12T16:18:00","modified_gmt":"2020-10-12T16:18:00","slug":"how-to-bluetooth-control-your-garden-hose","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=911","title":{"rendered":"How to Bluetooth control your garden hose"},"content":{"rendered":"<h1>In this tutorial I will show you how you can use a smartphone or tablet with a Arduino board and a Bluetooth module to wirelessly control your garden hose to turn it on or off and also set a timer for the watering time&#8230;.<\/h1>\n<h2>click on the video below for full tutorial&#8230;<\/h2>\n<p><iframe loading=\"lazy\" title=\"How to Bluetooth control your garden hose (Arduino project)\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/pqwF1iZw7Zk?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<h2>Parts List:<\/h2>\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=418c53ede09850dad6f4dc2713aeff96\" 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=hc-06&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=1f033f9c76ef170c517ea8cf4b915a0b\" target=\"_blank\" rel=\"noopener noreferrer\">HC-06<\/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=logic level converter&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=ba6b3c017327de42fca35a34e6b24bea\" target=\"_blank\" rel=\"noopener noreferrer\">Logic LVL converter<\/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=H-bridge&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=47c62b62686fb8254c5597c5f40e0260\" target=\"_blank\" rel=\"noopener noreferrer\">H-bridge<\/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=da8d46b7f06c8f2c8717d48aadb3f2a9\" target=\"_blank\" rel=\"noopener noreferrer\">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=Latching Solenoid&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=3c48adac42f1feede7ffed467debd85c\" target=\"_blank\" rel=\"noopener noreferrer\">Latching Solenoid<\/a><\/p>\n<h2>Schematic:<\/h2>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-915\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem.jpg?w=300\" alt=\"\" width=\"636\" height=\"464\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem.jpg 1245w, https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem-300x219.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem-768x561.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2018\/02\/garden_schem-1024x748.jpg 1024w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/a><\/p>\n<h1><a href=\"https:\/\/drive.google.com\/open?id=1kj8SVxAU13HobBXwX-5VrYtHD7CuVt91\" target=\"_blank\" rel=\"noopener noreferrer\">APK ANDROID File:<\/a><\/h1>\n<h2>ARDUINO CODE:<\/h2>\n<p>#define led 13<br \/>\n#define s1 11<br \/>\n#define s2 12<br \/>\nint timer = 1;<br \/>\nvoid setup() {<br \/>\nSerial.begin(9600);<br \/>\npinMode(led, OUTPUT);<br \/>\npinMode(s1, OUTPUT);<br \/>\npinMode(s2, OUTPUT);<br \/>\ndigitalWrite(s1, LOW);<br \/>\ndigitalWrite(s2, LOW);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nif (Serial.available() &gt;= 2 )<br \/>\n{<br \/>\nunsigned int a = Serial.read();<br \/>\nunsigned int b = Serial.read();<br \/>\nunsigned int val = (b * 256) + a;<\/p>\n<p>if (val == 100) \/\/ turn water on<br \/>\n{<br \/>\ndigitalWrite(s1, HIGH);<br \/>\ndelay(100);<br \/>\ndigitalWrite(s1, LOW);<br \/>\ndigitalWrite(led, HIGH);<br \/>\n}<\/p>\n<p>else if (val == 200) \/\/ turn water off<br \/>\n{<br \/>\ndigitalWrite(s2, HIGH);<br \/>\ndelay(100);<br \/>\ndigitalWrite(s2, LOW);<br \/>\ndigitalWrite(led, LOW);<br \/>\n}<\/p>\n<p>else if (val &gt;= 1 &amp;&amp; val &lt;= 60) \/\/ watering time<br \/>\n{<br \/>\ntimer = val;<br \/>\n}<\/p>\n<p>else if (val == 300) \/\/ start watering timer<br \/>\n{<br \/>\ndigitalWrite(led, HIGH);<br \/>\ndigitalWrite(s1, HIGH);<br \/>\ndelay(100);<br \/>\ndigitalWrite(s1, LOW);<br \/>\ndelay(timer * 60000);<br \/>\ndigitalWrite(led, LOW);<br \/>\ndigitalWrite(s2, HIGH);<br \/>\ndelay(100);<br \/>\ndigitalWrite(s2, LOW);<\/p>\n<p>}<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial I will show you how you can use a smartphone or tablet with a Arduino board and a Bluetooth module to wirelessly control your garden hose to turn it on or off and also set a timer &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=911\">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-911","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/911","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=911"}],"version-history":[{"count":2,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/911\/revisions"}],"predecessor-version":[{"id":1582,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/911\/revisions\/1582"}],"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=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}