0

BME280 Temperature Measurement Error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BME280 Temperature Measurement Error

by MichaelProino on Mon Apr 04, 2016 7:29 am

Hi,
I use BME280 on my project,
Although I try to change with another one, I realize that the temperature value is higher than the real value, approximately 10 degrees,
What may be it's reason?

MichaelProino
 
Posts: 14
Joined: Mon Sep 28, 2015 4:08 am

Re: BME280 Temperature Measurement Error

by jlewis808 on Mon Apr 04, 2016 1:52 pm

I too had this issue. I had to re-calibrate all 5 of my BME280 sensors. In order to do this, I followed the instructions on page 46 of the BME280 datasheet to recondition the sensor.
BME Datasheet
I used the first method:
1. Dry-Baking: 120 °C at <5% rH for 2 h
2. Re-Hydration: 70 °C at 75% rH for 6 h
Luckily - we have an environmental chamber at my facility to allow for these conditions.
After reconditioning the sensors - they are all within 2 degrees C of one another and all read fairly close for humidity and pressure.

I am now having another issue with these. The issue I am having is I have 2 BME280 sensors running on a raspberry pi 2 B+ using a TCA9548A multiplexer to switch between both sensors. I ran these sensors all weekend long from Friday, April 1st at 1:00PM until they decided to stop reading this morning - April 4th at 8:05 AM. The sensors are connected to a breadboard with the I2C TCA9548A multiplexer. When I noticed they stopped reading. I tried to run my script manually instead of through cron. I then received the following python error:

Traceback (most recent call last):
File "/home/pi/Documents/Adafruit_Python_BME280/datacollectionscriptmain.py", line 125, in <module>
sensor = BME280(mode=BME280_OSAMPLE_8)
File "/home/pi/Documents/Adafruit_Python_BME280/Adafruit_BME280.py", line 90, in __init__
self._load_calibration()
File "/home/pi/Documents/Adafruit_Python_BME280/Adafruit_BME280.py", line 96, in _load_calibration
self.dig_T1 = self._device.readU16LE(BME280_REGISTER_DIG_T1)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-0.9.3-py2.7.egg/Adafruit_GPIO/I2C.py", line 180, in readU16LE
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-0.9.3-py2.7.egg/Adafruit_GPIO/I2C.py", line 159, in readU16
IOError: [Errno 5] Input/output error


I then attempted a sudo i2cdetect -y 1 and only found the RTC and multiplexer that I have connected. The BME280 was nowhere to be found. I then connected 2 different BME280 sensors and it started working again.

Not sure what the deal is. Any help is greatly appreciated.

jlewis808
 
Posts: 4
Joined: Fri Sep 06, 2013 9:16 pm

Re: BME280 Temperature Measurement Error

by adafruit2 on Mon Apr 04, 2016 6:05 pm

could be loose wires? or needing a hard reset? not sure...

adafruit2
Site Admin
 
Posts: 18047
Joined: Fri Mar 11, 2005 7:36 pm

Re: BME280 Temperature Measurement Error

by jlewis808 on Thu Apr 07, 2016 10:31 am

I think this issue was related to the TCA9548A multiplexer and the timing in between selecting the channels. I put a delay in and all appears to be working now.
Thanks

jlewis808
 
Posts: 4
Joined: Fri Sep 06, 2013 9:16 pm

Re: BME280 Temperature Measurement Error

by jlewis808 on Tue Apr 12, 2016 1:35 pm

OK, so now it appears I am still having the same issue even with everything soldered down. The sensor and multiplexer combo has been working since 04/06/2016 at 8:00 AM until today - 4/12/2016 at 9:06 AM. I am rebooting the raspberry pi every hour on the hour. The sensor was not being picked up on i2cdetect even without the multiplexer plugged in. Rebooting did not work in resetting anything, so after rebooting twice - I plugged in a different sensor - a BMP180, read i2cdetect, and the raspberry pi found it. I then unplugged the BMP180, plugged in the BME280 and the raspberry pi was able to see them again. Is there a chance that the multiplexer is having an issue with the raspberry pi?

Below is the code I am using to switch between the channels of the multiplexer inside of python. I found it from a link on this forum for a different project.

I2C_address = 0x70
I2C_bus_number = 1
I2C_ch_0 = 0b00000001
I2C_ch_1 = 0b00000010
I2C_ch_2 = 0b00000100
I2C_ch_3 = 0b00001000
I2C_ch_4 = 0b00010000
I2C_ch_5 = 0b00100000
I2C_ch_6 = 0b01000000
I2C_ch_7 = 0b10000000

def I2C_setup(i2c_channel_setup):
bus = smbus.SMBus(I2C_bus_number)
bus.write_byte(I2C_address,i2c_channel_setup)
time.sleep(0.1)
print "TCA9548A I2C channel status:", bin(bus.read_byte(I2C_address))

