Attached a new lib for Bosch sensors BMP280 / BME280 for testing.
Library will detect sensor type - so if you have BME sensor you will get additional humidity values at output.
Please extract this zip file to your Arduino working folder, library should be in same directory, no changes needed.
Comments are welcome
Michael
(Deleted attachment - lib is now inside he latest releases (from 2.1.4) ..)
BMP280 / BME280 - new lib for testing
Re: BMP280 / BME280 - new lib for testing
What sensor you are using?10der wrote:no humidity
What firmware release of Z-Uno you are using?
Some more details would be great to understand the problem
Michael
Re: BMP280 / BME280 - new lib for testing
>>>What sensor you are using?
here is my init on rpi (where it work properly)
sensor3 = BME280(mode=BME280_OSAMPLE_8,address=0x76)
so, I have BME280 sensor
>>>What firmware release of Z-Uno you are using?
2.0.8
btw: RPI results
here is my init on rpi (where it work properly)
sensor3 = BME280(mode=BME280_OSAMPLE_8,address=0x76)
so, I have BME280 sensor
>>>What firmware release of Z-Uno you are using?
2.0.8
btw: RPI results
Code: Select all
#!/usr/bin/python
from Adafruit_BME280 import *
sensor3 = BME280(mode=BME280_OSAMPLE_8,address=0x76)
tempout = sensor3.read_temperature()
humidityout = sensor3.read_humidity()
pressure = sensor3.read_pressure()
print(tempout)
print(humidityout)
print(pressure / 133.322)
pi@rpi:~/My/Meteo $ ./test.py
8.0048760328
67.0146060325
770.573657513
Re: BMP280 / BME280 - new lib for testing
Strange, for my sensors it is still working -that's why haven't seen it...
----------
Sensor TypeBME 280
Temperature 22.63 C
Pressure 997 hPa
Humidity 35 %
----------
But I think I guess where maybe the problem - the oversampling procedure seems to be not full right.
So there maybe a timing problem.
Can you please change (for now) here in BME280::startMeasurement(void) (ZUNO_BME280.cpp)
from:
delay(mdelay);
result=getUncalValues();
to:
delay(45);
result=getUncalValues();
and tell me the result?
I will change the lib (oversampling settings) and test it again soon.
Please tell me if this change help.
Thanks,
Michael
----------
Sensor TypeBME 280
Temperature 22.63 C
Pressure 997 hPa
Humidity 35 %
----------
But I think I guess where maybe the problem - the oversampling procedure seems to be not full right.
So there maybe a timing problem.
Can you please change (for now) here in BME280::startMeasurement(void) (ZUNO_BME280.cpp)
from:
delay(mdelay);
result=getUncalValues();
to:
delay(45);
result=getUncalValues();
and tell me the result?
I will change the lib (oversampling settings) and test it again soon.
Please tell me if this change help.
Thanks,
Michael
Re: BMP280 / BME280 - new lib for testing
>>Can you please change
will do! kk
will do! kk
Re: BMP280 / BME280 - new lib for testing
issue still here
Re: BMP280 / BME280 - new lib for testing
Code: Select all
if(chip_id == 0x60){
Serial.println("!");
//uH = (int16_t)data[6] << 8;
uH = (int32_t)data[6] << 8;
uH |= data[7];
Serial.println(uH);
}
here is python code
Code: Select all
def read_raw_humidity(self):
"""Assumes that the temperature has already been read """
"""i.e. that enough delay has been provided"""
msb = self._device.readU8(BME280_REGISTER_HUMIDITY_DATA)
lsb = self._device.readU8(BME280_REGISTER_HUMIDITY_DATA + 1)
raw = (msb << 8) | lsb
return raw
thank you!
Last edited by 10der on 07 Mar 2017 20:37, edited 1 time in total.
Re: BMP280 / BME280 - new lib for testing
btw
after this operation
uH = (int16_t)data[6] << 8;
I got negative value...
after this operation
uH = (int16_t)data[6] << 8;
I got negative value...
Re: BMP280 / BME280 - new lib for testing
Yes, you are right - there is a mistake - it should be *int32_t*, as defined before.
Thank you for debugging!
I will correct the sample soon.
Michael
Thank you for debugging!
I will correct the sample soon.
Michael