Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

A CircuitPython driver for the Sensirion SGP30 gas sensor with eCO2 and TVOC output. This sensor uses I2C!

Installation and Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-sgp30

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-sgp30

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-sgp30

Usage Notes

See the guide for wiring and installation instructions.

First, import the library:

import busio
import adafruit_sgp30

Next, initialize the I2C bus object:

import board
i2c_bus = busio.I2C(board.SCL, board.SDA, frequency=100000)

Since we have the I2C bus object, we can now use it to instantiate the SGP30 object:

sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c_bus)

Reading from the Sensor

To read from the sensor:

eCO2, TVOC = sgp30.iaq_measure()
print("eCO2 = %d ppm \t TVOC = %d ppb" % (eCO2, TVOC))

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Release files for adafruit-circuitpython-sgp30 3.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adafruit-circuitpython-sgp30 3.0.16
File Size Uploaded
adafruit_circuitpython_sgp30-3.0.16.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adafruit-circuitpython-sgp30 3.0.16
File Interpreter ABI Platform
adafruit_circuitpython_sgp30-3.0.16-py3-none-any.whl Python 3 none any Details

Total release size: 30.7 kB

Release files / adafruit_circuitpython_sgp30-3.0.16.tar.gz

Download URL adafruit_circuitpython_sgp30-3.0.16.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
69b19c44e1e0b5a389cd3f923469888b2529c571c2335a37f155c0bb8a95462d
BLAKE2b-256 checksum
How to use checksums
922d3e6ef0d9b7b390189812064b84226ae9d5b27bf42d39a1a250724a13f318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / adafruit_circuitpython_sgp30-3.0.16-py3-none-any.whl

Download URL adafruit_circuitpython_sgp30-3.0.16-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d17679967cdb41cfa88172d7ad34bb2b7e8a36a6cf6c63623fbd5787456e01e
BLAKE2b-256 checksum
How to use checksums
82710bd5dc2559338cac8a59a90a73a804e541a2fb116261418a0aeb26f7b6e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

3.0.16 This release

2 release files

3.0.15

2 release files

3.0.14

2 release files

3.0.13

2 release files

3.0.12

2 release files

3.0.11

2 release files

3.0.9

2 release files

3.0.8

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.4.2

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.7

1 release file

2.3.6

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page