janw-cz / JWA_BME280

Arduino library for BME280 sensor based on reference driver
15 stars 9 forks source link

Properly implement temperature offset in compensation data #7

Closed ericbeaudry closed 4 years ago

ericbeaudry commented 5 years ago

I'm experiencing large deviations with my current batch of BME280.

Please note: I've tried reconditioning them, updating my driver to the latest code, using forced or normal mode but nothing can get rid of those 5 to 8 C off the real temperature. I've been through many posts stating the BMEs may have some accuracy problems but never to that scale. We could have a long debate regarding the underlying issue but that's not the point here. The fact here is 2 BME280 sitting side by side are respectively reporting 23C and 31C.

I'm only looking to implement a software offset the proper way. Looking a the calibration data and the procedures in the driver, I have no clue how I should implement it. Well I know I could reverse all those bit shifting and calculations but that would take a while... probably a very long while!

I'm pretty sure there's a way to change the compensation data once read from the BME to factor in an offset and keep all the calculations untouched.

Would anyone share how to achieve that? Thanks a lot!

janw-cz commented 4 years ago

Hello,

the sensor should come precalibrated from manufacture. The calibration data is read from the sensor and used by internal compensation algorithm in bme280.c.

If the readings are still incorrect I would not change the compensation data. I would rather implement additional offset correction inside the specific application.

Have fun