Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-sgp40/badge/?version=latest
:target: https://docs.circuitpython.org/projects/sgp40/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_SGP40/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_SGP40/actions
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
CircuitPython library for the Adafruit SGP40 Air Quality Sensor / VOC Index Sensor Breakouts
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.
Installing from PyPI
=====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-sgp40/>`_. To install for current user:
.. code-block:: shell
pip3 install adafruit-circuitpython-sgp40
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-sgp40
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 adafruit-circuitpython-sgp40
Usage Example
=============
.. code-block:: python3
import time
import board
import adafruit_sgp40
i2c = board.I2C() # uses board.SCL and board.SDA
sgp = adafruit_sgp40.SGP40(i2c)
while True:
print("Measurement: ", sgp.raw)
print("")
sleep(1)
For humidity compensated raw gas and voc index readings, we'll need a secondary sensor such as the bme280
.. code-block:: python3
import time
import board
import adafruit_sgp40
import adafruit_bme280
i2c = board.I2C() # uses board.SCL and board.SDA
sgp = adafruit_sgp40.SGP40(i2c)
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
while True:
temperature = bme280.temperature
humidity = bme280.relative_humidity
# For compensated raw gas readings
"""
compensated_raw_gas = sgp.measure_raw(
temperature=temperature, relative_humidity=humidity
)
print("Raw Data:", compensated_raw_gas)
"""
# For Compensated voc index readings
voc_index = sgp.measure_index(
temperature=temperature, relative_humidity=humidity)
print("VOC Index:", voc_index)
print("")
time.sleep(1)
It may take several minutes for the VOC index to start changing as it calibrates the baseline readings.
The voc algorithm expects a 1 hertz sampling rate. Run `measure_index()` once per second.
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/sgp40/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_SGP40/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": "",
"name": "adafruit-circuitpython-sgp40",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "adafruit,blinka,circuitpython,micropython,sgp40,IAQ,Air Quality,VOC,MOX,Gas",
"author": "",
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/a5/79/b5e4a1df46ba63cd8dd9caecd63a6204c9d03c469a484fb0f9732337aec7/adafruit-circuitpython-sgp40-1.3.17.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-sgp40/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/sgp40/en/latest/\n :alt: Documentation Status\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_SGP40/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_SGP40/actions\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nCircuitPython library for the Adafruit SGP40 Air Quality Sensor / VOC Index Sensor Breakouts\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_\n* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_.\n\nInstalling from PyPI\n=====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-sgp40/>`_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-sgp40\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-sgp40\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .venv\n source .venv/bin/activate\n pip3 install adafruit-circuitpython-sgp40\n\nUsage Example\n=============\n\n.. code-block:: python3\n\n import time\n import board\n import adafruit_sgp40\n\n i2c = board.I2C() # uses board.SCL and board.SDA\n sgp = adafruit_sgp40.SGP40(i2c)\n\n while True:\n print(\"Measurement: \", sgp.raw)\n print(\"\")\n sleep(1)\n\nFor humidity compensated raw gas and voc index readings, we'll need a secondary sensor such as the bme280\n\n.. code-block:: python3\n\n import time\n import board\n import adafruit_sgp40\n import adafruit_bme280\n\n i2c = board.I2C() # uses board.SCL and board.SDA\n sgp = adafruit_sgp40.SGP40(i2c)\n bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)\n\n while True:\n temperature = bme280.temperature\n humidity = bme280.relative_humidity\n\n # For compensated raw gas readings\n \"\"\"\n compensated_raw_gas = sgp.measure_raw(\n temperature=temperature, relative_humidity=humidity\n )\n print(\"Raw Data:\", compensated_raw_gas)\n \"\"\"\n\n # For Compensated voc index readings\n voc_index = sgp.measure_index(\n temperature=temperature, relative_humidity=humidity)\n\n print(\"VOC Index:\", voc_index)\n print(\"\")\n time.sleep(1)\n\nIt may take several minutes for the VOC index to start changing as it calibrates the baseline readings.\nThe voc algorithm expects a 1 hertz sampling rate. Run `measure_index()` once per second.\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/sgp40/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_SGP40/blob/master/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CircuitPython library for the Adafruit SGP40 Air Quality Sensor / VOC Index Sensor Breakouts",
"version": "1.3.17",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_SGP40"
},
"split_keywords": [
"adafruit",
"blinka",
"circuitpython",
"micropython",
"sgp40",
"iaq",
"air quality",
"voc",
"mox",
"gas"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "977431074c1dae13fd7f06d6baa35c46607714bbb6ddeb288673c90f3f13da70",
"md5": "ec4e6bb92b30ed568535002426c180cb",
"sha256": "848950e3a6a24b45f0aa205c083455c96e0d6c04711345aaa58a4c6b992a073d"
},
"downloads": -1,
"filename": "adafruit_circuitpython_sgp40-1.3.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ec4e6bb92b30ed568535002426c180cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12537,
"upload_time": "2023-12-09T17:33:52",
"upload_time_iso_8601": "2023-12-09T17:33:52.624264Z",
"url": "https://files.pythonhosted.org/packages/97/74/31074c1dae13fd7f06d6baa35c46607714bbb6ddeb288673c90f3f13da70/adafruit_circuitpython_sgp40-1.3.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a579b5e4a1df46ba63cd8dd9caecd63a6204c9d03c469a484fb0f9732337aec7",
"md5": "f026ed74d9ab50fff013dbb01be2b29c",
"sha256": "ade73e4321c91a402a47ad8dd2b54804c2185a9b46e63fb781d828f063738317"
},
"downloads": -1,
"filename": "adafruit-circuitpython-sgp40-1.3.17.tar.gz",
"has_sig": false,
"md5_digest": "f026ed74d9ab50fff013dbb01be2b29c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33627,
"upload_time": "2023-12-09T17:33:53",
"upload_time_iso_8601": "2023-12-09T17:33:53.879612Z",
"url": "https://files.pythonhosted.org/packages/a5/79/b5e4a1df46ba63cd8dd9caecd63a6204c9d03c469a484fb0f9732337aec7/adafruit-circuitpython-sgp40-1.3.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-09 17:33:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_SGP40",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "adafruit-circuitpython-sgp40"
}