Adafruit BME680 Library Documentation

Similar documents
Adafruit SI7021 Library Documentation

Adafruit s DS3231 RTC Library Documentation

Adafruit s PCF8523 RTC Library Documentation

Adafruit AM2320 Sensor

Adafruit Color Sensors

Adafruit Si7021 Temperature + Humidity Sensor

Adafruit CCS811 Air Quality Sensor

Adafruit DRV2605 Haptic Controller Breakout

Adafruit SGP30 TVOC/eCO2 Gas Sensor

Adafruit GPIO Expander Bonnet for Raspberry Pi Created by Kattni Rembor. Last updated on :12:47 PM UTC

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

Adafruit APDS9960 breakout

MLX90393 Wide-Range 3-Axis Magnetometer

Adafruit AS channel Visible Light Sensor

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Adafruit MMA8451 Accelerometer Breakout

Adafruit MPRLS Ported Pressure Sensor Breakout

Adafruit AMG8833 8x8 Thermal Camera Sensor

Adafruit MAX31865 RTD PT100 or PT1000 Amplifier

TSL2561 Luminosity Sensor

Adafruit MMA8451 Accelerometer Breakout

MCP Bit DAC Tutorial

Adafruit 10-DOF IMU Breakout

LED Breath Stats Mask

Grove - LED Bar. Introduction. Features

Adafruit DS3231 Precision RTC Breakout

Adafruit 7-Segment LED FeatherWings

PyPortal NeoPixel Color Picker Created by Kattni Rembor. Last updated on :42:41 PM UTC

Data Logging with Feather and CircuitPython

Adafruit IO Basics: Servo

Adafruit PCF8523 Real Time Clock

IS31FL x9 Charlieplexed PWM LED Driver

Adafruit 8x16 LED Matrix FeatherWing

Adafruit 9-DOF IMU Breakout

Adafruit IO Basics: Feeds

Adafruit eink Display Breakouts

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

14-Segment Alpha-numeric LED FeatherWing

Trinket-Powered Conference Room Occupancy Display

Joy Featherwing. Created by Dean Miller. Last updated on :03:07 PM UTC

Adafruit TSL2591 High Dynamic Range Digital Light Sensor

Adafruit IO Basics: Temperature & Humidity

CircuitPlayground Minecraft Gesture Controller

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

OpenSesame EyeLink tutorial

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

Adabot Operation Game

Android GBoard Morse Code Control with Circuit Playground Express

Datalogging Hat with FLORA BLE

Naughty or Nice Machine

Interactive Gift Box. Created by codingpro. Last updated on :47:40 AM UTC

Toy Car Speed Timer. Created by Kirby Griese. Last updated on :13:49 PM UTC

Large Pi-based Thermometer and Clock

0.96" mini Color OLED

Monochrome OLED Breakouts

Adafruit GPS Hat in Windows IoT Core

Adafruit MMA8451 Accelerometer Breakout

Introducing Circuit Playground

Adafruit Capacitive Touch Sensor Breakouts

Collin's Lab: Multimeters

Adafruit Stepper + DC Motor FeatherWing

Sash Open Area Module (SOAM)

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

HalloWing Jump Scare Trap

Steam Heat Retrofit for Coover Hall

The Scream: Interactive Screaming Painting

i2c/spi LCD Backpack Created by lady ada Last updated on :11:04 PM UTC

Adafruit I2C FRAM Breakout

Flora Wearable GPS. Created by Becky Stern. Last updated on :32:36 PM UTC

RGB LCD Shield. Created by lady ada. Last updated on :48:40 PM UTC

Getting Started with FLORA

Sewable NeoPixels. Created by Becky Stern. Last updated on :50:14 PM EDT

Sino:bit with Arduino

Using IFTTT with Adafruit IO to Make an IoT Door Detector

OBIS Scientific Remote

Adafruit IO Basics: Digital Output

Introducing Circuit Playground

Trash Panda. Created by Dano Wall. Last updated on :30:46 AM UTC

Prophet 600 GliGli mod

Stumble-Bot. Created by Dano Wall. Last updated on :04:06 AM UTC

BeagleBone. Created by lady ada. Last updated on :46:10 PM UTC

Adafruit 8x16 LED Matrix FeatherWing

Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

B15. Smart Healthy Bracelet BRACELET USER GUIDE

Micro:bit with Arduino

Adafruit Mini TFT " 160x80

Adafruit 1.27" and 1.5" Color OLED Breakout Board

Desktop Fume Extractor

Grove - 4-Digit Display

The Infinite (Gates Of Thread And Stone Series) By Lori M. Lee READ ONLINE

Crickit Dancing Marionette Kit Created by Dano Wall. Last updated on :03:11 PM UTC

Adafruit ATWINC1500 WiFi Breakout

Circuit Playground Express Head-Tilt Ears

MCP Bit DAC Tutorial

Adafruit ATWINC1500 WiFi Breakout

PVC Documentation. Release Marin Atanasov Nikolov

Reindeer Mask with Animated Eyes

Chilton 2014 Labor Guide CD-ROM (Domestic & Import) By Chilton READ ONLINE

Adafruit ATWINC1500 WiFi Breakout

The Works Of Rudyard Kipling; One Volume Edition. By Rudyard Kipling READ ONLINE

Transcription:

Adafruit BME680 Library Documentation Release 1.0 ladyada Aug 25, 2018

