bme280 package¶
Submodules¶
bme280.const module¶
bme280.reader module¶
Module contents¶
Raspberry Pi BME280 Driver.
- class bme280.compensated_readings(raw_readings, compensation_params)¶
Bases:
object
Compensation formulas translated from Appendix A (8.1) of BME280 datasheet:
Temperature in °C, double precision. Output value of “51.23” equals 51.23 °C
Pressure in hPa as double. Output value of “963.862” equals 963.862 hPa
Humidity in %rH as as double. Output value of “46.332” represents 46.332 %rH
- bme280.load_calibration_params(bus, address=118)¶
The BME280 output consists of the ADC output values. However, each sensing element behaves differently. Therefore, the actual pressure and temperature must be calculated using a set of calibration parameters.
The calibration parameters are subsequently used to with some compensation formula to perform temperature readout in degC, humidity in % and pressure in hPA.
- bme280.sample(bus, address=118, compensation_params=None, sampling=1)¶
Primes the sensor for reading (defaut: x1 oversampling), pauses for a set amount of time so that the reading stabilizes, and then returns a compensated reading object with the following attributes:
timestamp (Python’s datetime object) when reading was taken.
temperature, in degrees Celcius.
humidity, in % relative humidity.
pressure, in hPa.