{"id":166,"date":"2018-11-14T23:08:27","date_gmt":"2018-11-15T07:08:27","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=166"},"modified":"2019-06-25T23:46:35","modified_gmt":"2019-06-26T06:46:35","slug":"dht11","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/raspberrypi3bsensors\/dht11\/","title":{"rendered":"DHT11 on Raspberry Pi 3"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">DHT11 (Temperature and Humidity Sensor)<\/h3>\n\n\n\n<p>Setup and configuring sensor using Adafruit Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi. *library is tested with Python 2.6, 2.7, 3.3 and 3.4 using PIP.&nbsp; Setup Python3, PiP and Git with the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update\nsudo apt-get install python3-pip\nsudo python3 -m pip install --upgrade pip setuptools wheel\nsudo apt-get install git<\/pre>\n\n\n\n<p>Download GitHub repository of Adafruit lilbrary<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone https:\/\/github.com\/adafruit\/Adafruit_Python_DHT.git<\/pre>\n\n\n\n<p>change directory to Adafruit_Python_DHT folder (*example below)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/home\/pi\/Adafruit_Python_DHT<\/pre>\n\n\n\n<p>Install Library from PyPI<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo pip3 install Adafruit_DHT<\/pre>\n\n\n\n<p>Navigate to examples folder and open AdafruitDHT.py and read through the code.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/Adafruit_DHT.png\" alt=\"\" class=\"wp-image-786\" width=\"409\" height=\"265\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/Adafruit_DHT_py.png\" alt=\"\" class=\"wp-image-787\" width=\"408\" height=\"536\"\/><\/figure>\n\n\n\n<p>Close the file, open simpletest.py and read through the file and change the values for sensor <span class=\"pl-k\">=<\/span> Adafruit_DHT.<span class=\"pl-c1\">DHT11\u00a0 \u00a0and pin = P8_11<\/span><br>Save the file and run in python<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/Adafruit_DHT_SimpleTestpy.png\" alt=\"\" class=\"wp-image-788\" width=\"410\" height=\"408\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 simpletest.py<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>DHT11 (Temperature and Humidity Sensor) Setup and configuring sensor using Adafruit Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi. *library is tested with Python 2.6, 2.7, 3.3 and 3.4 using PIP.&nbsp; Setup Python3, PiP and Git with the following commands. sudo apt-get update sudo apt-get install python3-pip &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/doubleecpu.com\/index.php\/raspberrypi3bsensors\/dht11\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;DHT11 on Raspberry Pi 3&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":160,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-166","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=166"}],"version-history":[{"count":0,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/166\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/160"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}