adafruit_bme680
¶
CircuitPython library for BME680 temperature, pressure and humidity sensor.
- Author(s): Limor Fried
Implementation Notes¶
Hardware:
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_bme680.
Adafruit_BME680
(*, refresh_rate=10)[source]¶ Driver from BME680 air quality sensor
Parameters: refresh_rate (int) – Maximum number of readings per second. Faster property reads will be from the previous reading. -
altitude
¶ The altitude based on current
pressure
vs the sea level pressure (sea_level_pressure
) - which you must enter ahead of time)
-
filter_size
¶ The filter size for the built in IIR filter
-
gas
¶ The gas resistance in ohms
-
humidity
¶ The relative humidity in RH %
-
humidity_oversample
¶ The oversampling for humidity sensor
-
pressure
¶ The barometric pressure in hectoPascals
-
pressure_oversample
¶ The oversampling for pressure sensor
-
relative_humidity
¶ The relative humidity in RH %
-
temperature
¶ The compensated temperature in degrees Celsius.
-
temperature_oversample
¶ The oversampling for temperature sensor
-
-
class
adafruit_bme680.
Adafruit_BME680_I2C
(i2c, address=119, debug=False, *, refresh_rate=10)[source]¶ Driver for I2C connected BME680.
Parameters: Quickstart: Importing and using the BME680
Here is an example of using the
BMP680_I2C
class. First you will need to import the libraries to use the sensorimport board import adafruit_bme680
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA bme680 = adafruit_bme680.Adafruit_BME680_I2C(i2c)
You need to setup the pressure at sea level
bme680.sea_level_pressure = 1013.25
Now you have access to the
temperature
,gas
,relative_humidity
,pressure
andaltitude
attributestemperature = bme680.temperature gas = bme680.gas relative_humidity = bme680.relative_humidity pressure = bme680.pressure altitude = bme680.altitude
-
class
adafruit_bme680.
Adafruit_BME680_SPI
(spi, cs, baudrate=100000, debug=False, *, refresh_rate=10)[source]¶ Driver for SPI connected BME680.
Parameters: Quickstart: Importing and using the BME680
Here is an example of using the
BMP680_SPI
class. First you will need to import the libraries to use the sensorimport board from digitalio import DigitalInOut, Direction import adafruit_bme680
Once this is done you can define your
board.SPI
object and define your sensor objectcs = digitalio.DigitalInOut(board.D10) spi = board.SPI() bme680 = adafruit_bme680.Adafruit_BME680_SPI(spi, cs)
You need to setup the pressure at sea level
bme680.sea_level_pressure = 1013.25
Now you have access to the
temperature
,gas
,relative_humidity
,pressure
andaltitude
attributestemperature = bme680.temperature gas = bme680.gas relative_humidity = bme680.relative_humidity pressure = bme680.pressure altitude = bme680.altitude