BME280 initial readings

I have 2 x Pimoroni BME280 and they both produce the same initial reading of 21.95*C 698.09hPa 76.34% humidity.

Using this simple code

import time
from smbus2 import SMBus
from bme280 import BME280
bus = SMBus(1)
bme280 = BME280(i2c_dev=bus)
while True:
    temperature = bme280.get_temperature()
    pressure = bme280.get_pressure()
    humidity = bme280.get_humidity()
    print('{:05.2f}*C {:05.2f}hPa {:05.2f}%'.format(temperature, pressure, humidity))
    time.sleep(1)

and I always get as the first line of output as…

21.95*C 698.09hPa 76.34%

followed by the correct data for example…

18.70*C 993.54hPa 55.88%

18.70*C 993.53hPa 56.12%

18.71*C 993.54hPa 56.06%

18.71*C 993.54hPa 55.95%

Does anybody know why this is?

The first read triggers the first conversion (in bme280 speak). Probably the code reads the registers faster than the conversion takes. Subsequent readings should be fine. You will find a similar behavior with other sensors as well. So it is not a bad idea just to ignore the very first measurement.

1 Like