Skip to content

BMP280 / BME280 — Pressure & temperature

I2C address 0x76 (decimal 118) in this driver. Detects BMP280 vs BME280 (humidity) from the chip ID.

Connect and read

from eyes17 import eyes
from eyes17.SENSORS import BMP280

p = eyes.open()
baro = BMP280.connect(p.I2C)
vals = baro.getVals()
# [pressure_hPa, temperature_C, humidity_%]
# humidity is 0 on BMP280 (no RH sensor)
print(vals)
print(baro.readPressure(), baro.readTemperature(), baro.readHumidity())

Note

This module exposes getVals(), not getRaw().

Notes

  • Reset and calibration coefficients are loaded in __init__.
  • Oversampling is set for pressure and temperature at init; BME280 also enables humidity oversampling.
  • For altitude, calibrate a baseline pressure and use altitude() / sealevel() helpers if needed.