-
Notifications
You must be signed in to change notification settings - Fork 39
Added temperature offset #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you point to where this offset exists in other libraries? We shouldn't include it in this library unless it's explicitly recommended by Bosch. I don't see it here: https://github.com/BoschSensortec/BME680_driver/blob/master/bme680.c#L867-L882
@tannewt Yep. This library uses the bsec library and has that offset. Also, issue #29 indicates that without the offset, the Adafruit library is inaccurate. I did verify this by running both libraries and found that the one built on top of the bsec library was correct. https://github.com/alexh-name/bsec_bme680_linux#configure-and-compile |
@tannewt Also, I took a quick read through the datasheet, and it seems clear they want you to do the offset that accounts for the temperature around the sensor. It does seem like the bsec library has functions to do that, although the library I linked doesn't appear to use them. edit: looked through the bsec library. Couldn't find any functions that offset the temperature, although it is pretty clear that's something they expect should be done if you want to get the ambient temperature |
I don't think this belongs in the library itself because it will depend on what surrounds the sensor. Instead, please update the example to demonstrate shifting the temp value. That will make it clear that someone needs to adjust it for accuracy. |
@tannewt Ok, I'll do that |
@tannewt What would you think about me changing the default value of |
I don't think the library should do the offset because it's only for the chip. The temperature is correct for the chip itself. Offsetting is something that should be done externally in calibration. So, I think it should only be in the example and the Learn guide. |
@tannewt Ok, that makes sense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split it out separately so it's clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.2.3 from 3.2.2: > Merge pull request adafruit/Adafruit_CircuitPython_BME680#32 from adafruit/temp-offset Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 1.5.1 from 1.5.0: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#20 from kmatch98/master
while True: | ||
print("\nTemperature: %0.1f C" % bme680.temperature) | ||
print("\nTemperature: %0.1f C" % bme680.temperature + temperature_offset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw. Parentheses should be surrounding the calculation.
print("\nTemperature: %0.1f C" % (bme680.temperature + temperature_offset))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houmark Good catch! If you could file an issue, it would be greatly appreciated. Or, if you're comfortable submitting a PR, that would be amazing too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually fixed in a this commit, so nothing more to do here ;)
The BME680's sensor almost always measures 5 degrees C hotter than the temperature actually is due to heat created by the sensor itself. Other libraries also have this offset set to 5 degrees. This fixes part of #29