Skip to content

Sample code for reading values from a BME280 temperature-humidity-pressure sensor, via ESP-IDF's I2C master driver, supports both normal mode and forced mode described in the datasheet. https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280_DS001-11.pdf

License

Notifications You must be signed in to change notification settings

ninnux/bme280-esp-idf-i2c

 
 

Repository files navigation

Sample code for reading values from a BME280 via ESP-IDF's I2C master driver

See main code main.c.

About

This sample code implement procedures to read values from BME280 sensor (pressure, temperature, humidity) via ESP-IDF's I2C master driver. It supports both normal mode and forced mode described in Bosch's BME280 datasheet, Section 3.3 Sensor modes, Page 12.

For local setup

For your local setup, connect SDI pin to GPIO 15 pin and the SCK to GPIO 2 pin as they are default ports (I2C_SDA, I2C_SCL) for I2C master according to ESP32 datasheet, C.4. IO_MUX, Page 49.

Don't forget to connect SDO to Vio too. It maps device address to 0x77 (not 0x76). This is default setup for BME280 I2C as described in Bosch's BME280 datasheet, Section 6.2 I2C Interface, Page 31.

About

Sample code for reading values from a BME280 temperature-humidity-pressure sensor, via ESP-IDF's I2C master driver, supports both normal mode and forced mode described in the datasheet. https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280_DS001-11.pdf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 89.5%
  • Makefile 10.5%