Seeed SGP30
The SGP30 is a digital multi-pixel gas sensor designed for easy integration into air purifier, demand-controlled ventilation, and IoT applications. Sensirion’s CMOSens®technology offers a complete sensor system on a single chip featuring a digital I2C interface, a temperature controlled micro hotplate, and two preprocessed indoor air quality signals. As the first metal-oxide gas sensor featuring multiple sensing elements on one chip, the SGP30 provides more detailed information about the air quality.
This code is for
Dependencies
This driver depends on:
This is easy to install with the following command.
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
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 seeed-python-sgp30
To install system-wide (this may be required in some cases):
sudo pip3 install seeed-python-sgp30
Usage Notes
First, Check the corresponding i2c number of the board:
(.env) pi@raspberrypi:~ $ ls /dev/i2c*
/dev/i2c-1
Check if the i2c device works properly, 0x58 is the SGP30 i2c address.
pi@raspberrypi:~/Seeed_Python_SGP30 $ i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- 04 -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- 58 -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Next, initialize the sersor object:
import seeed_sgp30
from grove.i2c import Bus
sgp30 = seeed_sgp30.grove_sgp30(Bus(1)) #The default on the raspberry pie is 1, so you can also use Bus()
Reading from the Sensor
To read from the sensor:
data = sgp30.read_measurements()
co2_eq_ppm, tvoc_ppb = data.data
print("\r tVOC = {} ppb CO2eq = {} ppm ".format(
tvoc_ppb, co2_eq_ppm))
Contributing
If you have any good suggestions or comments, you can send issues or PR us.
Metadata
Release files for seeed-python-sgp30 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seeed-python-sgp30-0.1.0.tar.gz | 3.1 kB | Without provenance | Details for seeed-python-sgp30-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seeed_python_sgp30-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for seeed_python_sgp30-0.1.0-py3-none-any.whl |
Total release size: 6.9 kB
Release files / seeed-python-sgp30-0.1.0.tar.gz
| Download URL | seeed-python-sgp30-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed690b66f3d39cd3c6a89026e3b898d5525488ebd3e2278ef35ce32407cbc551
|
|
BLAKE2b-256 checksum How to use checksums |
7a6ed5c5bb666729313e2d40037b31cdccab782468ddf5efe0b0b5fd76fe640d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / seeed_python_sgp30-0.1.0-py3-none-any.whl
| Download URL | seeed_python_sgp30-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
facd8d66f68c0dd7e207dd12e2453d9d88a86e00afa76acc1f540716b3df33a5
|
|
BLAKE2b-256 checksum How to use checksums |
3920fef0cca7d7147e3ead210025ef84673603d7ee03ba323046ca1b831930f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for seeed-python-sgp30 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.