{"id":15023550,"url":"https://github.com/adafruit/adafruit_circuitpython_dht","last_synced_at":"2025-10-03T05:31:30.605Z","repository":{"id":38360104,"uuid":"103981430","full_name":"adafruit/Adafruit_CircuitPython_DHT","owner":"adafruit","description":"CircuitPython support for DHT11 and  DHT22 type temperature/humidity devices","archived":false,"fork":true,"pushed_at":"2025-01-16T18:46:11.000Z","size":170,"stargazers_count":187,"open_issues_count":15,"forks_count":64,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-01-19T18:54:44.670Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mrmcwethy/Adafruit_CircuitPython_DHT","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adafruit.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-18T19:18:29.000Z","updated_at":"2025-01-19T09:55:22.000Z","dependencies_parsed_at":"2023-02-11T23:46:06.554Z","dependency_job_id":"f95c39e4-6753-4281-a08a-fe27192e27cd","html_url":"https://github.com/adafruit/Adafruit_CircuitPython_DHT","commit_stats":{"total_commits":155,"total_committers":26,"mean_commits":5.961538461538462,"dds":0.8064516129032258,"last_synced_commit":"7badf78ecab2b5e57c658467cd7549678c6f01a9"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_DHT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_DHT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_DHT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_DHT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adafruit","download_url":"https://codeload.github.com/adafruit/Adafruit_CircuitPython_DHT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235079257,"owners_count":18932493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-09-24T19:59:10.624Z","updated_at":"2025-10-03T05:31:30.599Z","avatar_url":"https://github.com/adafruit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nIntroduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-dht/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/dht/en/latest/\n    :alt: Documentation Status\n\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_DHT/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_DHT/actions\n    :alt: Build Status\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n    :target: https://github.com/astral-sh/ruff\n    :alt: Code Style: Ruff\n\nCircuitPython support for the DHT11 and DHT22 temperature and humidity devices.\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://github.com/adafruit/Adafruit_CircuitPython_Bundle\u003e`_.\n\n.. note::\n     This library uses the `pulseio` module in CircuitPython. As of CircuitPython 7.0.0, `pulseio` is\n     no longer available on the smallest CircuitPython builds,\n     such as the Trinket M0, Gemma M0, and Feather M0 Basic boards.\n     You can substitute a more modern sensor, which will work better as well.\n     See the guide `Modern Replacements for DHT11 and DHT22 Sensors\n     \u003chttps://learn.adafruit.com/modern-replacements-for-dht11-dht22-sensors\u003e`_\n     for suggestions.\n\nInstalling from PyPI\n====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI \u003chttps://pypi.org/project/adafruit-circuitpython-dht/\u003e`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-dht\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install adafruit-circuitpython-dht\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .venv\n    source .venv/bin/activate\n    pip3 install adafruit-circuitpython-dht\n\nUsage Example\n==============\n\nHardware Set-up\n----------------\n\nDesigned specifically to work with the Adafruit DHT series sensors:\n\n* Adafruit `DHT22 temperature-humidity sensor + extras \u003chttps://www.adafruit.com/products/385\u003e`_\n* Adafruit `DHT11 temperature-humidity sensor + extras \u003chttps://www.adafruit.com/products/386\u003e`_\n\n.. note::\n    DHT11 and DHT22 devices both need a pull-resistor on the data signal wire. This resistor is in the range of 1k to 5k\n\n\n* Please check the device datasheet for the appropriate value.\n* Be sure that you are running the Buster Operating System.\n* Make sure that your user is part of the ``gpio`` group.\n\n\nKnown Issues\n------------\n\n* The library may or may not work in Linux 64-bit platforms.\n* The Raspberry PI Zero does not provide reliable readings.\n* Readings in FeatherS2 does not work as expected.\n\n.. note::\n     Using a more modern sensor will avoid these issues.\n     See the guide `Modern Replacements for DHT11 and DHT22 Sensors\n     \u003chttps://learn.adafruit.com/modern-replacements-for-dht11-dht22-sensors\u003e`_.\n\nBasics\n-------\n\nOf course, you must import the library to use it:\n\n.. code:: python\n\n    import adafruit_dht\n\nThe DHT type devices use single data wire, so import the board pin\n\n.. code:: python\n\n    from board import \u003cpin\u003e\n\nNow, to initialize the DHT11 device:\n\n.. code:: python\n\n    dht_device = adafruit_dht.DHT11(\u003cpin\u003e)\n\nOR initialize the DHT22 device:\n\n.. code:: python\n\n    dht_device = adafruit_dht.DHT22(\u003cpin\u003e)\n\nRead temperature and humidity\n------------------------------\n\nNow get the temperature and humidity values\n\n.. code:: python\n\n    temperature = dht_device.temperature\n    humidity = dht_device.humidity\n\nThese properties may raise an exception if a problem occurs.  You should use try/raise\nlogic and catch RuntimeError and then retry getting the values after at least 2 seconds.\nIf you try again to get a result within 2 seconds, cached values are returned.\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs \u003chttps://docs.circuitpython.org/projects/dht/en/latest/\u003e`_.\n\nFor information on building library documentation, please check out `this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/main/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_dht","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_dht","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_dht/lists"}