Skip to main content

Library to get readings from the DHT11, DHT22, and AM2302 humidity and temperature sensors on a Raspberry Pi or Beaglebone Black.

Project description

Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi or Beaglebone Black.

Designed specifically to work with the Adafruit DHT series sensors —-> https://www.adafruit.com/products/385

Currently the library is tested with Python 2.6, 2.7, 3.3 and 3.4. It should work with Python greater than 3.4, too.

Installing

### Dependencies

For all platforms (Raspberry Pi and Beaglebone Black) make sure your system is able to compile and download Python extensions with pip:

On Raspbian or Beaglebone Black’s Debian/Ubuntu image you can ensure your system is ready by running one or two of the following sets of commands:

Python 2:

``sh sudo apt-get update sudo apt-get install python-pip sudo python -m pip install --upgrade pip setuptools wheel ``

Python 3:

``sh sudo apt-get update sudo apt-get install python3-pip sudo python3 -m pip install --upgrade pip setuptools wheel ``

### Install with pip

Use pip to install from PyPI.

Python 2:

`sh sudo pip install Adafruit_DHT `

Python 3:

`sh sudo pip3 install Adafruit_DHT `

### Compile and install from the repository

First download the library source code from the [GitHub releases page](https://github.com/adafruit/Adafruit_Python_DHT/releases), unzipping the archive, and execute:

Python 2:

`sh cd Adafruit_Python_DHT sudo python setup.py install `

Python 3:

`sh cd Adafruit_Python_DHT sudo python3 setup.py install `

You may also git clone the repository if you want to test an unreleased version:

`sh git clone https://github.com/adafruit/Adafruit_Python_DHT.git `

Usage

See example of usage in the examples folder.

Author

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Tony DiCola for Adafruit Industries.

MIT license, all text above must be included in any redistribution

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Adafruit_Python_DHT-1.4.0.tar.gz (15.2 kB view details)

Uploaded Source

File details

Details for the file Adafruit_Python_DHT-1.4.0.tar.gz.

File metadata

  • Download URL: Adafruit_Python_DHT-1.4.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.12.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.13

File hashes

Hashes for Adafruit_Python_DHT-1.4.0.tar.gz
Algorithm Hash digest
SHA256 ac404e4c22838810272a00c68bc8f9892b3fa8ffdd5ff84e80193d0c2c2f9d18
MD5 f7667f0daf4a850837822ad9c0240ccf
BLAKE2b-256 e9e58261ce3480ad08567123286501628bfe1452b13bc4f20e98b46e456b060b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page