{"id":537,"date":"2017-02-07T23:06:15","date_gmt":"2017-02-07T23:06:15","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=537"},"modified":"2020-10-12T16:37:24","modified_gmt":"2020-10-12T16:37:24","slug":"how-to-set-up-and-use-a-dht11-or-dht22-with-a-arduino-board-lcd-screen","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=537","title":{"rendered":"How to set up and use a DHT11 or DHT22 with a ARDUINO board &#038;  LCD screen"},"content":{"rendered":"<h1>This tutorial will show you how to set up and use a DHT11 or DHT22 temp and humidity sensor with a\u00a0ARDUINO board &amp; LCD screen.<\/h1>\n<p>Click on video below for full tutorial&#8230;..<\/p>\n<p><iframe loading=\"lazy\" title=\"How to set up and use a DHT11 or DHT22 with a ARDUINO board &amp; LCD screen\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/ZpVHG-8XwU4?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><span style=\"color: #ff0000;\"><a href=\"https:\/\/www.facebook.com\/zarduino\/\">Check us out on Facebook!<\/a><\/span><\/strong><\/h1>\n<h1><a href=\"https:\/\/zhutarduino.wordpress.com\/arduino-projects\/how-to-set-up-and-use-a-1602-i2c-serial-lcd-with-your-arduino\/\">\u00a0LCD library for ARDUINO and more info on the I2C LCD screen can be found here<\/a><\/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=9b9b47da9b9b089bc01f596a7a70382f\" 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&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=804578b27912b2b6390b09227b25544f\" target=\"_blank\" rel=\"noopener noreferrer\">I2C 1602 LCD SCREEN<\/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=489c6dd2bd22b308b4239e6e6e65f58d\" target=\"_blank\" rel=\"noopener noreferrer\">DHT11 or DHT22 Temp &amp; humidity Sensor<\/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\">Bread 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 jumper wires&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=4e765d5e863107e7ebb73d7745c412f8\" target=\"_blank\" rel=\"noopener noreferrer\">Jumper Wires<\/a><\/p>\n<h1>THE SCHEMATIC:<\/h1>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/lcd_shit_schem_final.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-544\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/lcd_shit_schem_final.jpg?w=300\" alt=\"lcd_shit_schem_final\" width=\"739\" height=\"668\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/lcd_shit_schem_final.jpg 864w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/lcd_shit_schem_final-300x271.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/02\/lcd_shit_schem_final-768x693.jpg 768w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\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);<br \/>\n#include &lt;SimpleDHT.h&gt;<br \/>\n#define pinDHT11 6 \/\/data pin<br \/>\nSimpleDHT11 dht11;<\/p>\n<p>void setup() {<br \/>\nlcd.begin(16, 2); \/\/ initialize the lcd for 16 chars 2 lines<br \/>\nlcd.clear();<br \/>\nlcd.setCursor(0, 0);<br \/>\nlcd.print(&#8220;Temperature&#8221;);<br \/>\nlcd.setCursor(14, 0);<br \/>\nlcd.print(&#8220;C&#8221;);<br \/>\nlcd.setCursor(0, 1);<br \/>\nlcd.print(&#8220;Humidity&#8221;);<br \/>\nlcd.setCursor(11, 1);<br \/>\nlcd.print(&#8220;%&#8221;);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nbyte temperature = 0;<br \/>\nbyte humidity = 0;<br \/>\nif (dht11.read(pinDHT11, &amp;temperature, &amp;humidity, NULL)) {<br \/>\nSerial.print(&#8220;Read DHT11 failed.&#8221;);<br \/>\nreturn;<br \/>\n}<br \/>\nlcd.setCursor(12, 0);<br \/>\nlcd.print((int)temperature);<br \/>\nlcd.setCursor(9, 1);<br \/>\nlcd.print((int)humidity);<\/p>\n<p>delay(1000);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to set up and use a DHT11 or DHT22 temp and humidity sensor with a\u00a0ARDUINO board &amp; LCD screen. Click on video below for full tutorial&#8230;.. Check us out on Facebook! \u00a0LCD library for &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=537\">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-537","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/537","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=537"}],"version-history":[{"count":3,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/537\/revisions"}],"predecessor-version":[{"id":1607,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/537\/revisions\/1607"}],"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=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}