{"id":517,"date":"2017-02-02T23:54:53","date_gmt":"2017-02-02T23:54:53","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=517"},"modified":"2020-10-12T16:27:35","modified_gmt":"2020-10-12T16:27:35","slug":"high-low-temputure-and-humidity-controll-box-build-tutorial","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=517","title":{"rendered":"High Low temputure and humidity controll box build tutorial"},"content":{"rendered":"<h1>This tutorial will show you how to build a temperature and humidity controlled relay box to control a green house, chicken egg incubator, or any other application that needs a controlled temperature.<\/h1>\n<p>Click on the video below for full tutorial&#8230;<\/p>\n<p><iframe loading=\"lazy\" title=\"High Low temputure and humidity controll box build tutorial\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/Za-Tt5bvC5I?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><\/h1>\n<h1><span style=\"color: #ff0000;\"><strong><span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/www.facebook.com\/zarduino\/\">Check us out on Facebook!<\/a><\/span><\/strong><\/span><\/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=42d8dd18f7eb8e7b8630507ca4f8e572\" 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=i2c 1602 lcd&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=46cc77373fda54ba65c3dcd285e0b146\" target=\"_blank\" rel=\"noopener noreferrer\">I2C LCD<\/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=78c7681ede8524bf6d9e8b23f51007ea\" target=\"_blank\" rel=\"noopener noreferrer\">Relays<\/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=potentiometer&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=1a94c08a7e00bb0a74c71c8ddae6c4df\" target=\"_blank\" rel=\"noopener noreferrer\">Potentiometer&#8217;s<\/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=2n2222&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=075e6241f390189f4aa7ecafc72217ed\" target=\"_blank\" rel=\"noopener noreferrer\">2N2222 Transistor<\/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=0b34681d46ff76427ae75ca1b2bbb6b3\" target=\"_blank\" rel=\"noopener noreferrer\">Led&#8217;s<\/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=dht11&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=0c25ac622dac46677494c8e82a58e344\" target=\"_blank\" rel=\"noopener noreferrer\">DHT11<\/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=8d69af4f219fc6deda78e93f231d2085\" target=\"_blank\" rel=\"noopener noreferrer\">Resistors<\/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 breadboard&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=04dd3d2f562c19514194742c171f605e\" target=\"_blank\" rel=\"noopener noreferrer\">BreadBoard<\/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=3067eda0aa191cc32a765e1f09e4a37e\" target=\"_blank\" rel=\"noopener noreferrer\">Jumper Wires<\/a><\/p>\n<h1>SCHEMATIC:<\/h1>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-528\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2.jpg?w=300\" alt=\"high_low_relay_schem\" width=\"647\" height=\"315\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2.jpg 1569w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2-300x146.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2-768x373.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/high_low_relay_schem2-1024x497.jpg 1024w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/a><\/p>\n<h1><\/h1>\n<h1>ARDUINO CODE:<\/h1>\n<p>#include &lt;Wire.h&gt;<br \/>\n#include &lt;LiquidCrystal_I2C.h&gt;<br \/>\nLiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); \/\/ Set the LCD I2C address<br \/>\n#define light 5 \/\/ back light on &#8211; off transistor pin<br \/>\n#include &lt;SimpleDHT.h&gt;<br \/>\n#define pinDHT11 6 \/\/data pin<br \/>\nSimpleDHT11 dht11;<br \/>\nbyte temperature = 0;<br \/>\nbyte humidity = 0;<br \/>\n#define relay 12 \/\/ low relay on pin 12<br \/>\n#define relay2 11 \/\/ high relay on pin 11<br \/>\n#define button 8 \/\/ switch<br \/>\nint last = 1; \/\/ button state<br \/>\nint val;<br \/>\nint pot;<br \/>\nint val2;<br \/>\nint pot2;<br \/>\nint pval;<br \/>\nint pval2;<br \/>\nint temp;<br \/>\nint ptemp;<br \/>\n#define dif 5 \/\/ temp diff<\/p>\n<p>void setup()<br \/>\n{<br \/>\nlcd.begin(16, 2); \/\/ initialize the lcd for 16 chars 2 lines<br \/>\nlcd.clear();<br \/>\npinMode(relay, OUTPUT);<br \/>\npinMode(relay2, OUTPUT);<br \/>\npinMode(button, INPUT_PULLUP);<br \/>\npinMode(light, OUTPUT);<br \/>\ndigitalWrite(light, HIGH);<br \/>\nlcd.setCursor(1, 0);<br \/>\nlcd.print(&#8220;Temperature&#8221;);<br \/>\nlcd.setCursor(0, 1);<br \/>\nlcd.print(&#8220;LOW&#8221;);<br \/>\nlcd.setCursor(8, 1);<br \/>\nlcd.print(&#8220;HIGH&#8221;);<br \/>\nlcd.setCursor(15, 0);<br \/>\nlcd.print(&#8220;C&#8221;);<br \/>\nlcd.setCursor(6, 1);<br \/>\nlcd.print(&#8220;C&#8221;);<br \/>\nlcd.setCursor(15, 1);<br \/>\nlcd.print(&#8220;C&#8221;);<br \/>\npval = analogRead(A0);<br \/>\n}<\/p>\n<p>void loop()<br \/>\n{<br \/>\npot = analogRead(A0);<br \/>\nval = map(pot, 0, 1023, 0, 40);<br \/>\npot2 = analogRead(A1);<br \/>\nval2 = map(pot2, 0, 1023, 0, 40);<br \/>\nif (dht11.read(pinDHT11, &amp;temperature, &amp;humidity, NULL))<br \/>\n{<br \/>\nreturn;<br \/>\n}<br \/>\ntemp = (int)temperature;<br \/>\nif (val &lt;= 9 &amp;&amp; pval &gt;= 10) \/\/ keep LCD correct \/\/<br \/>\n{<br \/>\nlcd.setCursor(4, 1);<br \/>\nlcd.print(&#8221; &#8220;);<br \/>\n}<br \/>\npval = val;<br \/>\nif (val2 &lt;= 9 &amp;&amp; pval2 &gt;= 10)<br \/>\n{<br \/>\nlcd.setCursor(13, 1);<br \/>\nlcd.print(&#8221; &#8220;);<br \/>\n}<br \/>\npval2 = val2;<br \/>\ntemp = constrain(temp, 0, 50);<br \/>\nif (temp &lt;= 9 &amp;&amp; ptemp &gt;= 10)<br \/>\n{<br \/>\nlcd.setCursor(13, 0);<br \/>\nlcd.print(&#8221; &#8220;);<br \/>\n}<br \/>\nptemp = temp;<br \/>\nlcd.setCursor(13, 0);<br \/>\nlcd.print(temp);<br \/>\nlcd.setCursor(4, 1);<br \/>\nlcd.print(val);<br \/>\nlcd.setCursor(13, 1);<br \/>\nlcd.print(val2);<br \/>\nif (digitalRead(button) == LOW ) { \/\/ lcd button<br \/>\nif (last == 0)<br \/>\n{<br \/>\ndigitalWrite(light, HIGH);<br \/>\nlast = 1;<br \/>\n}<br \/>\nelse if (last == 1)<br \/>\n{<br \/>\ndigitalWrite(light, LOW);<br \/>\nlast = 0;<br \/>\n}<br \/>\n}<br \/>\nif (temp &lt;= val) \/\/ relay 1<br \/>\n{<br \/>\ndigitalWrite(relay, HIGH);<br \/>\n}<br \/>\nelse if (temp &gt;= val + dif)<br \/>\n{<br \/>\ndigitalWrite(relay, LOW);<br \/>\n}<br \/>\nif (temp &gt;= val2) \/\/ relay 2<br \/>\n{<br \/>\ndigitalWrite(relay2, HIGH);<br \/>\n}<br \/>\nelse if (temp &lt;= val2 &#8211; dif)<br \/>\n{<br \/>\ndigitalWrite(relay2, LOW);<br \/>\n}<br \/>\ndelay(500);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to build a temperature and humidity controlled relay box to control a green house, chicken egg incubator, or any other application that needs a controlled temperature. Click on the video below for full tutorial&#8230; &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=517\">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-517","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/517","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=517"}],"version-history":[{"count":3,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/517\/revisions"}],"predecessor-version":[{"id":1592,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/517\/revisions\/1592"}],"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=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}