adafruit_sgp30
¶
I2C driver for SGP30 Sensirion VoC sensor
Author(s): ladyada
Implementation Notes¶
Hardware:
Adafruit SGP30 Air Quality Sensor Breakout - VOC and eCO2 (Product ID: 3709)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_sgp30.Adafruit_SGP30(i2c: I2C, address: int = 88)[source]¶
A driver for the SGP30 gas sensor.
- Parameters:
Quickstart: Importing and using the SGP30 temperature sensor
Here is one way of importing the
Adafruit_SGP30
class so you can use it with the namesgp30
. First you will need to import the libraries to use the sensorimport busio import board import adafruit_sgp30
Once this is done you can define your
busio.I2C
object and define your sensor objecti2c = busio.I2C(board.SCL, board.SDA, frequency=100000) sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
Now you have access to the Carbon Dioxide Equivalent baseline using the
baseline_eCO2
attribute and the Total Volatile Organic Compound baseline using thebaseline_TVOC
eCO2 = sgp30.baseline_eCO2 TVOC = sgp30.baseline_TVOC
- set_iaq_baseline(eCO2: int, TVOC: int) None [source]¶
Set the previously recorded IAQ algorithm baseline for eCO2 and TVOC