Contents 1 Dependencies 3 2 Usage Example 5 3 Contributing 7 4 Building locally 9 4.1 Sphinx documentation.......................................... 9 5 Table of Contents 11 5.1 Simple test................................................ 11 5.2 adafruit_bme680 - Adafruit BME680 - Temperature, Humidity, Pressure & Gas Sensor..... 11 6 Indices and tables 13 Python Module Index 15 i

ii

Adafruit BME680 Library Documentation, Release 1.0 CircuitPython driver for BME680 sensor over I2C Contents 1

Adafruit BME680 Library Documentation, Release 1.0 2 Contents

CHAPTER 1 Dependencies This driver depends on: Adafruit CircuitPython Bus Device Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle. 3

Adafruit BME680 Library Documentation, Release 1.0 4 Chapter 1. Dependencies

CHAPTER 2 Usage Example import gc from busio import I2C import adafruit_bme680 import time import board gc.collect() print("free mem:",gc.mem_free()) # Create library object using our Bus I2C port i2c = I2C(board.SCL, board.sda) bme680 = adafruit_bme680.adafruit_bme680_i2c(i2c) # change this to match the location's pressure (hpa) at sea level bme680.sea_level_pressure = 1013.25 while True: print("\ntemperature: %0.1f C" % bme680.temperature) print("gas: %d ohm" % bme680.gas) print("humidity: %0.1f %%" % bme680.humidity) print("pressure: %0.3f hpa" % bme680.pressure) print("altitude = %0.2f meters" % bme680.altitude) time.sleep(2) 5

Adafruit BME680 Library Documentation, Release 1.0 6 Chapter 2. Usage Example

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

Adafruit BME680 Library Documentation, Release 1.0 8 Chapter 3. Contributing

CHAPTER 4 Building locally To build this library locally you ll need to install the circuitpython-build-tools package. python3 -m venv.env source.env/bin/activate pip install circuitpython-build-tools Once installed, make sure you are in the virtual environment: source.env/bin/activate Then run the build: circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bme680 --library_ location. 4.1 Sphinx documentation Sphinx is used to build the documentation based on rst files and comments in the code. First, install dependencies (feel free to reuse the virtual environment from above): python3 -m venv.env source.env/bin/activate pip install Sphinx sphinx-rtd-theme Now, once you have the virtual environment activated: cd docs sphinx-build -E -W -b html. _build/html This will output the documentation to docs/_build/html. Open the index.html in your browser to view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to locally verify it will pass. 9

Adafruit BME680 Library Documentation, Release 1.0 10 Chapter 4. Building locally

CHAPTER 5 Table of Contents 5.1 Simple test Ensure your device works with this simple test. 1 import time 2 import board 3 from busio import I2C 4 import adafruit_bme680 5 Listing 1: examples/bme680_simpletest.py 6 # Create library object using our Bus I2C port 7 i2c = I2C(board.SCL, board.sda) 8 bme680 = adafruit_bme680.adafruit_bme680_i2c(i2c, debug=false) 9 10 # change this to match the location's pressure (hpa) at sea level 11 bme680.sea_level_pressure = 1013.25 12 13 while True: 14 print("\ntemperature: %0.1f C" % bme680.temperature) 15 print("gas: %d ohm" % bme680.gas) 16 print("humidity: %0.1f %%" % bme680.humidity) 17 print("pressure: %0.3f hpa" % bme680.pressure) 18 print("altitude = %0.2f meters" % bme680.altitude) 19 20 time.sleep(1) 5.2 adafruit_bme680 - Adafruit BME680 - Temperature, Humidity, Pressure & Gas Sensor CircuitPython driver from BME680 air quality sensor 11

Adafruit BME680 Library Documentation, Release 1.0 Author(s): ladyada class adafruit_bme680.adafruit_bme680(*, refresh_rate=10) 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 sea_level_pressure = None Pressure in hectopascals at sea level. Used to calibrate altitude. 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) Driver for I2C connected BME680. Parameters address (int) I2C device address debug (bool) Print debug statements when True. refresh_rate (int) Maximum number of readings per second. Faster property reads will be from the previous reading. 12 Chapter 5. Table of Contents

CHAPTER 6 Indices and tables genindex modindex search 13

Adafruit BME680 Library Documentation, Release 1.0 14 Chapter 6. Indices and tables

Python Module Index a adafruit_bme680, 11 15

Adafruit BME680 Library Documentation, Release 1.0 16 Python Module Index

Index A Adafruit_BME680 (class in adafruit_bme680), 12 adafruit_bme680 (module), 11 Adafruit_BME680_I2C (class in adafruit_bme680), 12 altitude (adafruit_bme680.adafruit_bme680 attribute), 12 F filter_size (adafruit_bme680.adafruit_bme680 attribute), 12 G gas (adafruit_bme680.adafruit_bme680 attribute), 12 H humidity (adafruit_bme680.adafruit_bme680 attribute), 12 humidity_oversample (adafruit_bme680.adafruit_bme680 attribute), 12 P pressure (adafruit_bme680.adafruit_bme680 attribute), 12 pressure_oversample (adafruit_bme680.adafruit_bme680 attribute), 12 S sea_level_pressure (adafruit_bme680.adafruit_bme680 attribute), 12 T temperature (adafruit_bme680.adafruit_bme680 attribute), 12 temperature_oversample (adafruit_bme680.adafruit_bme680 attribute), 12 17