Introduction
============
Python library using smbus2 for the Adafruit AHT10 or AHT20 Humidity and Temperature Sensor
Based on original solution from Adafruit repo: https://github.com/adafruit/Adafruit_CircuitPython_AHTx0
Dependency lightweight
Dependencies
=============
This library depends on:
* smbus2
Installing from PyPI
=====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the library locally `from
PyPI <https://pypi.org/project/py-AHTx0/>`_. To install for current user:
.. code-block:: shell
pip3 install py_AHTx0
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install py_AHTx0
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install py_AHTx0
Usage Example
=============
.. code-block:: python3
import py_AHTx0
# aht10 - init
port = 1
address = 0x38
aht10_sensor = py_AHTx0.AHTx0(port, address)
while True:
print(aht10_sensor.temperature)
print(aht10_sensor.relative_humidity)
time.sleep(2)
Documentation
=============
calibrate() → bool
Ask the sensor to self-calibrate. Returns True on success, False otherwise
property relative_humidity: int
The measured relative humidity in percent.
reset() → None
Perform a soft-reset of the AHT
property status: int
The status byte initially returned from the sensor, see datasheet for details
property temperature: int
The measured temperature in degrees Celsius.
Raw data
{
"_id": null,
"home_page": "https://github.com/4meters/py_AHTx0",
"name": "py-AHTx0",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.6",
"maintainer_email": null,
"keywords": "raspberry pi, orange pi, banana pi, rpi, AHT10, AHT20, i2c, i\u00b2c, temperature, humidity, smbus2",
"author": "Kattni Rembor, Marcin Ryznar",
"author_email": "poczta321123@onet.pl",
"download_url": "https://files.pythonhosted.org/packages/de/4c/258c7c44fa686502bc2bf2171824b6443eaf6e5ea1d1c73a702a41cc4ec7/py_AHTx0-0.1.2.tar.gz",
"platform": null,
"description": "Introduction\r\n============\r\n\r\nPython library using smbus2 for the Adafruit AHT10 or AHT20 Humidity and Temperature Sensor\r\n\r\nBased on original solution from Adafruit repo: https://github.com/adafruit/Adafruit_CircuitPython_AHTx0\r\n\r\nDependency lightweight\r\n\r\nDependencies\r\n=============\r\nThis library depends on:\r\n\r\n* smbus2\r\n\r\nInstalling from PyPI\r\n=====================\r\n\r\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the library locally `from\r\nPyPI <https://pypi.org/project/py-AHTx0/>`_. To install for current user:\r\n\r\n.. code-block:: shell\r\n\r\n pip3 install py_AHTx0\r\n\r\nTo install system-wide (this may be required in some cases):\r\n\r\n.. code-block:: shell\r\n\r\n sudo pip3 install py_AHTx0\r\n\r\nTo install in a virtual environment in your current project:\r\n\r\n.. code-block:: shell\r\n\r\n mkdir project-name && cd project-name\r\n python3 -m venv .venv\r\n source .venv/bin/activate\r\n pip3 install py_AHTx0\r\n\r\nUsage Example\r\n=============\r\n\r\n.. code-block:: python3\r\n\r\n import py_AHTx0\r\n\r\n # aht10 - init\r\n port = 1\r\n address = 0x38\r\n\r\n aht10_sensor = py_AHTx0.AHTx0(port, address)\r\n\r\n while True:\r\n print(aht10_sensor.temperature)\r\n print(aht10_sensor.relative_humidity)\r\n time.sleep(2)\r\n\r\n\r\nDocumentation\r\n=============\r\n\r\n\r\ncalibrate() \u2192 bool\r\n\r\n Ask the sensor to self-calibrate. Returns True on success, False otherwise\r\n\r\nproperty relative_humidity: int\r\n\r\n The measured relative humidity in percent.\r\n\r\nreset() \u2192 None\r\n\r\n Perform a soft-reset of the AHT\r\n\r\nproperty status: int\r\n\r\n The status byte initially returned from the sensor, see datasheet for details\r\n\r\nproperty temperature: int\r\n\r\n The measured temperature in degrees Celsius.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library to drive a AHT10 or AHT20 temperature, humidity sensor over I\u00b2C",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/4meters/py_AHTx0"
},
"split_keywords": [
"raspberry pi",
" orange pi",
" banana pi",
" rpi",
" aht10",
" aht20",
" i2c",
" i\u00b2c",
" temperature",
" humidity",
" smbus2"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "067877f703b6efc7c2f5952fadff4d38b693b76c579e5917ee740f4c0714e443",
"md5": "95e3ed832ef8323f1b38a2dd4b0a14a7",
"sha256": "585cb76c130c46d4a8ae1bb4943446a47b784093b9ddbb34c5e9a71cf6a377e2"
},
"downloads": -1,
"filename": "py_AHTx0-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95e3ed832ef8323f1b38a2dd4b0a14a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.6",
"size": 4616,
"upload_time": "2024-07-27T19:46:14",
"upload_time_iso_8601": "2024-07-27T19:46:14.319550Z",
"url": "https://files.pythonhosted.org/packages/06/78/77f703b6efc7c2f5952fadff4d38b693b76c579e5917ee740f4c0714e443/py_AHTx0-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "de4c258c7c44fa686502bc2bf2171824b6443eaf6e5ea1d1c73a702a41cc4ec7",
"md5": "677e1b8658101154287cd82a15ab0922",
"sha256": "7852c1bc87f1f519bfd5fbde5f3dc7f6ed54a9cc97c885feb1244f9b13f2dada"
},
"downloads": -1,
"filename": "py_AHTx0-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "677e1b8658101154287cd82a15ab0922",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.6",
"size": 4601,
"upload_time": "2024-07-27T19:46:15",
"upload_time_iso_8601": "2024-07-27T19:46:15.972129Z",
"url": "https://files.pythonhosted.org/packages/de/4c/258c7c44fa686502bc2bf2171824b6443eaf6e5ea1d1c73a702a41cc4ec7/py_AHTx0-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-27 19:46:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "4meters",
"github_project": "py_AHTx0",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "py-ahtx0"
}