{"id":840,"date":"2017-12-24T16:42:35","date_gmt":"2017-12-24T16:42:35","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=840"},"modified":"2019-10-20T18:10:35","modified_gmt":"2019-10-20T18:10:35","slug":"learning-arduino-for-beginners-ep22-dht11-temp-and-humidity-on-lcd-display","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=840","title":{"rendered":"learning Arduino for beginners EP#22 DHT11 temp and humidity on LCD display"},"content":{"rendered":"<h2>In this tutorial we will take a look at how you can display the temperature and humidity readings from a dht11 or dht22 on an LCD display screen&#8230;<\/h2>\n<p><iframe loading=\"lazy\" title=\"learning Arduino for beginners EP#22 DHT11 temp and humidity on LCD display\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/YdCcCzqyUvA?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><a href=\"https:\/\/www.facebook.com\/zarduino\/\"><strong>Check us out on Facebook!<\/strong><\/a><\/h1>\n<h1><\/h1>\n<h1>Links for more INFO&#8230;<\/h1>\n<h2><a href=\"https:\/\/thezhut.com\/?page_id=173\">How to set up and use a 1602 I2C serial LCD with your ARDUINO.<\/a><\/h2>\n<h2><a href=\"https:\/\/thezhut.com\/?page_id=837\">learning Arduino for beginners EP#21 DHT11 and DHT22 temp and humidity sensor<\/a><\/h2>\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=3552b578584b8dd83508783a28077fcb\" 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=ec16d4a89d37967b2fdf20a69a66d3bf\" target=\"_blank\" rel=\"noopener noreferrer\">I2C 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=5b8639f7e18974ccf513fa5aaf2cee18\" target=\"_blank\" rel=\"noopener noreferrer\">DHT11<\/a><\/p>\n<h2>ARDUINO Code:<\/h2>\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 \/>\n}<\/p>\n<p>void loop() {<br \/>\nbyte temperature = 0;<br \/>\nbyte humidity = 0;<br \/>\ndht11.read(pinDHT11, &amp;temperature, &amp;humidity, NULL);<br \/>\nlcd.clear();<br \/>\nlcd.setCursor(0, 0);<br \/>\nlcd.print(&#8220;Temperature&#8221;);<br \/>\nlcd.setCursor(15, 0);<br \/>\nlcd.print(&#8220;C&#8221;);<br \/>\nlcd.setCursor(0, 1);<br \/>\nlcd.print(&#8220;Humidity&#8221;);<br \/>\nlcd.setCursor(12, 1);<br \/>\nlcd.print(&#8220;%&#8221;);<br \/>\nlcd.setCursor(12, 0);<br \/>\nlcd.print(temperature);<br \/>\nlcd.setCursor(9, 1);<br \/>\nlcd.print(humidity);<br \/>\ndelay(30000);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we will take a look at how you can display the temperature and humidity readings from a dht11 or dht22 on an LCD display screen&#8230; Check us out on Facebook! Links for more INFO&#8230; How to set &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=840\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":809,"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-840","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/840","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=840"}],"version-history":[{"count":3,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/840\/revisions"}],"predecessor-version":[{"id":1470,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/840\/revisions\/1470"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/809"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}