time.sleep(2)
I2C_setup(int(1))
sensor = BME280(mode=BME280_OSAMPLE_8)
#sensor2 = BME280(mode=BME280_0SAMPLE_8)
degrees = sensor.read_temperature()
pascals = sensor.read_pressure()
hectopascals = pascals / 100
humidity = sensor.read_humidity()

print 'Timestamp = {0:0.3f}'.format(sensor.t_fine)
print 'Temp = {0:0.3f} deg C'.format(degrees)
print 'Pressure = {0:0.2f} hPa'.format(hectopascals)
print 'Humidity = {0:0.2f} %'.format(humidity)

time.sleep(2)
I2C_setup(int(2))
#sensor2 = BME280(mode=BME280_0SAMPLE_8)
degrees2 = sensor.read_temperature()
pascals2 = sensor.read_pressure()
hectopascals2 = pascals2 / 100
humidity2 = sensor.read_humidity()

print 'Timestamp2 = {0:0.3f}'.format(sensor.t_fine)
print 'Temp2 = {0:0.3f} degC'.format(degrees2)
print 'Pressure2 = {0:0.2f} hpa'.format(hectopascals2)
print 'Humidity2 = {0:0.2f} %'.format(humidity2)

Any help is appreciated.
Thanks

jlewis808
 
Posts: 4
Joined: Fri Sep 06, 2013 9:16 pm

Re: BME280 Temperature Measurement Error

by boelle on Sun Jan 27, 2019 8:01 am

i know this is an old one but i have similar issues

at -18C it's correct (frezzer is set to -18C)
at 5C it shows as 11C (fridge is set to 5C)
at 24C it shows as 26C (messured with 2 ATC Semitec 104GT-2 sensors connected to 3D printer)

fridge and freezer is same unit and both have a fan inside that comes on when door is closed

i know that a fridge sensor is prob. not a precise one, but i find it odd that the difference is greatest the closer it is to 0C

currently i'm trying to find a method where i can get temp closer to 30C and see if difference drops

i read that i can bake it in the oven, problem is that my oven can overshoot or undershoot as much as 10C compared to the dial setting

and hydration i dont know how i would do with normal items i have arround the house

temp is the most important for me, so could i correct them in my sketch if i know the differences at 4 points?
boelle
 
Posts: 53
Joined: Thu Sep 26, 2013 1:52 pm

Re: BME280 Temperature Measurement Error

by millercommamatt on Mon Jan 28, 2019 2:40 pm

Given what you're using as standards, I'd say the BME280 is measuring temperature just fine. Fridges rarely just sit at their set point. The internal temperature pattern is usually sinusodial as the cooling cycles on and off.

Somethings to keep in mind: Temperature can vary a lot over a very small spatial scale. Being near other objects will affect the measurements. Temperature sensors need to be well ventilated.

The BME280 in particular usually reads a degree or three warm. It seems the prevailing idea is that heating from the sensor itself is a cause. The temperature sensor on the BME280 is primarily there to provide temperature correction for the pressure sensor not to measure temperature of the ambient environment.

If temperature is what you're interested in measuring, I suggest finding a sensor made specifically for measuring temperature. The choice for you will depend on your requirements for size, accuracy, power consumption, ease of implementation, weather resistance, working range, etc...

millercommamatt
 
Posts: 249
Joined: Tue Jul 31, 2018 4:57 pm

Re: BME280 Temperature Measurement Error

by boelle on Tue Jan 29, 2019 7:22 am

i could live with that temp is corrected in code, it's for mominlaw so its not more critical than the temp should be +/-1C from what other temp gauges would say


reason why i used the fridge and freezer is that both have a built in fan to circulate the air inside so temp is the same both in the top and bottom


could i assume that room temp is more stable than the fridge? if so the 2-3 degree to warm findings are about the same with me

i have just always been told that getting as wide a temp span is better


when this weather station goes live it will be ventilated also, i have build a Stevenson screen/cage as not to restrict air movement but keep rain and sun out

what i will try to confirm that temp is only off by 2 is to turn off the heat in the room where the 3d printer is located and open the door to the balcony
and then i will see if the temp difference on printers 2 temp sensor and the BME280's are still the same

if the difference at say 10C on the printer is still 2C then i will just have my code subtract 2C from all readings before they are put on the lcd display
boelle
 
Posts: 53
Joined: Thu Sep 26, 2013 1:52 pm

Re: BME280 Temperature Measurement Error

by millercommamatt on Tue Jan 29, 2019 1:58 pm

reason why i used the fridge and freezer is that both have a built in fan to circulate the air inside so temp is the same both in the top and bottom


Those fans don't run all the time. There's more of a temperature gradient in there than you might think.

could i assume that room temp is more stable than the fridge?


Not really. Record the temperature over time and see for yourself.


I'd look into getting a certified and calibrated thermometer. I got one off eBay a while back for $6 USD shipped that was made by Thompson Scientific that was certified to be within 1 deg C.

millercommamatt
 
Posts: 249
Joined: Tue Jul 31, 2018 4:57 pm

Please be positive and constructive with your questions and comments.